Monthly Archives: August 2011

How to Export and Import Android Virtual Devices

Over the last couple of weeks, I have been testing my Android app on different devices. That work is going well. In this note, I’d like to share a couple of things that came out as side effects of that work, including:
– How to move Android virtual device (AVD) files from an Android Emulator to another machine.
– A set of AVD definitions that I found useful in checking an app on different screen sizes and screen densities.

Knowing how to move AVD files is important for a couple of reasons: (a) if you ever switch machines or do a complete reinstall of your Android environment, it would be good if you could reuse old device definitions rather than having to recreate them; (b) If you are working on a team, it saves a lot of time if there is a shared set of devices that everyone in the team is testing against.
Continue reading

Posted in Android | Tagged , , , | 21 Comments

Tridroid Presentation on Building an Android Dashboard UI

I prepared a presentation for the local Android Meetup group. In the presentation I explained and elaborated on my March 2011 blog article: “How to Build a Dashboard User Interface in Android”. A link is provided to the full presentation. Continue reading

Posted in Android | Tagged , , , | Leave a comment

My Guide to Performance Tuning For Android and Java

This is my guide to tuning performance of Java programs. It covers both cpu time and object memory analysis. I have found that this works for Java programs and for many Android applications. In the latter case, it helps if your Android application is structured so you can turn a section of an application into a standalone test case. Since many applications have background tasks, often implemented as subclasses of AsyncTask, this is usually easy to do.

The tool I prefer to use is HPROF. It is a simple profiling tool that is available with the Java SDK. It provides a variety of tools so you can address common performance problems, like the following: (1) you are allocating too many objects, which leads to a slow app because of too much garbage collection; (2) you are allocating objects and not properly releasing them, leading to a memory leak; (3) your computations are taking too long.

The topics I cover in this article include: (a) Getting started with HPROF in Eclipse, (b) HPROF Results (cpu times, object allocation), (c) Performance tuning suggestions, and (d) Other Android performance tuning tools. Continue reading

Posted in Android, Java | Tagged , , | 2 Comments