Thursday, 5 January 2012

First Steps in Android

Ok. I Got the Android development kit installed on a Mac. Thats a plus for a start. It runs native, raw and wriggly on the Mac. The Mac book pro being a fine piece of hardware and the Apple software including the OS being lovely to use but awkward to work with and find your way around for Windows head like myself.

For the life of me I cannot fully remember the process as I never can when installing downloaded software, some you do yourself and some comes down as a result of what you do. Suffice to say the standard installation instructions are for installation on a Linux or Windows machine. I had to follow another few links to get the proper tools for OSX 10. Here is the gist of what was needed.

You need

The JDK 7 for OSX from Oracle. When you unbundle this and install it. It runs an may pull down additional updates for the Mac.

Download and install a suitable version of eclipse. I took the Mac version from HEANET in Ireland.

Then its over to the Android SDK download page for the the Android SDK and AVD Manager. Which when unzipped have to be added to the eclipse environment.

Eclipse is the SDE of choice. First impressions of eclipse are it's not bad for free, but shows all the signs of it. VS 2010 is miles ahead and I have always said MS should push this more. However when I installed as per instructions the Android SDK Manager plugin for eclipse it did have a download manager that fixed a lot of interdependencies that were missing.

I then had to set up a AVD Android Virtual Device and attach it to the currently open Workspace.

AVD manager

It did not register with eclipse and the Hello World App did not deploy to it until I shut down eclipse and started it up again. But following a reboot of eclipse (on intuition) up came the emulator. The AVD is very slow to load and I'm using a SDD and Macbook Pro with 8gigs of memory.

Next challenge was to figure out the structure of a Java project (as it has been a while since I have seen eclipse and how to load an existing sample Android app that comes with the Android SDK.

Cmd + n creates a new project. You then choose what type of project you want The basis for eclipse is a workspace that is a enclosing folder that holds the project folders. A project must have a Package name otherwise it will not create. Which is similar to a name space in c# but is represented as a directory structure of the project folder in the workspace. The workspace contains a collection of project folders.

Project setup window

Once the Android SDK plugin is installed you you have access to the sample projects which you can then base a new project on. Right click on the project window

Followed two screens later by your Android sample template

Well thats the development environment  set up and ready to go. Now on to look at the Android in more detail.

No comments:

Post a Comment