Reputation: 135
I am working on a project where we are creating an Android app that requests data from a server to be displayed on the user's device (not sure how much more background information I can give... will try my best if more is needed). We are supporting from Gingerbread (2.3) and upwards (up to latest JellyBean 4.2).
Now the odd thing is that the app runs very fast and smoothly on phones that are running 2.3.x (these are in general, slightly older devices such as LG Optimus 2X), while if we try and run the app on relatively newer devices (Galaxy s3 etc.) that have JellyBean 4.1+, the app runs so slow that the performance becomes a usability issue. This occurs on screens that pulls data from the servers and displays them.
I have also confirmed this behaviour by running it on the emulator.
So I did some research based on the fact that we get the following in LogCat for only 4.1+:
06-29 23:11:17.796: I/Choreographer(691): Skipped X frames! The application may be doing too much work on its main thread.
So it seems like this thing called Choreographer was added for API lvl 16, and it coordinates timing of animations, inputs and drawings.
I'm wondering if this is causing this issue? Seems unlikely to be a hardware issue, our app doesn't have any animations and we do not have separate implementations for 2.3.x and 4.1+
Thanks
Upvotes: 0
Views: 396
Reputation: 3838
I has experienced the same thing on Kindle Fire, Sony Xperia Z and Samsung S4 (all with android 4.2).
The fix is: at App Manifest file remove "android:supportsRtl="true"".
Hope it will save your time. I spend 4 hours on tests and merging before i got it.
Upvotes: 1
Reputation: 3636
Starting with Ice Cream Sandwich, the default behavior of AsyncTask
has changed from a parallelized executor to a serialized one.
As you are executing several network requests in a batch of AsyncTask
(as seen in comment), that means your application waits for the previous request response before lauching the next one.
You can change the executor of an AsyncTask
using this code:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
myTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
else {
myTask.execute();
}
Source: AsyncTask Threading Regression Confirmed from CommonsWare blog.
Upvotes: 1