Thursday, December 9, 2010

Android SDK - Emulator - on MAC

Ok, now that i have my first app built in android, i want to give it to my client for a demo who does not have a android PAD, (or yet to have one)...so they have to use the emulator which comes with android SDK to install the APP and show it running like its an android device....
the steps are pretty much simple
(please note you dont need Eclipse or any plugin to just run a APK (android package), - they are needed only for developers to debug and stuff)...

1) install android SDK(google has enuf details for it)
2) RUN the emulator so taht it starts up and ready to install your app
3) copy the APK file to a particular folder (say Desktop)
4) open up the terminal and navigate to the andoird SDK folder

$ cd ./android
$ cd platform-tools
your current working directory would be the platform-tools which contains a file called ADB.exe which will install the APK to the android emulator device...
execute the command
$ ./adb install "APK file name"

it will show some messages like installing etc., and has to finally say SUCCESS...

go to the emulator and open up the menu by clicking the android menu button (its the little dots stacked at the bottom of the page and not the button labelled "MENU" on the emulator)

you must then see your app being displayed as an icon....

happy androiding...

Wednesday, December 8, 2010

Install APK file from command Prompt

 I have now finished with my POC and want to install it in my android emulator outside of Eclipse.

Here are the steps

Execute the emulator so that it starts and is ready to install new programs.
(you need to run the emulator.exe under the android SDK\Tools folder)
1) copy the APK file (which will under /bin directory) to "C:\myProject.apk" (this step is really not needed, but its just a failsafe method)

2) open the command prompt (in your PC and not in the emulator) and type

abd install c:\myProject.apx

this will install the APK file in the emulator

3) If you are getting "command not found" - navigate to the Android SDK/Tools folder
cd x:/androidsdkfolder/tools
and run command again.....

happy androiding !!!!

Monday, December 6, 2010

Android Development - with Android SDK and Eclipse

Working with Android SDK with Eclipse.

So now that i started doing my first android PAD project for one of my clients. We need to submit a POC which will showcase a work flow. A login screen, a screen with tab controls, a grid view with menu and a table layout with details.

Before I start the work i need to set my DEV environment. Being a C# developer for most of my life I am taking baby steps towards Java programming and that too with android. Interesting....

What we need ?
1) Android SDK
2) Eclipse
3) ADT Plugin for Java.


There is an excellent tutorial at the android developer community for setting up the environment, but I found my self stuck at a couple of places....so thought i should blog it myself...

1) Download the SDK from the location
http://dl.google.com/android/android-sdk_r08-windows.zip

  • Unzip the contents of the SDK (I choose to unzip the contents inside Program Files\AndroidSDK directory, so that I dont accidentally delete the contents by placing it somewhere else)
  • and execute the SDK Manager.exe, it will start downloading the platform(which takes around 2 hrs with a 150 KBPS actual download speed)
  •  after installation the SDK folder will be populated with the platform details, you can see the various supported platforms inside the PLATFORM folder.


2) Download and Install Eclipse latest release - Eclipse website has detailed information on the installation. http://www.eclipse.org/downloads/ (download the one which says "Eclipse IDE for Java Developers)

After successful installation
Go to  Help --> Software updates -->(or Help Install New Software in Eclipse - Gallileo) add the site "https://dl-ssl.google.com/android/eclipse/" to the updates directory and click the ADD software button, it will list down the details available to install and click NEXT & finish the installation...it will install the ADT plugin.

3) After installation the menu Android will appear in Window --> Preference menu, Navigate to it and Click the Browse button and set the path of the SDK folder --> click ok and apply --> restart Eclipse.

4) create a new AVD image - This is the Emulator that will open when you execute your android APP
select window --> Android SDK and AVD Manager and create a new device. Make sure that you choose the right version for your project.

Now we are ready to start a project
After create a new android project , set the target of Run configuration (Run-->run configuration --> android --> new configuration) to the AVD you just created.

when you RUN you app, the Emulator will start and you are ready to roll on...