0

I'm working on a feature that lets users select their own background image in an app.

Should that image be copied into an app associated folder after they selected it or what's convention for this?

pb2q
  • 58,613
  • 19
  • 146
  • 147
Anky
  • 127
  • 2
  • 11
  • Since images in public storage can be deleted etc by the user it would be wise to copy them to an app folder. Also using unscaled images directly can be too much memory wise so creating a scaled copy is better for that too. – zapl Sep 27 '12 at 11:45

1 Answers1

0

In this case the user has freedom to select a picture from the other folder hierarchies and that picture can be deleted by the user. So you should save a copy of that image in your application folder and decode that picture to use as the background.
But the user can repeat this operation several times and saving a copy of each picture will consume a lot of space so, you should just create a single file that will be overwritten each time the user selects a picture to change the background.
And you need not to have a very high resolution image. You should down sample the image and then save it.
Follow this link for effective bitmap decoding.

Community
  • 1
  • 1
karn
  • 5,963
  • 3
  • 22
  • 29