My application requires that when a snapshot is taken it must store in memory and next time when I restart the phone I must get a thumbnail of that photo in list of photos and the full scale photo when I click on it.
There are 2 ways I know.
Which is more efficient ?
This example demonstrates How to write an image file in internal storage in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
Storing whole images in Elasticsearch will not be very beneficial, because if the image is scaled/cropped and then used as a query, it will give incorrect results.
Store the images as a file in the file system and create a record in a table with the exact path to that image. Or, store the image itself in a table using an "image" or "binary data" data type of the database server.
Definitely store the images directly as opposed to in XML. It will take time to read the image from the file system but I wouldn't worry about this taking an excessively long time.
Read through the android docs on Data Storage for more info: http://d.android.com/guide/topics/data/data-storage.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With