Android Tutorials - Herong's Tutorial Examples - Version 3.01, by Dr. Herong Yang
Installing "AboutAndroid" to LG-P925g Phone
This section provides a tutorial example on how to install my 'AboutAndroid' application to my LG-P925g phone. 'HelloAndroid' needs to be uninstalled first, because both applications share the same Java package name 'com.herongyang'.
My first application "HelloAndroid" works on my LG-P925g phone, now let's see what will happen to my second application "AboutAndroid".
1. First, install the "AboutAndroid" debug package to my phone using the "adb -d install" command. See previous tutorials on how to build the debug package.
C:\herong\AboutAndroid>\local\android-sdk-windows\platform-tools\adb -d -s install bin\AboutAndroid-debug.apk 806 KB/s (23132 bytes in 0.028s) pkg: /data/local/tmp/AboutAndroid-debug.apk Failure [INSTALL_FAILED_ALREADY_EXISTS] ^C
What's wrong with the installation? This is the first time installing the "AboutAndroid" package on my phone. Why I am getting the "INSTALL_FAILED_ALREADY_EXISTS" error?
After checking "AndroidManifest.xml" files from both "HelloAndroid" and "AboutAndroid" applications, I notice that both applications are sharing the same Java class package name - package="com.herongyang". This means that I can not install both "HelloAndroid" and "AboutAndroid" applications on to the same Android phone.
When building any future applications, remember to give different Java package name for each application.
2. Uninstall "HelloAndroid", then install "AboutAndroid".
C:\herong\AboutAndroid>\local\android-sdk-windows\platform-tools\adb -d uninstall com.herongyang Success ^C C:\herong\cod\AboutAndroid>\local\android-sdk-windows\platform-tools\adb -d install -s bin\AboutAndroid-debug.apk 778 KB/s (23132 bytes in 0.029s) pkg: /sdcard/tmp/AboutAndroid-debug.apk Success ^C
3. Go to the phone. Tap on "Home", "Applications", then "AboutAndroid" to run the application. You will see an error message on the screen:
Sorry! The application AboutAndroid (process com.herongyang) has stopped unexpectedly. Please try again. [Force close]
What's wrong with my "AboutAndroid" application? It's a very simple application trying to display system information in a text view object.
See the next tutorial on how to resolve this error.
Last update: 2012.
Table of Contents