简体   繁体   English

Android开发内存/应用空间问题

[英]Android Development internal memory/app space issue

A friend and myself are creating an app for the android to help as a game guide. 一个朋友和我自己正在为Android创建一个应用程序,以作为游戏指南。 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. 我们正在查看大约100多个小的32x32px图像,100多个3-5秒的wav文件以及大量文本。 We are debating on how to handle the issue of creating a <5 MB app for the market. 我们正在就如何处理为市场创建小于5 MB的应用程序的问题进行辩论。 We don't exactly know how to handle this seeing as how each image requires a large, medium, and small DPI image. 我们不完全了解如何处理此问题,因为每个图像如何需要大,中,小DPI​​图像。 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. 唯一的问题是,每个声音和图像大约需要不到1秒的下载时间。 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. 或者因为一次只需要40-50个图像/声音组合就可以立即将它们加载到缓存中,并在应用关闭时清除它们。 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. 下载图像后,您可以将它们存储在设备(最好是SD卡)上,然后下次从那里重新加载它们,这将加快加载时间。
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 看看这个算法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM