我们能否依靠我们的Android App 获得一定数量的内存, 或者手机模型或OS版本之间有差异?
比如,我有一个内存缓存,我把内存封限设为5 MB。 如果在一个设备上,我的应用程序只能用8 MB来玩内存,而在另一个设备上,则用24 MB来玩,我想调一下内存缓存封的上限,以利用多多少少的内存。
有没有办法弄清楚 金额有变化吗?
我们能否依靠我们的Android App 获得一定数量的内存, 或者手机模型或OS版本之间有差异?
比如,我有一个内存缓存,我把内存封限设为5 MB。 如果在一个设备上,我的应用程序只能用8 MB来玩内存,而在另一个设备上,则用24 MB来玩,我想调一下内存缓存封的上限,以利用多多少少的内存。
有没有办法弄清楚 金额有变化吗?
是的, 设备之间的最大堆积大小不尽相同。 您可以通过调用 < a href=" 返回当前设备的每个应用存储类的近似值。 这可以让您了解您在应用程序上应该施加多少硬性内存限制才能让整个系统最佳运行。 返回的值以兆字节表示; 基线和机器人的内存类为 16( 碰巧是这些设备的 Java 堆积限制 ) ; 一些内存较多的设备可能会返回 24 或更高 。 改变一个应用程序的堆积大小的唯一内在方法是在 < code> 中设置 < code > 和 mid: largeheap= " true" code > 。 这通常会将堆积大小从 48 增加到 128. 。 请注意, 这个方法只会在 3. x 平板电脑上起作用 。 否则, 您需要根设备, 这显然不是您想要作为开发者依赖的东西 。
对你有帮助
16 MB是给任何特定和机器人应用设定的最大内存限,有些第二代电话将返回每个过程或更多过程的24 MB内存。
< a href=" "http://skillgun.com/ question/480/android/basics/ what - is -the - 最高- memory-limit-given- for
I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...
I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...
I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...
I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...
To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?
When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...
I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...
I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...