有效的方法来管理大阵位图的android [英] Efficient way to manage large array of bitmaps android

查看:148
本文介绍了有效的方法来管理大阵位图的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于管理一个大阵位图的推荐/最佳实践的问题。
(这是一个连环画式的应用程序,用户通过,并且创造了新的网页...喜欢的便签虚拟一堆K +)
previously,我有这样的位图举行对象的ArrayList,(性能良好),但我很快就遇到了内存不足的问题,与Dalvik虚拟机的堆限制。

I have a question regarding the recommended/best practice for managing a large array of bitmaps. (It's a flipbook type app where the user goes through and creates new pages...like a virtual pile of sticky notes k?) Previously, I had an arraylist of objects that held bitmaps, (good performance) but I quickly ran into Out of Memory issues with the dalvik vm's heap limit.

后来我试着存储画面以SD卡作为缓存上不显示位图,然后抓住他们的需求,但我觉得这是我的电话超过previous方法上显著慢。

I later tried storing the bitmaps not displayed on the screen to the sd card as cache and then grabbed them on demand, but I found this to be significantly slower on my phone than the previous method.

什么是攻击这个问题?

推荐答案

也许你可以尝试的组合。请将位图SD卡上的缓存,当位B被加载,加载位图A和C到内存中,其中A和C是在您的应用程序周围的B位图。

Perhaps you could try a combination. Keep the bitmaps on sd card as cache and when bitmap "B" is loaded, you load bitmaps "A" and "C" into memory, where "A" and "C" are the bitmaps surrounding "B" in your app.

这篇关于有效的方法来管理大阵位图的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆