How to remove database from Android?

adb shell
# cd data
# cd data
// enter your applicaiton’s folder
# cd com.java23.test
# cd databases
# rm *

If you’d just like to remove one table, replace the last step with
# sqlite3 drop table

How to get back the lost R.java?

In an Android project in Eclipse, sometimes you can’t find the file R.java, and can’t remember when it disappeared. The file can’t be generated by yourself. If you do that, it will never be upated by Eclipse.

The key point is that there must be something wrong in your res folder, maybe drawable, maybe layout. What you can do is just correct the error. Then file R.java will come back.

Use spaces instead of Tab in Eclipse

As a Java programmer, my preferable IDE is Eclipse. The code editor uses Tab key to adjust the indentation by default. But I like to use 4 spaces instead of the Tab key. Following is a simple guide.

  1. Select the menu: Windows -> Preferences
  2. Select General -> Editors -> Text Editors
    Check “Insert spaces for tabs”.
  3. Select Java -> Code Style -> Formatter
    Create a new profile, and choose “Spaces only” as the Tab policy.

Remove application from Android emulator

  1. Run emulator
    <Android Installing Path>/tools/emulator.exe
  2. Check the installed application list.
    adb shell ls /data/app
  3. Remove a installed application.
    adb shell rm /data/app/<apk name>