Thursday, November 24, 2011

(re)Starting Development - Part 1

OK, I have been doing all sorts of odd jobs in Software Industry (From Project Manager to SCRUM Master to Product Manager) and I have finally decided to get back to coding. This is what I love and this is what I think I am passionate about.
I have decided to start a alphabet learning project on Android and I will document my experiences with Android development as and when I encounter a problem and find a solution. I hope you don't have to curse Eclipse the way I did....

Problem 1: How do I get existing Android project in to Eclipse ?
Solution: Select  Android Project in Eclipse/New Project  and select "Create project from existing source"  , select the location of the project's root and click Finish

Problem 2: After importing Eclipse complains "Unable to resolve target 'android-4'"
Solution:  Change the min and max SDK support inside the manifest file to the version of SDK you have installed on your PC.

Problem 3: After I edited the manifest file , I clicked on the run button and I get the following error
No embedded stylesheet instruction for file: file:/C:/Users/nagraj/workspace/MyABCs/AndroidManifest.xml

Solution: Eclipse is pretty dumb, just ensure that you select the project root and then click the run button. Eclipse is trying to "run" the Manifest XML file since it was selected!

Problem 4: After all you have done, you think you are ready to test your code on the Emulator , but  Eclipse says: " Could not find xxx.apk!" , what the hell went wrong ?
Solution: Again, thanks to the rudimentary tool set provided by Google. As bizarre as it sounds the solution is to go to the project properties and click on restore defaults.

Problem 5: On well , my miseries don't end here. now I see a message :
[2011-11-24 13:56:17 - ApiDemos] Re-installation failed due to different application signatures.
[2011-11-24 13:56:17 - ApiDemos] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-11-24 13:56:17 - ApiDemos] Please execute 'adb uninstall com.example.android.apis' in a shell.
[2011-11-24 13:56:18 - ApiDemos] Launch canceled!

Solution: This is the simplest, just run adb uninstall com.example.android.apis
C:\Users\nagraj>adb uninstall com.example.android.apis
Success