Android Development Installation Guide
Overview:
-
Installing the latest JDK (Java Development Kit)
-
Installing Eclipse
-
Installing the Android SDK (Service Development Kit)
-
Setting up a virtual device (with SD card external storage)
-
Installing the ADT Plugin for Eclipse (Android Development Tools)
-
Configuring the ADT Plugin for Eclipse
-
Creating an Android project
-
Running an Android application on an emulated device
-
Running an Android application on your phone
Additional Resources
-
Installing the latest JDK
-
Navigate to http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html and download the OS-specific kit (Self Extracting Installer if possible).
-
Run the installer.
*Developer Tools and Public JRE must be installed.
-
Installing Eclipse
-
Navigate to http://www.eclipse.org/downloads/ and download the OS-specific package labeled “Eclipse IDE for Java Developers”.
-
Extract it to an easily-identifiable location on your computer (Desktop, Program Files, etc.)
-
Installing the Android SDK
-
Navigate to http://developer.android.com/sdk/index.html and download the OS-specific kit, extracting it to a well-known location on your computer. Make a note of this location, as we will use it later in step 6.
-
Run the SDK Manager, and install all of the SDK Platform packages (it’s easiest to just install all of the available packages). This will probably take a while, so be patient.
*You might have to run it with administrative privileges
-
Once it’s finished installing the packages, do not exit! We will continue to use the SDK Manager in step 4.
-
Setting up a virtual device
-
Select “Virtual devices” from the toolbar on the left, and click the “New” button on the right.
-
Set up the device with the following settings:
*These settings are for the latest Android-based phones
-
Target: Android 2.3.3 API Level 10
(If you plan on using Google API features like Google Maps, make sure to use the Google APIs Level 10 version instead)
-
SD Card: 500MiB
-
Skin: Built-in Default (WVGA800)
-
Installing the ADT Plugin for Eclipse
-
Start Eclipse, and navigate to Help => Install New Software
-
Click “Add”, and enter a generic name for the name, and use the following link for the location: https://dl-ssl.google.com/android/eclipse/
*If this location does not work, try using the “http” version instead
-
Click “Ok”, and you should see an entry labeled “Developer Tools” appear in the window. Check the checkbox, and click “Next” to proceed.
-
Click “Next” to proceed, and then read through the agreements, or simply select the option saying that you have read them, and click “Finish”.
*You might get a security warning popup; if so, just ignore it and click “Ok”
-
Configuring the ADT Plugin for Eclipse
-
Start Eclipse, and navigate to Window => Preferences => Android
-
Navigate to the location which you installed the android SDK (it installs under the name “android-sdk”, and click “Ok”
-
Click “Apply” at the bottom of the window, and a list of your installed android platforms should appear on the screen. You can now just click “Ok”, as this stage of the process is complete.
-
Creating an Android project
-
Assuming Eclipse is already running, navigate to File => New => Project => Android Project
-
Name your project, select which platform you are using (this must coincide with the virtual device you created in step 4)
-
Name your application, your package (use something simple like “test.android”), and ensure “Create Activity” is checked, and enter a name for your primary activity.
-
Click “Finish”, and your project should be created!
-
Running an Android application on an emulated device
-
Click the “Run” button or navigate to Run => Run to begin the program. You must then select “Android Application”, and the emulated android device should appear on the screen. Exit out of this device however.
-
If you want to change any of the run settings of the application (you do), just navigate to Run => Run Configurations, and select your application from the window on the left. Click the “Target” tab, and select the device you want to run your application on. You can use this to select the default activity which is run on startup of the application, and add special command-line options to the run configuration (you can use “-scale .##” where ## is a percentage to scale the size of your emulator on the screen.
-
It is very important to note that it takes quite a long time for the device to boot up when originally running your application. You must be very patient with it, and even once booted up, the device can be very sluggish at times. Once the device is running, do not exit it until you are completely finished programming, as you can reload your application onto the “running” device by simply re-running the application, saving a great deal of time.
-
Running an Android application on your phone
-
First and foremost, ensure that the application is compatible with your android-based device.
-
Assuming Eclipse is already running; connect your android-based device to your computer via USB cable.
-
On your phone, make sure that USB Debugging is enabled (usually found under Settings => Applications => Development
-
In your project, navigate to your AndroidManifest.xml file, click the Application tab, and set “Debuggable” to true.
-
Install the appropriate driver software for your phone/OS combination.
-
For Windows drivers, see http://developer.android.com/sdk/win-usb.html for downloads, and
http://developer.android.com/sdk/win-usb.html#InstallingDriver for installation
-
For Mac, you can skip this step
-
For Linux, see http://developer.android.com/guide/developing/device.html for installation instructions and vendor IDs
-
In Eclipse, make sure that your run configuration is set to run on “Manual”, allowing you to choose the device to run your application on each time. You can do this by navigating to Run => Run Configuration => Your Project => Target, and selecting the “Manual” radio button.
Additional Resources
http://developer.android.com/
Share with your friends: |