Android Development internal memory/app space issue
A friend and myself are creating an app for the android to help as a game guide. I was wondering how you have, or would deal with the issue of a memory constraint. We are looking at about 100+ small 32x32px images, 100+ 3-5 second wav files, and a great deal of text. We are debating on how to handle the issue of creating a <5 MB app for the market. We don't exactly know how to handle this seeing as how each image requires a large, medi开发者_StackOverflow中文版um, and small DPI image. We thought one option would be to store each image and sound file on an online server. The only problem with that is that we would need about a <1 second download time for each sound and image. Or since only 40 - 50 image / sound combos would be needed at a time load them at once into cache, and clear them when the app is closed. Are there any better suggestions, or which of the two of our ideas would be best?
You should definitely go for online storing and retrieving images on the device. Once the images are downloaded, you could store them on the device (preferably SD card), and next time reload them from there, which would speed up the loading time.
Alternatively, you could use one of the image scaling algorithms and store an image of one size only, and then generate the image of an appropriate size. Have a look at this algorithm
精彩评论