Reputation: 39
I am making an application in which i take a picture from the camera and save in database by compressing in ByteArray but i have read that in if there is various large number of images than precessing of application may be slow by reading images from database so what is the best to store images (either in internal memory or sdcard) and display in ListView?
Thanks
Upvotes: 2
Views: 395
Reputation: 322
The best way is to store images in SDcard with a separate folder. (Using internal memory wont be helpful as it would utilize the space required for installation of other application.)
Every time you load your application read the contents of the folder and populate your list. You need not to maintain seperate database for it. Use Caching Bitmaps for better performance of your code.
Best practice would be as per my opinion
catch(Exception e)
clause will not catch it.Upvotes: 1
Reputation: 16393
Storing images in your database will slow down your queries and is generally a bad idea overall.
See this SO question too.
Upvotes: 1
Reputation: 13101
Save the image to your sdcard. The best approach is to use ImageCache.
Upvotes: 1
Reputation: 141
Storing images in any databases is a bad idea, slow takes more space etc. Best option i know of is to store paths or links to those images in database and the actual files on some storage like sdcard or internal storage, if those pictures are big or will take significant amount of space i would place them on sdcard .
Upvotes: 0