On Wed, Jan 2, 2013 at 2:20 AM, Russell Wheeler < russellpeterwhee...@gmail.com> wrote:
> Latimerius, > > So how do you directly access them from the assets folder? > You have to know the name of the package whose images you want to use but that shouldn't be a problem in your case if I understand correctly. Then you just pass it to createPackageContext() which you call on one of your Activities (I use the "main" one but I guess it probably doesn't matter much which one you pick) to retrieve a Context of the package containing images. After that, everything works the same as when working with "this" package's resources - you call getResources() or getAssets() on the Context etc. > Doing it this way, are the images available to anyone who has root access? > i.e. can they steal your images? > Then can do that anytime anyway. Everybody seems surprised to learn that (I know I was!) but anybody can access your assets and resources any time they please with just minor inconvenience, and they DON'T need root for that. (There was a thread about this on this group last July I think, Mark Murphy had some insights back then so look it up if you're interested.) Why do you use assets? For ease, or for some other reason? I thought it > would be better to have them in the res folders so that the diff screen > sizes still get used, e.g. ldpi/hdpi etc folders? > I use assets because the program I work on is a game, or a toy, which uses custom rules to adapt to different screen sizes and densities. We started off using resources but quickly found out that Android's built-in scaling etc. was just ruining our art and throwing off our screen layout algorithms. Of course, even if res folders didn't work for us with our special needs, they can still work splendid for you. In that case, just go for res, I have no first-hand experience with that but I don't see any reason why it shouldn't work. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en