0

In my application I am generating some images which are only needed to my application but it should persist in the phone permanently.

To do this I have two ideas:

  1. Store in a separate folder in sdcard and hide this and maintain a database with imageIDs and imagepaths.
  2. Store the images itself along with their IDs in the database.

Out of those two which one is better? Is there any other solution that is better with respect to the performance and storage space? If yes, then please suggest a good solution.

Thanks in advance.

jbowes
  • 4,062
  • 22
  • 38
Chandra Sekhar
  • 18,914
  • 16
  • 84
  • 125

1 Answers1

1

The first one..

1: Store in a separate folder in sdcard and hide this and mentain a database with imageIDs and imagepaths.

is better to avoid large database file and conversion of blob type to image and vice-versa..

user370305
  • 108,599
  • 23
  • 164
  • 151
  • In this case, how to make those pictures private to my apllication? Can you suggest some link? – Chandra Sekhar Feb 24 '12 at 11:16
  • If images are in less numbers and small sizes you can also put those in /data/data//files directory so its a private to your application. Or if you want to put it in sdcard then make a directory name with "." prefix it will hide the directory. – user370305 Feb 24 '12 at 11:18
  • After hide, how would I retrieve those files? Do I need to specify the path including dot prefix or only the directory name/filename is enough to retrieve the file. – Chandra Sekhar Feb 24 '12 at 11:20
  • if you are hiding directory with "." prefix use "." in directory name to access it.. – user370305 Feb 24 '12 at 11:21
  • That means the URI of a file would be "/sdcard/.dirName/filename – Chandra Sekhar Feb 24 '12 at 11:24
  • Thanks a lot for guiding me till the end through comments. – Chandra Sekhar Feb 24 '12 at 11:26
  • Welcome buddy..! Also look at this question [How to hide a folder in sdcard in android](http://stackoverflow.com/questions/8135179/how-to-hide-a-folder-in-sdcard-in-android) and this tutorial [How To Hide Private Picture Folders From The Gallery-Android](http://www.makeuseof.com/tag/hide-private-picture-folders-gallery-android/) Happy coding..! – user370305 Feb 24 '12 at 11:29