How to Set up Eclipse and Android SDK Manager Environment
You need to download the following
1. Android Software development Kit (SDK) 2. Eclipse Package 3. Java JDK (if it is not installed on your Windows)
First go to http://developer.android.com/sdk/index.html#download to download the Android SDK installer
Then click Set Up an Existing IDE on the page
Click Installing the Eclipse Plugin. Go to Eclipse for Mobile Developers to download the appropriated Eclipse Package
• Start Eclipse, then select Help > Install New Software. • Click Add, in the top-right corner. • In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the
following URL for the Location:
https://dl-ssl.google.com/android/eclipse/
• Click OK. • In the Available Software dialog, select the checkbox next to Developer Tools and click Next. • In the next window, you'll see a list of the tools to be downloaded. Click Next.
• Read and accept the license agreements, then click Finish.
If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
• When the installation completes, restart Eclipse
Configure the ADT Plugin
Once Eclipse restarts, you must specify the location of your Android SDK directory as follows:
Windows -> Preference -> Android and specify the full path for SDK (in my case C:\Program Files\Android\android-sdk) SDK Location.
Your Eclipse IDE is now set up to develop Android apps, but you need to add the latest SDK platform tools and an Android platform to your environment. To get these packages for your SDK, continue to Adding Platforms and Packages.
You might need to download Java Development kit (JDK) if you do not have latest version of it.
• Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html
• Download the version for your Windows systems. For 32-bits, download the following and install it.
Set up Android SDK Manager
The ADT bundle with the SDK is sufficient for some basic Apps. But you may install other packages available on the SDK Manager Environment such as
• Samples for SDK • Google Play Services
To install them, open SDK Manager and just click the boxed associated with eh packages and then click Install .. packages. For example, I select 11 packages to install as follows.
• Open Eclipse environment
If you get message Fail to Create Java Virtual Machine, open eclipse.ini and delete the default values 256M (or any other values) at lines --launcher.XXMaxPermSize
• Specify a local folder for your default Workspace on Workspace Launcher
• Create an Android Application Project via File-> New -> Android Application Project
• In the New Android Application Window, type a project name said, HelloWorld
In the next window, you may specify a location other than your default Workspace in your local folder for easy access of your projects.
You may select Fullscreen Activity
Then you should see on the Eclipse your project similar to
If you close your project, you can always reopen it File -> Open File
Now, we want modify the project code to output a “Hello World” message. Open the .java source of the project
Change the course as follows Under import statements, add import android.widget.TextView;
Under setC TextView mymyText.setT setContentV Run the A
To create an A
1. Launa
2. In the3. Fill i
defau4. Click5. Selec6. After
To run the ap
1. Open2. In the
Define an AV
ContentView(
yText = newText("Hello WView(myTex
App on the
AVD:
nch the Androa. In Eclipsee Android Virn the details fult). k Create AVDct the new AVr the emulator
pp from Eclips
n one of your e Run as wind
VD similar to
(R.layout.act
w TextView(tWorld of CGt);
e Emulato
id Virtual Deve, click Andrortual Device Mfor the AVD.
D. VD from the Ar boots up, un
se:
project's filesdow that appe
the following
tivity_fullscr
this); GS3823");
or
vice Manageroid Virtual DeManager paneGive it a nam
Android Virtualock the emul
and click Ruears, select An
g and run the p
reen); add
r: vice Manager
el, click New.me, a platform
al Device Manlator screen.
un from the ndroid Applica
project on it.
r from the
target, an SD
nager and clic
toolbar. ation and clic
toolbar.
card size, and
ck Start.
k OK.
d a skin (HVGGA is
If the running stuck at some activity, right-click the project -> Run as or restart Eclipse
Creation of .APK distribution of the project for Real Devices To create an .APK distribution for the marketplace, you need to have an Android developer’s account to sign it. Without a developer’s Android account, we can create an .APK distribution in debug mode for debug keystore, which is the same as the marketplace mode. • Check where your keystone is located, via Windows -> Preference -> Android -> Build, where you
will see the Default debug keystore folder (in my case, C:\Documents and Settings\pbao\.android\debug.keystore).
• Then we are going to create the .APK distribution in debug mode as follows.
File->Export->Android->Export Android Application
• Specify the project to be exported
• Specify your default debug keystore for Android and use password, said, android
• On the next screen, specify an alias, said, androiddebugkey with the same password android.
• Then specify the name and location of the .APK file and hit Finish; the .APK file will be created.