views:

62

answers:

1

Apparently my app needs 2.5 MB (maybe because my photos need 2MB...) and then virtual device can't work with that much MB.

How can I make my virtual device support more than 2.5 MB to get my application working?

+1  A: 

I am going to deduce from your previous question that you are referring to this error message:

E/dalvikvm-heap( 248): 2621440-byte external allocation too large for this process.

I would suggest Googling that phrase and looking at solutions to the problem which apparently can be summarised as:

  • Use smaller images that are suitable for the size of an Android device
  • Resample your images
Christopher
then why other applications of the market haves more than 2.5MB ?
Paul
Other applications on the Market presumably don't attempt to allocate more than 2.5MB to an individual `Bitmap`. Don't do that (i.e. read the above) and see what happens. Also, you can always check other open source applications to see what they do, like the Android photo gallery app.
Christopher
no no, my bitmaps only have 300kb each, 2.5mb is all the application
Paul
The size of your APK is irrelevant. The error message and links I provided suggest that you're using up more than 2.5MB of memory when decoding an image file into a `Bitmap`, by allocating too many bits-per-pixel or something similar. The compressed image size (300kB) isn't necessarily the same as the uncompressed bitmaps size.
Christopher
ok thanks mate, then i have to use smaller images
Paul
any idea of max resolution in a android image?
Paul