This article is in English.
Because I see many bad applications on Android Market, I’m going to start writing a few articles about good (hopefully best) dev practices. For now, let’s see 2 of them.
The First One
The most annoying thing you can find in many current apps, is the location of its files (cache, temp files, database, etc.) on the external memory (e.g. SD card).
So, PLEASE stop creating a folder on the root of the external memory! All your files should be located in this folder: /Android/data/<package_name>. You can read more about this in Google’s Android Dev Guide, right here.
The Second One
The second suggestion (apparently still ignored by developers) would be to use a drawable for each state of your controls (e.g. buttons, list item backgrounds). I’m not going to explain you here how to do it. There are plenty of tutorials over the Internet. Here’s an example, anyway, for a drawable that can be used as background for your list’s items:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false" android:state_selected="true" android:drawable="@drawable/my_blue_background" /> <item android:state_selected="true" android:drawable="@android:color/transparent" /> <item android:state_pressed="true" android:state_selected="false" android:drawable="@android:color/transparent" /> <item android:state_focused="true" android:drawable="@android:color/transparent" /> <item android:state_selected="false" android:drawable="@drawable/my_blue_background" /> </selector>