Optimize Performance in Android Apps
Submitted by Sriram Ramani (@sriramramani) on Thursday, 17 October 2013
Section: Systems Technical level: Intermediate
Developing Android apps is easy. Making them perform better is a bit hard. The idea of this session is to showcase the lessons learnt from making the Firefox for Android run faster. From custom views to shaders to overdraws, the session will be filled with tips and tricks to make apps run at 60fps.
Building Android apps with XML and Java is easy. But making them run at 60fps is hard. Have your ever had a stuttering ListView that skips frames? Is your app filled with red color when the "Show GPU Overdraw" is turned on? Do you use a lot of views and not sure how to reduce them? Did you know that Twitter uses a single custom view for each row of tweet in their app? Then this session is for you!
The major topics of the session will include:
1. Removing overdraw using Droid Inspector.
2. Reducing views using compound drawables.
3. Playing with shaders to transform bitmaps easily.
4. Asynchronous loading of ListView images.
5. Common Android UI pitfalls.
The session will have more code snippets. The session will also showcase apps like Firefox, Facebook and Twitter in 3D, and use them as examples to understand and relate to the problems.
I work for Mozilla on their Firefox for Android application. I've been a major part of their native re-write, and brought down the startup speed of the app from 20s to 800ms. In constantly changing the UI for Firefox in the past two years, I have solved many common problems faced by apps. Being a part of the open source culture, I blog my findings at http://sriramramani.wordpress.com/ I've always felt that finding overdraw using UiAutomator and HierarchyViewer is not easy. This led me develop Droid Inspector (http://www.sriramramani.com/droidinspector) -- an Android tool that allows debugging apps in a 3D view. To get an idea of UI/UX and the user centric research, I did my Masters in HCI from Carnegie Mellon University.