Help get this topic noticed by sharing it on Twitter, Facebook, or email.
sarahkim (Official Rep) July 11, 2014 18:04

How to start programming in Android

Android has taken big steps over the last year. What began as a promising but little-implemented operating system has matured into a strong OS powering a slew of mobile devices. It's also coming to tablets and netbooks.

There's a big opportunity here, but the path to Android programming isn't as clear as it should be. That's why I got in touch with Tony Hillerson, a mobile developer at EffectiveUI and the instructor behind the free online course "Developing Android Applications with Java." In the following Q&A, Hillerson discusses the skills and tools you'll need to dive into Android programming.

Mac Slocum: If you want to get into Android development, what technical and programming skills should you have?

Tony Hillerson: You'll feel most at home if you already know Java. I also think that since the apps you make with Android are heavily dependent on the frameworks, anyone with an understanding of common, object-oriented languages like C++ and C# will pick things up quickly.

Understanding how Android's XML-defined views translate onto the screen isn't hard, but some experience with a tag-based view technology like HTML or Adobe's Flex will make the views very familiar.

MS: What are the hardest initial things to overcome as an Android developer?

TH: When I started I found the layouts, which control how components are presented in the views, kind of inflexible and quirky. I think those have changed a bit for the better -- at least there are less layouts to worry about now -- but I still miss a percentage-based layout like you use in Flex.

As I got further into my first big Android application, Brightkite, I found that skinning, or making things look like my designer wanted, was very confusing. It required digging into the source code to make things look the way I wanted. Even then, there were things that were just not skinnable, or required making a completely new component, or changing the design.

I really wish that the camera acted more like a service, as it does on the iPhone. Instead taking full-size pictures in the app and using those pictures is harder than it should be.

Another thing that is almost unbelievable is how much of a pain it is to work with maps. It requires signing up for an API key per computer to even see maps. Compare that to iPhone map development with Google maps, where you don't have to do any of that. They just work. Android is made by Google, right? That's something I hope Google fixes soon.

Those were my pain points, but I think I got pretty far toward having a nice, working, application before I ran into them. All in all I like the framework a lot.

MS: What tools should you have on hand?

TH: You need the Android software development kit, which comes with the emulator. I prefer Eclipse for Java development, and the Android Developer Tools work with Eclipse.

It also really helps to have a device, especially when doing things with location or with the camera. I wouldn't recommend putting anything on the Android Market that hasn't been extensively tested on a real device.

MS: How does Android programming compare to iPhone programming?

TH: I think they both have their ups and downs.

Objective-C is a dynamic language, so it's easier to do more elegant things in the code. On the other hand Objective-C is incredibly verbose, even compared to Java, so you always seem to write more code than you think you should. Although despite that, or maybe because of it, I find it personally satisfying to write code in Objective-C.

Jars are a great asset for Java development, because it's a lot easier to reuse other libraries. The library situation in iPhone development is basically a choice between just copying in code or setting up dependent projects in XCode, which can be confusing. On the other hand, I really like some of the frameworks available on the iPhone, especially Core Animation. They're super powerful and easy to use.

Android really shines because it's open source. I don't have to guess or experiment or decompile things. I can just look at the source and see why things are the way they are.

MS: Manufacturers are using Android on tablets and netbooks as well as mobile phones. What things do developers need to consider as they're creating Android-based apps for multiple devices?

TH: The big one is layout. If you fudge a layout to just get it working on a single device, it's going to get you later. You'll also need to prepare for different APIs not being supported, like the camera for instance. Designing the application well is going to make you think harder about the core functionality and use cases you want to support.

MS: What are the best support resources for Android programmers?

TH: The Android Developers site is the obvious one. It has all the associated documents, code and the Google groups. If I don't find what I need there, I just Google and let that look for other sites with information I may want.

Of prime importance, though, and I can't stress this enough: Android is open source. Read it. Understand it. See what the Google engineers did to make the core apps do what they do.

MS: What's your favorite Android app?

TH: Goggles is the coolest Android app that I've seen. Layar is also pretty sweet. And I can't forget to mention Brightkite, which is tons better than Latitude!

Tony taught a 90-minute "Build your First Android App" course a few months ago. You can access the free video here.

Note: This interview was condensed and edited.
1 person likes
this idea
This topic is not open for comments or replies.