Getting started with Android development on OSX
Getting Android running on OSX for development is not an easy task, especially if you, like me, are used to making apps using Apple’s XCode.
But like it or not, Android is now ahead of iOS in users, so it can’t be ignored if you’re making apps for everyone.
I’d love to make all our apps available on Android, but it’s just not feasible currently with Android the way it stands.
As of the time of writing, Android’s NDK still can’t do low latency audio. This is why there are no decent music and audio apps on Android, and why iPhones and iPads are killing it in that area.
There’s an ongoing discussion here:
http://code.google.com/p/android/issues/detail?id=3434
If you’re developing and haven’t spoken out on that page, get on there and be counted. Then maybe one day Google will make it possible for you to bring your cool music and sound related apps to Android and make them a bunch of cash on the store, as well as the sales of handsets!
So, here’s how I finally got my Android development started… and I mean started!
Firstly, understand that for iOS development you download and install XCode and that’s it. The integrated development environment (IDE), SDK and emulator are all nicely and neatly bundled together. The Apple way.
Not so simple with Android, but I have got it up and running, so here’s how…
Download Eclipse.
This is the development environment, or IDE. Because it’s totally hippy and open source, Eclipse supports development of lots of things in lots of ways. First hurdle… which version of Eclipse to get! So many options it was scary.
http://www.eclipse.org/downloads
I eventually found out, through reading posts and pages that Eclipse IDE for Java EE Developers, 204 MB
was the one to go for for stability and general acceptance.
Downloaded, installed.
Great. Now what?! Start it up…no option to create a new Android app. Que? Help!
OK, so we now need to go to the help menu, select Install New Software and then enter:
https://dl-ssl.google.com/android/eclipse/
in the Work with: section.
Check the developer tools checkbox. This will get all the developer tools for Android development. Check all boxes and follow through this install.
Now we need the SDK
Yes, the SDK is separate from Eclipse. Think of it as a plugin. Eclipse can develop for multiple platforms, Android being just one. iOS SDK is like Eclipse+Developer Tools (ADT) + the SDK all in one.
Now you appreciate how nice Apple’s development environment is!
So download the latest Android SDK and save it somewhere – Documents is fine
From within the tools directory double click android
This will go ahead and install everything you need. Make sure you install support for everything you think you’ll need – I just went ahead and selected everything. Better to have it all!
The final stage is to point Eclipse at the SDK
Go to Eclipse/Preferences/Android (this is the developer tools you installed in the previous stage)
Browse to the SDK location and click Apply
Done!
Now there’s “one more thing…”
Creating an Android app is also a bit tricky first time…
First, do Apple+N. The message wont disappear for a while so move it out the way until it lets you click the checkbox and proceed
The things you want to enter in the boxes (which, again, I had to google – what’s wrong with these geekazoids?!)
Here is a description of each field:
Project Name
This is the Eclipse Project name — the name of the directory that will contain the project files.
Application Name
This is the human-readable title for your application — the name that will appear on the Android device.
Package Name
This is the package namespace (following the same rules as for packages in the Java programming language) that you want all your source code to reside under. This also sets the package name under which the stub Activity will be generated.
Your package name must be unique across all packages installed on the Android system; for this reason, it’s important to use a standard domain-style package for your applications. The example above uses the “com.example” namespace, which is a namespace reserved for example documentation — when you develop your own applications, you should use a namespace that’s appropriate to your organization or entity.
Create Activity
This is the name for the class stub that will be generated by the plugin. This will be a subclass of Android’s Activity class. An Activity is simply a class that can run and do work. It can create a UI if it chooses, but it doesn’t need to. As the checkbox suggests, this is optional, but an Activity is almost always used as the basis for an application.
Min SDK Version
This value specifies the minimum API Level required by your application. For more information, see Android API Levels.
So in summary, I went with:
Project name: <your project name>
Build target: Your choice, but look at this for market share before deciding:
http://developer.android.com/resources/dashboard/platform-versions.html
Application name: I used same as Project name
Package name: com.yourcompany.appname
Create Activity: App name without spaces
Min SDK Version: Depends on your choice of Build target.
You know how happy I was when I clicked Run and up popped an emulator with my Hello World default app displayed?
Very happy indeed. In a geeky chuffed kind of way.
Apple have it soooooo right with their integrated approach. It makes it much easier for creatives to create without all the hassle of getting up and running. The myriad of Android screen sizes is also a barrier since you have to create graphics for all of them… although things are getting easier now the phones seem to be going predominantly to copy the iPhone. Finally the lack of low latency audio means the really cool fun apps will remain iOS exclusives for now, but at least we can get started on sharing some of our apps with the Android users.
In the meantime, I now need to work out how to draw stuff on the screen…
My iOS apps
DanceTime Deluxe
Complete dancing rhythm practice tool with variable tempo and counting
http://www.dancetimedeluxe.com
Idiotic
Completely FREE sampling keyboard with pitch changer as lots of fun built-in sounds
http://www.idioticapp.com
Washing Machine
DJ Europe‘s amazing FREE washing machine song and app
http://www.washingmachineapp.com



