Tuesday, 12 April 2011

Android Getting The Setup Ready


Here are the steps to setup the environment for Android Development,
Please go through the following.

If you are using Windows XP, its hassle free.
If you are using Windows Vista or Windows 7, there are few issues you will face, i will tell you then and there.

Step 1 : JDK version 5 or JDK version 6 only. Don't use version 4,it seems to cause some issues.
Download & install JDK, then set the environmental variable "PATH" pointing to the bin directory of the jdk.

Step 2 :  Download the "Eclipse IDE for Java Developers"  version 3.5 from 
Its a zip file, download and unzip to some location like say "C:\eclipse\"
Note : When you run the eclipse.exe , it will ask to choose a workspace, create a new folder called "workspace" inside the eclipse folder itself for our convenience and choose it.

Step 3 : Download the Andoid SDK Pack from 
Its again a zip file, download and extract to some location like "C:\android\"
I'm keeping the path simple, to make it easy to remember and access. you can actually use any path.
The one we are downloading at this stage is not the actual SDK but the "Android SDK and AVD Manager".
On running the "SDK Setup.exe" from the unzipped files, you will be presented with some options to download, it may fail saying some error.
To resolve it Go to Settings, under Misc section, check the "Force https://..." option.
Now go to "Available Packages" (menu on left),
Click "Refresh" button present in bottom right of that window,
Then expand the list of available packages by clicking on ">" near the description https://dl-ssl./.......
Then select atleast one version of the sdk to download and install.
Note that you need internet for this step.
Lets say, we chose SDK 2.1 version, then choose
SDK Platform
Google API
All of these for one version of SDK.
Then let it download and install all these.

Step 4 : Install the ADT Plugin in the Eclipse IDE, 
 Select Help -> Install New Software
Give some name.
If it doesn't work, try http
Choose the two updates availbale and install them
then restart Eclipse.

Now we have to configure the Eclipse,
Go to "Window -> Preferences" then choose Android on the left,
Then select the location of the Android SDK,
point to the "C:\android\" folder 
Click on Apply and Ok.

Step 5 : Now we have to setup the AVD
To create an AVD,
Just run the "SDK Setup.exe" from the android sdk folder
Select "Virtual Devices" from the left menu, the Click on the "New" button on the right,
Type a name, chose a target, give the size of sd card as something like 100mb, stick with default resolution ,
then click on create AVD.

Now check whether emulator is working ok.
To check it, Select a AVD you created, then click on "start" button on the right,
Now wait 5 minutes for the simulator to load,
You will see the simulator with a colourful background and phone, try to use it.
Just play around in the simulator for a while.

This is not essential, but easier to run samples,
Go to "C:\android\samples\android-8",
Copy all the folders in it,
and paste it to the Eclipse workspace we created at "C:\eclipse\workspace"

The setup is over now.
Note: If You are using Windows Vista/ Windows 7,
Go to the eclipse folder, select eclipse.exe, go to properties, and choose "Compatability", Tick the "Run as Administrator" option, and ok.

Now we are ready to run the create android apps.
I will mail how to run sample apps in next mail.

No comments:

Post a Comment