A few tips that can help you optimize your app in terms of UI:
use convertView
for list adapters - it would be very expensive if you create a new view inside Adapter.getView()
as this routine is called for every position in the list. Using convertView
lets you reuse the already created view. Good example (together with the use of ViewHolder
) can be found in ApiDemos.
It might happen that your layouts are not fully optimized and can be improved (for instance by using merging or removing parents). Android tool layoutopt will find such a situation for you. It can be used with HierarchyViewer for inspecting individual views. More info here.
remove the background drawable - Android framework used to have (does it still have?) a problem with detecting what views should be drawn. There is a chance that your (default) background drawable will be drawn only to be subsequently hidden by your opaque UI. To get rid of this wasteful drawing simply remove background drawable.
It can be done using a custom style
<resources>
<style name="Theme.NoBackground" parent="android:Theme">
<item name="android:windowBackground">@null</item>
</style>
</resources>
A few tips that can help you optimize your app in terms of battery usage:
check networking type and wait until user gets in the area with wifi or 3G (and not roaming) and only then allow him to use connection
use gzip for textual data whenever possible to speed up download and parsing
recycle complex java objects such as XmlPullParserFactory
/BitmapFactory
/StringBuilder
/Matcher
etc.
For more battery tricks see Coding for Life - Battery Life, That Is.