Storing large amount of images in android - java

I am in the planning stage of making a database application for android phones. One of my requirements is that I be able able to provide offline access for users. I am wondering what would be the most efficient way of storing a large amount of images (around four hundred-several thousand).
Oh, the images have been pre-compressed/optimized for mobile viewing. The 50mb limit on apk for the market won't be a issue.

You have to develop simple logic.Suppose you have connection then download all images.Now you have two way to access these images while you do not have connection-----
Store all images in data base as blob(But it not feasible to store huge amount
of data to database)
Second..
Store all images in sdcard(by making a folder in it) and now store link of these
images in data base Table.Suppose you donot have connection then first fetch
image path from DB Table then fetch file from sdcard and display

I would suggest storing the image files in sdcard and filename/path in sqlite DB. Store files in /Android/data/your.package.name/cache/ directory. When the user deletes the application, the cache folder will be deleted and also all the stored images.
Application build file(apk) size will be less as tofeeqahmad was suggesting.

Related

File system alternatives for image upload/display

I got a web application with a Java backend and React frontend. It allows users to upload and display pictures like in an album setting.
The application fetches data from a MS SQL server containing data about an image and then displays it in react.
The database contains a table with information about the image (filename, extension etc.) but not a BLOB.
I am currently displaying the image in react by creating an url from my local machine.
My question is now, what file system alternatives is there when i want to stop storing the images locally on my windows machine. Is it possible to use Google Drive API or something similar? What about SFTP? Would appreciate free solutions to begin with.
You can use Amazon S3 to store your images. store information about the image like file name, bucket name ,... etc in your database and store the image itself in Amazon S3.
There are also other alternatives to Amazon S3 if you want, like MinIO, which is open source and S3 compatible.

How to store the images and display the same on the screen using struts?

I want to store the images and display the same on the screen using struts. Is it better to store the images in database or on the file system? I have more than 10,000 images.
Storing images in the database as objects like blob or clob is generally not recommended as this will make the database size huge. You may get poor results while processing your resultsets. The better way to do this is have the images get stored in your file system and simply use its references in the databases which is efficient. Using a hash check on the uploaded images will also help in verifying the integrity of the images if they are uploaded to the server from the clients.
File system. It turns out it's quite good at storing files.

What is the standard way of compressing uploaded images on web applications?

I have an application where users can upload images.
This images are usually taken directly from cameras and in 1mb sizes or more.
May I know what is the standard way of compressing this images before saving them to database as BLOB?
The images stored in database are just for viewing, there is no requirement to edit the image.
I have read this:
Compress Image before Saving to disk in Java
But I am wondering there are more standard ways so that the system can be more maintainable.
some codes and links will be greatly appreciated +1

Securing database and saving all sorts of files

I am trying to save some documents/Images and files in sqlite database. The documents contain different types of pdf,.doc etc files and different format images. Now once I stored it in the blob format, I want to do a backup of the database to sdCard. I however want this backup to be readable only by app for securing the data inside.
Now the question is , for storing different types of files, Do I have to use some sort of other database and for securing. what should I do?
Best Regards
Android's built-in SQLite does not support encryption.
Try instead a library like SQLCipher.
One solution is to use blob and to store the raw data of the file as a column in the db as you are currently doing.
Other solution which I think is better to store the files on the Internal Storage and just store the file paths in the database. Internal storage is private for your application so no one will have access to the files, so your security concerns are taken care of.
see here for how to do this:
Creating folder in internal Memory to save files and retrieve them later
But be aware that can using too much internal storage can make people's phones run out of internal storage and they might decide to delete your app.

Data Storage Options in j2me

I am creating application in j2me. There is a huge data with whom I have to deal.
I have used RMS but speed of retrieving a data from RMS is tedious process. It takes long time then normal speed.
I can't use File because it requires permission every time whenever I fetch data or store data.
so is there any other options for storing large data in j2me.
Thank you....
Some third party database available for j2me application. See this link for list of database.
Store the data into text files and store the text files into your project workspace. You can read the data from this text files.
Finally you can store the data into server and fetch the data from server using webservice. But needs GPRS.
I preferred last point for using huge data.
1.
Some third party database available for j2me application. See this link for list of database.
2.
Store the data into text files and store the text files into your project workspace. You can read the data from this text files.
3.
Finally you can store the data into server and fetch the data from server using webservice. But needs GPRS.
I preferred last point for using huge data.
harsh

Categories

Resources