对于Android应用程序的最大大小? [英] Maximum size for android application?

查看:149
本文介绍了对于Android应用程序的最大大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很难找到一个更新的回答这一点。

I'm having a hard time finding an updated answer for this.

到目前为止,我已经瞄准土地我的资源< 16MB。但是,这是越来越难做了进一步沿着我得到的,我的意思是,一个1000×1000的.png文件使用了大约1MB。

So far I've been aiming to land my resources <16mb. But This is getting harder and harder the further along I get, I mean, a 1000x1000 .Png-file uses around 1mb.

显然,我的目标,以保持尽可能小,但在什么尺寸,我应该开始担心?计划在发布针对Android> 2.1

Obviously I'm aiming to keep it as small as possible, but at what size should I start worrying? Planning on releasing for android >2.1

推荐答案

您可以得到最大的healp大小:

You can get the maximum healp size with:

    Log.d(TAG,"Memory Class: " + ((ActivityManager) getSystemService(ACTIVITY_SERVICE)).getMemoryClass());
    Log.d(TAG,"Heap size: " + Runtime.getRuntime().maxMemory());

如果您加载很大的PNG文件,你应该看看关于如何在Android上处理大图像的最佳实践,但记住,你的一些方案供BitmapFactory对如何加载图像巨大的影响:

If you are loading big PNG files, you should look for the best practices on how to handle big images on Android, but have in mind that some of your options for the BitmapFactory have huge impact on how the image is loaded:

-inScaled集时,可以通过高密度的屏幕新设备的一个因素2或3增加位图的内存大小,

-inScaled when set may increase the bitmap memory size by a factor 2 or 3 in new devices with high screen density,

-ARGB类型可以从每像素2字节(RGB_565和ARGB_4444)去4个字节(ARGB_8888),所以一个的2再次因子

-ARGB type may go from 2 bytes per pixel (RGB_565 and ARGB_4444) to 4 bytes (ARGB_8888), so a factor of 2 again.

好运。

这篇关于对于Android应用程序的最大大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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