Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My app got significantly slower on Android 4.0

I developed and tested an app on Android 3.2, it interacts with the SQLite database and show the results on the screen. I don't have animations or anything fancy. What I do have is a lot of ListViews to show data to the user.

The database for the app is very big, with somes tables having more than 300k rows. We tried to use AsyncTask in every interaction with the database, but there are some points we still have to optimize the performance.

The problem is that the company updated some of the tablets to Ice Cream Sandwich and the app is much slower than it was on Honeycomb. I loaded the same code, with the same db, in two devices, one running ICS and the other with Honeycomb. The app performed much better in the 3.2 device. I also tried using <uses-sdk android:minSdkVersion="14" /> but it didn't do better.

Is there anything I could do to optimize the performance on the 4.0? I also would love to know why this happened and if there's anything that could have caused that (some component or class that doesn't work that well on 4.0).

Thanks!

UPDATE: I found the solution for the main screen of my app. I was presenting a fragment that worked as a horizontal list, it was a HorizontalScrollView that loaded a huge list of data and created a lot of LinearLayout to be presented inside the ScrollView. I found a widget of a HorizontalListView and used it to load my list. Just that made the app faster. But I didn't find the answer to why it was slower on the ICS.

I also tried profiling the app, but it is a very hard thing to do, there's lot of information. I'll probably still do that in the next weeks to speed up the application. Thank you for all the answers and comments!

like image 411
Douglas Alves Avatar asked Dec 01 '12 12:12

Douglas Alves


1 Answers

My guess is it is related to hardware acceleration which is default enabled for ice cream sandwich. Hardware acceleration is nice but it sometimes comes with a performance decline.

There is another interesting read about android hardware acceleration by Dianne Hackborn on google+ I'd recommend you to look at.

like image 58
Warpzit Avatar answered Sep 21 '22 15:09

Warpzit