Android Development Setup [Revision Date: 02/16/11] 0. Java : Go to the URL below to access the Java SE Download page: http://www.oracle.com/technetwork/java/javase/downloads/index.html Select Java Platform, Standard Edition, by clicking on Download JRE. Select the platform, click the checkbox of "Java SE Runtime Environment 6u24 with JavaFX License Agreement", and click "Continue". On the next page, download the JRE using the hyperlink below "File Description and Name" table: jre-6u24-windows-i586.exe Double click the file you downloaded to run it. When the Java Setup windows pops up, click "Install". Do not change any of the defaults. When the installation is complete, click "Close" to close the pop- up window. Mac: Java is already pre- installed on your Mac OS X Leopard or Snow Leopard. Ensure that you have the latest version of Java by Selecting Apple >> Software Update If Java update is not listed, you have the latest version. We recommend Java JVM 1.5.x for OS X Leopard users and Java JVM 1.6.x for OS X Snow Leopard users. 1. Eclipse (Galileo) Go to the URL below to access the Eclipse Galileo Package download page: http://www.eclipse.org/downloads/packages/release/galileo/r Select the Eclipse IDE for Java Developers package: Download windows 32- bit (This usually takes some time. Unzip the download. Extract the eclipse folder and its Download Mac Cocoa 32- bit (This usually takes some time). Untar the Mac download by clicking on the downloaded TAR file (OS X will automatically unzip the download). Drag and Drop the Eclipse folder to your Desktop (usually from the Downloads 1
contents to your Desktop. Inside this folder you will find the program eclipse.exe. Right click on eclipse.exe and select Create Shortcut ; Drag the shortcut to your desktop and double click on it. Eclipse should start up. Leave the default workspace alone and select the checkbox titled Use this as default and do not ask again. Click OK. The Eclipse main window should appear. For now select File Exit to quit Eclipse. folder). Inside this folder you will find the Mac app Eclipse. Right click on eclipse.exe and select Make Alias ; Drag the alias to your desktop, and double click on it. When asked if you "are sure you want to open it", click Open and Eclipse should start up. Leave the default workspace alone and select the checkbox titled Use this as default and do not ask again. Click OK. The Eclipse main window should appear. For now select Eclipse >> Quit Eclipse to quit Eclipse. 2. Android SDK Download Android SDK from the following URL. http://developer.android.com/sdk/index.html Select the Package, android- sdk_r09- windows.zip and download it to your desktop. Extract the android- sdk- windows folder to your desktop Open the android- sdk- windows folder and you will see SDK Setup.exe (or SDK Manager.exe); start the program; it may take a while to execute; If you get an error, select Settings, and then check the box labeled Force https A window should appear labeled Choose Packages to Install ; Click on Cancel. Do NOT download ay of the Select the Mac OS X Package, android- sdk_r09- mac_x86.zip and download it. Drag and Drop the Android folder (named android- sdk- mac_x86) to your Desktop (usually from the Downloads folder, where it is automatically unzipped). Open the android- sdk- mac_x86 folder and you will see android program inside the tools folder; start the program. When asked if you "are sure you want to open it?", click Open and the Android SDK and AVD Manager should start up. Do NOT download ay of the packages at this time. Click on the "red" close button in the upper left hand corner to close the 2
packages at this time. Remove the window by clicking on the X in the upper right hand corner. program. You will also need to close the Terminal window that was started by the android program. 3. Add ADT plugin OS and Mac OS X Run Eclipse. Select Help >> Install New Software and then click on Add in the Available Software dialog. In the Add Site dialog enter ADT Plugin in the Name field, and try the following URLs in the location field, until you find one that is properly recognized and does not give you an error: http://dl- ssl.google.com/android/eclipse http://dl- ssl.google.com/android/eclipse/site.html https://dl- ssl.google.com/android/eclipse Click on OK; Expand the tree named Developer Tools. Check ALL boxes that appear. Click Next TWICE. Select the I accept the terms of the license agreements radio button, and then click Finish. (This step will take some time) At the end of the software installation, answer YES to the Software Updates dialog. Eclipse will restart (on you may have to exit and run). Restart Eclipse (exit and run). 4. Link ADT Plugin and Android SDK Start Eclipse. Select Window >> Preferences. Click on Android. In the SDK location browse the path to the android- sdk- windows folder. Click on Apply. Click OK. Start Eclipse. Select Eclipse >> Preferences. Click on Android. In the SDK Location browse the path to the android- sdk- mac_x86 folder. Click on Apply. Click OK. 5. Add Platforms OS and Mac OS X Start Eclipse. Select Window >> Android SDK and ADV Manager. 3
Select Available packages. Click on the + (> on Mac OS X) displaying the available packages. Add SDK Platform Android 2.2 and all of the API 8 4 total packages: Documentation for Android SDK, API 8, SDK Platform Android 2.2, Samples for SDK API 8, and Google APIs [..] Android API 8. Do the same for Android 2.3 and API 9. Click Install Selected. Then click on the Accept All radio button for all packages and then click on Install. The download will start. The "Installing Archives" window will appear. For each of the downloaded packages you will see three (3) lines: Downloading, Installing and Installed. At the end of a successful installation you may be asked to "Restart ADB", answer Yes. In the "Installing Archives" window you will receive messages that the packages have been installed and the ADB daemon has started successfully. Click on Close in the "Installing Archives" window. Click on "Installed Packages" in the top left menu list: you should see the added packages, plus Android SDK Tools. Exit the Android SDK and AVD Manager (click 'x' on upper right in OS and click on upper left 'red' close button in Mac OS X). 6. Add Android Virtual Devices (AVDs) Create an AVD for the Google Nexus One smart phone. The Google One tech specs are at: http://www.google.com/phone/static/en_us- nexusone_tech_specs.html The display size is 480 by 800 pixels. To create an Android Virtual Device for the Google Nexus One, follow these steps: 1.) Start Eclipse. 2.) Click on Window >> Android SDK and AVD Manager 3.) Select Virtual Devices. Click New in the right panel. 4.) Type the name of the AVD, for example nexus_one_avd 5.) Set the Target as Android 2.2 6.) Set the SD Card Size to 20MB. 7.) Set the Skin Resolution at 480 X 800. 8.) Set the Abstracted LCD Density to 240 9.) Click Create AVD. 10.) Exit the Android SDK and AVD Manager. 11.) In the Console Tab (bottom of Eclipse window) you should see a log of the creation of the nexus_one_avd. 7. Hello World Tutorial OS and Mac OS X 4
Create your first Hello World Android program, using the steps listed at the page: http://developer.android.com/resources/tutorials/hello- world.html To write and run your first Android app, follow these steps 1.) Install at least one Android SDK platform (see section 5.) 2.) Set up at least one Android Virtual Device (see section 6.). 3.) Create a New Android project: 1.) From Eclipse select File >> New >> Project... Next. 2.) Expand the Android wizard and click Android Project and then click on 3.) Fill in the following fields: Project Name: HelloAndroid, Application Name: Hello, Android, Package Name: com.example.helloandroid,, Create Activity: HelloAndroid Keep the default values for Contents ("Create new project in workspace" and "Use default location"). Select Android 2.2 as Build Target. Click Finish. Click on Run from the Eclipse >> Run menu; then select Android Application in the "Run As" window, and click on OK. You should see the emulator running on your screen with the output Hello World, HelloAndroid. Note: it will take some time for the Android emulator to load. To exit the app and go back to the Android UI, press the ESC key. For more information on how to modify the Hello world app, please go to: http://developer.android.com/resources/tutorials/hello- world.html 5