Android api performance level 11 and above

I seem to have an insoluble problem, I spent a weekend on this, I could not understand. When I make a simple test application with two actions: 1. Mainactivity: a few buttons, a timer (background thread) and an easy query to SQLite db. 2. Second action: several buttons, only one has a click listener, when you click it, you simply return to the first action. I use large buttons (screen width about a quarter of the screen height), xml layout resources do not contain nested weight elements or other exotic things.

This is a test project, it has no other functions.

I have the following serious problem: - When I set the api level in the manifest file to 3, everything works fine. (the screen is automatically in compatibility mode) - When I set the level to 11 or higher, it may take up to 10 seconds to load the second activity. After the first opening of the second action, everything seems to be cached, the delay no longer exists. -When I set the api level to 11 or higher, and I force (res screen) compatibility mode: no changes, the delay remains.

I created this test project because I ran into this problem when updating an old application. It worked smoothly on older api levels, whenever I add it in Android version 3 or higher, it gets delays of up to 25 seconds! (even to open an activity that only shows static text ...).

I am testing a new Galaxy tab, which may not be a problem. I spent a lot of time looking for a solution, never found anything close to it. I even completely disabled Eclipse and all Android resources and updated all updates and updated (including factory reset my Galaxy tab). Bad luck.

I made a trace, the problem is in GLES20Canvas.nDrawDisplayList. It seems that creating this list takes a lot of time, even if you don’t build it a bit ...

Does anyone know how I can solve this?

Thanks Martin

+8
performance android
source share
2 answers

I found a solution to this problem by studying this post: http://code.google.com/p/android/issues/detail?id=22514

The solution is to disable hardware acceleration.

In AndroidManifest.xml in the application tag add:

 android:hardwareAccelerated="false" 

Now everything is getting smooth again. Unfortunately, hardware acceleration does not speed up the launch of the application at startup.

+3
source share

GLES20Canvas.nDrawDisplayList

when this happens, it is expected to have a large portion of the time if you are drawing a lot, especially very big views .

I would like you to give a link to Do and Dont from android-30-hardware-acceleration

+1
source share

All Articles