What is the better approach of hiding selected images from the gallery from my application.
Changing the extension of the image with some extension
Problem with appraoch 1: Using file explorer we can view the images
Encryption of images
Storing the images in our local database and deleting the image from the location
Please can any one suggest the best appraoch
1. Chnaging Extention: This is not a good way to do.
2. Encryption of Image: If it is a security reason this is a better ontion but if anyone delete that file then you may face problem.
3. Storing the images in our local database and deleting the image from the location: This is also a good option.
I will suggest you to go with option 3 i.e. Storing the images in our local database and deleting the image from the location.
Related
This question already has answers here:
What is the best way to store the image in the memory of app?
(4 answers)
Closed 6 years ago.
I'd like to be able to programmatically work with Images, ImageViews, Drawables, and SQLite blobs (byte arrays). I inevitably want to be able to have a program that lets me acquire images from the Gallery app or something similar (ie camera), and then place them in a gallery construct within my app and work with them from there. Storing them in SQLite database's as needed.
I haven't come across anything that works. Much of it is deprecated. I have a simple project that is working with text in a SQLite database, and am now trying images.
If you can show or send me someplace that shows how to work with these constructs that would be great. Though to be more specific for this thread I'll state a few things I'd like to do:
Converting Drawables to ImageViews and converting Drawables to SQLite blobs.
Acquiring images from outside the program and placing them in the Drawables section.
Best constructs for working with images.
Thanks,
convert a image to byte[] and easy to store SQlite db
Don't store images in SQLite, instead of saving images save their path into SQLite, and later you can load image from their path.
and if you are loading images from web then you can use Universal Image Loader. It will display and store images in device memory and you can load images offline anytime with same url.
Instead of saving image as blob, save the image url. Or save it in external file in sd card or phone memory.
To save it in a link,
When the user selects an image from gallery. Call the upload image function ( it can be a BoundService ). You can find it by googling it.
When the upload image is successfull, ull get the image url in Json.
Just save that image link in your sqlite database.
Hope it helps.
I want to make image backup through my Application what is the best way for storing large amount of data . I tried to save image in sqlite database it worked fine for small amount of data in case of large amount it shows MemoryOutOfBoundExceptions after increasing the Heep size(android:largeHeap="true").
please help me guys .
If you want to save only image or any file try to save only path of that file in database.After that you can get file path by normal SQL query and access file from file path.
Instead of Storing Large data in Application you have to store it DataBase so it will speed up your Application and you have no Exception produce like OutOfMemoryException in your Application.
You don't store images in databases, that makes the database huge and slows it down. Store the images to disk and store the path to the file in the database. This will make the database a lot lighter and faster.
If you're developing for Android, i'd also recommend using something like Picasso, Fresco or Glide to display your images too. They cache the image and use memory efficiently when doing operations like scaling images.
I want to store array of images for different records.There is a list view for records and when user clicks on particular record new activity is started and i want to display the array images there. How can i do it?
I tried storing images into draw able folder and using them with R.id but it makes my app heavy.
there are several way to dealing with it but not solve it!
1: you can store your image in your assets folder. it can help you to manipulate and working with your images.
2: reduce your image resolutions.
3: create a web server and request your image from the server instead of save them in your local storage.
also these are not solution but some good trick to deal with this problem!
I follow this Instruction and it works.
Problem:
Every time I exit my application I need to capture again another image but the image that was been capture is save in the android gallery
Question:
How can I save the image in database so when I open my application the image will be their.
Unlike some comments suggest, image format doesn't matter. You can either save it as BLOB (byte[]) or text (converting it to Base64).
Anyway it's not a good idea to store images in a DB, prefer a file, as argued over here.
i will advice you get the path at which the image is located at in the android device and load up on your application start. the case of saving it in a database is not cool. that is like consuming the user's memory space on the database side and also the device storage which is not cool.
I want to use a large set of images in my application, that are used in a gallery view. However using the res folder seems not possible with larger set off images. What is the best way for including the images into my apk?
You can save the images in a database and add your database to the apk (a way to do so described here. You would read images from the database using Cursor.getBlob
Storing all the images in the res folder will be quite a hefty job so what I recommend is that you save all the images on a web server. And then retrieve the required images from their respective URL's. The following link has a full tutorial on retrieving images from a particular URL.
How to download and save an image in Android
Hope it helps.