开发者

Android resource hungry operations

  1. I am using JSON to receive data from the web service, creating text to JSON object is resource hungry operation.
  2. I have to load images from the web, I am lazy loading images in the async process how can I compress and make the cache ??
  3. After the crash, how can I stop re-launching activity?
  4. How can I know how much memory remaining an开发者_开发百科d Android OS will kill my object?


You can cache your images using a pool of SoftReferences (http://developer.android.com/intl/de/reference/java/lang/ref/SoftReference.html). This will allow the OS to clean them up if it's running out of memory while still allowing you to access them. This should help with #2 and #4, but I am not sure what you mean by #3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜