Android的性能API级别11以上 [英] Android performance api level 11 and above

查看:323
本文介绍了Android的性能API级别11以上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎有一个无法解决的问题,我已经度过了周末就可以了,不能把它固定。 当我做一个简单的测试应用程序有两种活动: 1. Mainactivity:几个按钮,一计时器(后台线程)和轻请求到一个SQLite分贝。 2.第二活动:几个按键,只有一个拥有上点击监听器,当你点击它,你只是回到第一个活动。 我用大按钮(约四分之一的屏幕高度的屏幕宽度),在XML布局资源不包含任何嵌套的重元素或其他外来的东西。

I seem to have an unsolvable issue, I have spent the weekend on it, couldn't get it fixed. When I make a simple test app with two activities: 1. Mainactivity: a few buttons, a timer (background thread) and a light request to a SQLite db. 2. Second activity: a few buttons, only one has a on click listener, when you click it, you simply go back to the first activity. I use large buttons (screen width about a quarter of the screen height), the xml layout resources do not contain any nested weight-elements or other exotic things.

这是一个测试项目,它没有其他的功能。

It is a test project, it has no other functionality.

我有以下严重的问题: - 当我在manifest文件中设置API级别为3,一切都运行完美。 (在兼容模式下自动画面) - 当我设置的API级别11或更高版本,它可能需要长达10秒的第二个活动加载。 后第一次打开第二个活动,事情似乎被缓存,延迟不复存在。 - 当我设置的API级别11或更高,我强迫(屏幕清晰度)兼容模式:没有变化,延迟仍然

I'm having the following serious issue: -when I set the api level in the manifest file to 3, everything works perfect. (screen automatically in compatibility mode) -when I set the api level 11 or higher, it can take up to 10 seconds for the second activity to load. After the first time opening the second activity, things seem to be cached, the delay no longer exists. -when I set the api level to 11 or higher, and I force (screen res) compatibility mode: no change, the delay remains.

我已经建立这个测试项目,因为我升级较旧的应用程序时,就遇到了这个问题。它顺利运行在较旧的API级别,每当我把它的Andr​​oid版本3或更高版本,它会延迟长达25秒! (甚至打开一个活动,只显示静态文本...)。

I've build this test project because I ran into this issue when upgrading an older app. It ran smoothly on older api levels, whenever I put it to Android version 3 or higher, it gets delays up to 25 seconds! (even for opening an activity that shows static text only...).

我正在测试一个新的Galaxy Tab,不能成为问题。我花了几个小时使用Google的一个解决方案,从来没有发现任何接近它。我甚至完全取消安装Eclipse和所有的Andr​​oid资源和拥有一切新鲜的安装和更新(包括我的Galaxy Tab的恢复出厂设置)。没有运气。

I am testing on a new Galaxy Tab, that cannot be the problem. I have spent hours googling for a solution,never found anything close to it. I even completely de-installed Eclipse and all android resources and had everything fresh installed and updated (including a factory reset of my Galaxy Tab). No luck.

我做了跟踪,问题是在GLES20Canvas.nDrawDisplayList。看来,建立这个清单需要花费大量的时间,即使没有太多的建...

I did a trace, the problem is in GLES20Canvas.nDrawDisplayList. It seems that building this list takes a lot of time, even when there is not much to build...

有没有人有一个线索,我怎么能解决这个问题?

Does anyone have a clue on how I can solve this?

谢谢, 马丁

推荐答案

我已经找到了解决这一问题,通过检查这个帖子: HTTP://$c$c.google.com/p /安卓/问题/详细信息?ID = 22514

I've found a solution to this issue by examining this post: http://code.google.com/p/android/issues/detail?id=22514

解决的办法是禁用硬件加速。

The solution is to disable hardware acceleration.

的Andr​​oidManifest.xml ,在应用程序标记中,添加:

In the AndroidManifest.xml, in your application tag, add:

android:hardwareAccelerated="false"

现在一切又运行平稳。不幸的是启动时的硬件加速不会使您的应用程序运行得更快。

Now everything runs smooth again. Unfortunately hardware acceleration doesn't make your app run faster when it starts.

这篇关于Android的性能API级别11以上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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