This is the first part of a series of articles which will take you through application development on the Android platform. I am not trying to compete with the existing documentation available from the Android site, because that is excellent as it is, but what you will get here is a guide written by someone who is migrating to this platform from what was previously a mainly web-only background (ASP.net and c# specifically) and also one written from the perspective of someone writing under the Windows OS (although distributions are available in linux and mac flavours too). There is no added advantage to using the Windows OS to develop Android applications. In fact, based on the performance of the Android emulator accross all three platforms relative to the beefiness of your hardware, you might be better off with Linux. However, I’m developing under Windows and so all of the screenshots and setup instructions will be for the Windows OS.
The guide also assumes you will be using the Eclipse IDE. If you’re new, you should DEFINITELY use Eclipse. Even if you’re not new, YOU SHOULD DEFINITELY USE ECLIPSE! More on this in a bit. Pretty much as soon as we get the “setting up your system” part out of the way though, it won’t matter which OS you are using. If you’re already set up, you can skip that part.
First of all, I thought I’d run through some of the advantages that this platrorm has over its closest competitor: iOS. I got into Android development “via” that platform; coming from a mainly web background, I have observed that there’s a “me too” rumble within the business sector at the moment with regards to mobile apps: Companies all seem to want one just for the sake of having one rather than for any other reason. I’m not going to bang on about the importance of market research and planning, because more likely you’re just here because you believe there’s a fat pile of cash to be made from an approaching mobile app boom. Just a word of warning if that is your reason: The jury is FAR from finished deliberating whether apps are a sustainable platform for the future, and you might want to look into mobile optimized websites instead.
Anyway, on to the advantages that the Android platform has over iOS.
Rant mode: Activate!
- The platform is completely free. When I started learning Iphone app development, I had to buy the latest patch Apple had out (Snow Leopard, and yes I did call it a patch). Apple claim to make older versions of their SDK available on their website, but they don’t make them easy to find and certainly don’t let you deploy to devices with them. Therefore, if you get into iPhone development, you will be expected to buy every OS patch that Apple decides to charge you for. If you want to publish your apps to the app store, or deploy them to a device, you will have to also pay a yearly fee to Apple (currently £60 a year). Android, on the other hand, is completely free (all you’ll pay for is your computer).
- Android apps are written in Java. This means you can code using modern syntax, easily migratable to from c# if you’re not already a Java developer. So, while the rest of the developer community were enjoying a revolution in rational, intuitive syntax (Java and Ruby in 1995, C++98 in er… 1998, C# in 2001) if you embark on an iOS appliction you can expect to have to learn Objective C (1986). Although version 2.0 of the language introduced lame attempts to modernize it (e.g. “dot notation”) the syntax is largely archaic and if you haven’t seen it before it can take a while to get your head around. Pretty much the main difference between Objective C and C++/Java is a focus on run-time features over compile-time features. Anyone who can tell me what the heck advantage that gives you in mobile app development, feel free to comment. Usually, the hardest part about learning a new platform is getting to grips with a new API, and given the previous comment about the future of apps hanging in the balance anyway, you may want to think twice before learning Objective C AS WELL AS a new API.
- It’s easier to publish apps. You don’t have to look very far to find examples of developers who have had their products turned away at the gates by Apple’s “quality control” team. Now, everyone understands the need for quality control (even Apple themselves have admitted that they’re sick of all the Fart Apps) – but it’s not just quality that can get your app declined: Most famously, Google Voice was declined in 2006 on the basis that it made Apple’s own built in features redundant. The application was later accepted in 2010, but if that’s the treatment Google gets, what chance do you think YOU have?
- You don’t need a Mac. You can develop on Windows, Linux or (if you want to and have a lot of disposable income) on a Mac.
- Android uses XML based layouts.. iOS provides you with “interface builder”, a ‘drag and drop’ tool used to create ‘nib/xib’ files which consist of classes which define your view. In an Android application, you can do your interfaces this way too if you want, but in addition to this you may specify your UI using XML. There are numerous advantages to this (will come to these in a later chapter) but you can already see that this approach will be more familiar to anyone migrating from web development to app development.
- Android is on the rise. For four years, Apple has had a clear monopoly over the smartphone market. This year, however, has seen an increase in Android adoption and Android carriers. This news is very current and this time next year Android could hold a larger market share. 1ghz monsters such as the HTC Desire are beating the iPhone hardware hands down. Not only are you getting better hardware, but it’s also much cheaper too: At time of writing an HTC Desire contract clocks in at around £35 a month, whereas an iPhone contract is the same PLUS £99 for the phone. If people start waking up to this, we could finally see an end to Apple’s reign of terror!
OKay, next part will go over how to set up your development environment. Please feel free to comment, I don’t know how long I’ll run this series for (depends if I get any readers I suppose!) but it should be fun anyway.