There are severe problem with using the Android Emulator on a netbook / mini-laptop.
It is much better to use your phone. That’s it: you develop on Eclipse and run and debug the program directly on your phone.
In order to do this you need 3 steps:
- set up Eclipse to be able to develop for Android (basically install the ADT plugin) as explained here: http://developer.android.com/sdk/eclipse-adt.html#installing
- link the mobile and your development workstation with the USB cable that comes with the phone
- enable logging on your Android device to be able to debug:
- echo 1 > /sys/kernel/logger/log_main/enable // ** ’1′ is enable log_main
- echo 2 >/sys/kernel/logger/log_main/priority // ** ’2′ is the log level
Now, you can install your application on the device by doing:
/home/dan/android-sdk-linux_x86/tools/adb install -r /home/dan/MyAppForAndroid/bin/MyAppForAndroid.apk
You can uninstall the application by doing:
/home/dan/android-sdk-linux_x86/tools/adb uninstall com.myapp.android.app
You can check the log on the device:
/home/dan/android-sdk-linux_x86/tools/adb logcat
You can check the log on the device, restricting to the messages from your application:
/home/dan/android-sdk-linux_x86/tools/adb logcat | grep ‘MyApp’
You can reset the log:
/home/dan/android-sdk-linux_x86/tools/adb logcat -c
In your application you can add an entry to the log:
Log.e(“MYAPP”, “message to log”);
If you want to log the whole backtrace of an exception:
// code buggy code
} catch (Exception e)
Log.e(“MYAPP”, “exception”, e);
}
