Android Development Environment
Having recently acquired an Android phone, I was keen to start developing applications for this platform. To do this, a development environment was required, which essentially consists of three pieces of software: an Integrated Development Environment (IDE), a Software Development Kit (SDE) and an Eclipse plugin.
Being that there are several parts to the installation, and little documentation available for an install on OSX, I thought that I would share how I installed my dev environment.
Eclipse Installation
- Navigate to the download section of the Eclipse website and download the Eclipse IDE for Java EE Developers to your desktop.
- Extract the file, and a folder titled "eclipse" will be created. Drag that folder to your applications folder.
- Open the folder, and then click on the application Eclipse, represented by a purple circle.
- You may be asked "Eclipse" is an application which was downloaded from the internet... Click Open to continue.
- When Eclipse is done starting, it will ask you to select a workplace. You can change it if you like, but the default location works fine. Click OK.
- An introduction splash page will open, feel free to browse around if this is your first time with Eclipse. You can close this when you are done.
Android SDK Installation
- Navigate to the SDK download section of the Android website and download the Mac OS X (intel) SDK to your desktop.
- Extract the file, then open the folder. Then open tools. Double click on android.
- Again, you may be asked "android" is a Unix application downloaded from the internet... Click Open to continue.
- A terminal window will open for a few seconds, and then the Android SDK and AVD Manager will open.
- Click on Available Packages on the left. Click on the grey arrow next to the URL, which will present you with a list of available SDKs and APIs.
- Select the versions (both SDK and API) that you will need for your project. If in doubt, select the latest versions. You may also wish to install the Documentation and Samples for future reference.
- Once you are happy with your selection, click install Selected
- A pop-up window will show asking if you want to accept the downloads, check Accept All and then click Installd.
- The files will begin downloading and might take a while. They will install automatically.
- Once they are finished installing, click Close. You may now close the android application.
ADT Plugin Installation
- Open Eclipse and select Help » Install New Software...
- Click the Add... button and enter "Android Plugin" for the Name and "https://dl-ssl.google.com/android/eclipse/" for the Location. Click OK.
- Once Pending... changes to Developer Tools, select that checkbox and click Next.
- Click Next again, then check the I accept the terms of the license agreements radio button, and click Finish.
- If you receive a Security Warning message, click OK.
- When the Software Updates message displays, click Restart Now and wait for Eclipse to restart.
AVD Configuration
Now that all required software is installed an configured, the final piece of the puzzle is to setup the Android Virtual Device (AVD).
- Open up Eclipse and select Eclipse » Preferences and select Android from the left menu. Click Browse... and navigate to the Android SDK folder downloaded to your desktop earlier. Click Apply and you should see the SDK(s) and API(s) previously installed.
- Select the appropriate Android SDK and click OK.
- Whilst still in Eclipse, select Window » Android SDK and AVD Manager.
- Click the New... button, give the AVD a name, ie. android_2.2, select a version number from the Target drop down, and click Create AVD. You can now close the Android SDK and AVD Manager, and the Terminal window if it is still open.
Project Creation
- Whilst still in Eclipse, select File » New » Project.
- Open the Android folder, select Android Project and click Next.
- Fill out the form with the following information:
Project name: HelloAndroid
Build Target: Android API
Application name: Hello, Android
Package name: com.example.helloandroid (or your own private namespace)
Create Activity: HelloAndroid
Min SDK Version: 2
And click Finish.
- Eclipse will generate a set of files for your Android project.
- To run your project, right-click the HelloAndroid project folder and select Run As » Android Application.
- If all goes well, the emulator will open and you will see your first Android application!
Congratulations! Your Android Development Environment has been successfully installed on OSX!