Not sure about the image stuff.. from what I've seen you generally would load/cache images at the start so that you don't hit any delay when you actually need them. Depending on the size of the images and number of them, you may run up against the 16 to 24MB ram limit per app. This has been discussed in other threads regarding some of the limitations of Android presently with regards to iPhone quality games and music apps.
As for the classes, unless the Dalvik JVM is completely different, classes get loaded when needed.. or instantiated/accessed. They will reside in the .apk file, but only should consume memory when they are first needed. It's been a while tho since I got into how the JVM loads classes. The one aspect I forget how it works is if a class imports another class... let's say you have Class A that uses Class B in a method.. there is an import (unless they are in same package) for that class B. I forget if the JVM actually loads the bytecode for Class B at the time Class A is loaded due to the import... or if it wont bother looking for Class B until it's referenced in the one method that Class A uses it in. I think it's the latter.. I think the import causes the JVM to find the class..but not actually load the bytecode until needed. On Thu, Jan 14, 2010 at 5:57 PM, miguel <miguelp...@gmail.com> wrote: > Hi everyone! > > I will work in an Android videogame soon. It will need a lot of > artwork which means that will have a few image resources. > Mi question is about the loading process of the application and its > memory optimizations. > > About the pictures: > How does the VM handle the drawable resources or the classes of the > application that are not used yet, I mean, does the application load > everything at once or just under demand? > > About the unused classes: > Does the declaration of unused classes consume memory or are them just > loaded when I create an instance of them? > If some clases have a lot of fixed static data (for example, preloaded > locations for a map) is all that data consuming memory when the class > is not used or its loaded by demand? > > Thank you very much in advance. > Sorry for my bad english. > > Best regards. > > Miguel > > -- > 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<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en >
-- 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