Thoughts on the Android development environment

Setting up an Android development environment for the first time can be challenging. Knowing where to start, or even finding current and accurate information that can guide you through the process can be hard. There’s more conflicting, out of date, or just plain wrong information on the web than you might believe. Even new books on your local bookstore’s shelf (if you still have a local store that is) or from an online retailer can contain so much inaccurate information it’s surprising.

Understanding a few things first may help you clarify the process, so before beginning the setup process, or even downloading what you believe are the necessary files, answer the following questions and make sure you’ll be on your way to getting the right pieces. N.B. – I’m writing from a Windows perspective, but it should apply to other platforms as well.

1)      Will you need a new computer with lots of memory, and will you need a 32bit or 64bit (x64) OS as a development platform?

The good news is that the Android programming doesn’t take much memory or require a powerful computer; any computer made in the last few years should be fine. Remember, your target platform – tablets and phones – probably have far less computing power compared to any recent desktop or laptop.

Short answer on memory; 4GB is fine. Using any version of Windows 7 – Home Premium, Professional, or Ultimate – in 32-bit or 64-bit (x64) is fine. A 32-bit OS limits addressing space to under 4 GB (approximately 3.7 GB), while a 64-bit system allows you to add 8GB, 16GB, or more (depending on your machine of course), but since Android is a 32-bit system, you won’t need it.

2)      Which JDK(s) should you install?  Should you choose the Java EE (Enterprise Edition), SE (Standard Edition), or even ME, the Mobile Edition, and should it be a 32bit or 64bit?

Which version? – Your computer may already have java installed, but you probably want to download one or two JDKs (Java Developers Kit) if you’re not up to date. Remember, you’ll need the full JDK which includes the JRE (Java Runtime Environment). Don’t just download the JRE alone.

Oracle (Java’s current “owner”) provides a lot of choices, and they can get confusing. It appears that the most frequent choice is the SE version, while some others recommend the EE version for either larger development projects or if they have specific needs. I’ve used both the SE and EE version without issues, but the SE version has a slightly smaller footprint. What you don’t want is the Java ME (Mobile Edition) SDK. Android already provides everything you need for mobile development and won’t use any of the ME code.

32bit or 64-bit? – Android is a 32-bit OS today. There’s no real reason today to use a 64-bit IDE, but you can if you’d like. Just be aware of the potential conflicts between 32-bit and 64-bit software (See Eclipse below).

The most recent Java JDK is 7 u9 (version 7 (really v1.7), update 9). You should download it, but I’m also going to recommend that you get the Java 6 JDK/JRE too, as many of the available Android code samples that you’ll find online were built with the Java 6 compiler vs the Java 7 version. Sure you could always modify each project and update it to Java 7, but it’s much faster to have at least one level back too so projects compile easily.

Java SE (7u7) overview page and download link:                Java SE
Java EE (Java EE 6 SDK & JDK 7 U7) overview page and download link: Java EE

3)      What Android SDK versions will you need? Should you download just the most current, a specific older version to use with a test device(s) you already have, all versions or what?

There are lots of Android devices out there, some running version 2.x, 3.x, and as of 2012, 4.x devices have been added to the mix. Which mix of SDKs you download is up to you, but regardless of which ones you choose, always get the newest version. At the time I’m writing this API 16 for Android 4.1 (or 4.1.1) Jelly Bean is the most recent version. In short, always get the newest, and get others if you need them.

More on this, the Android ADT, and Eclipse IDE coming up.

4)      Which IDE (Integrated Development Environment) will you be using?

There are many free Android development choices including Eclipse (a free and open source IDE), Google/Motorola’s Motodev, Oracle’s Netbeans, and InteliJ, to name a few, but let’s make this easy – you’re better off using Eclipse. Google developed its Android development tools (ADT) plug-in for Eclipse and for the most part, for the most part, everything works as expected.

Eclipse has some added advantages. It’s the most widely used IDE so if you get stuck there’s a good chance other developers might be able to answer questions. N.B. – Don’t ask Android development questions on the Eclipse forums; you probably won’t get the response you’re were expecting. …

Another Eclipse advantage is that it doesn’t install in the traditional sense. There’s no writing to the registry, loading dll’s, putting icons in every folder on your machine and then forcing you log in to their site. It comes in a self-contained zip file. After downloading, just create a folder, unzip the file, and run the .exe file (create a shortcut if desired). Remove it, swap one version for another, or even run different versions concurrently (I wouldn’t make a habit of this).

After choosing your IDE, you’ll still have to choose either a 32-bit or 64-bit version. Google’s site recommends the “Eclipse Classic” version but you’re fine choosing the SE or EE version too. I installed the SE version on one machine and the EE on another. Just  make sure that it matches the rest of your environment (see table below).

If you have this Win OS Installed

Install this JDK

Install this Eclipse IDE

32-bit

32-bit only

32-bit only

64-bit (x64)

32-bit

32-bit or 64-bit (x64)

64-bit (x64)

64-bit (x64)

64-bit (x64) only

Getting it together…

Immersing myself into Android mobile app development confirmed what I already expected; getting started as a solo developer can be a challenge. I knew it would take lots of work, but where should I start? I had a Samsung tablet, limited “test” access to a Samsung phone, decades of development and project management experience, but when it came to knowing anyone that was doing actually doing mobile development, the cupboard was bare. No team, no mentor, just me; this was going to be a solo journey.

Questions about which references I should consult and which tools I should use had to be answered first, and finding those answers turned out not to be as easy as I had hoped. I knew that making progress would have some false starts and frustration, but I soon discovered that this was like starting from a 6 foot deep hole in the ground. A hole that seemed to be filling itself with water…

OK, here’s where we start.

The basics:

Java Programming – If you’re a java developer, you have a significant head start, but I think that anyone that has used another OOP (Object Oriented Programming) language can adapt to Java. I’m not suggesting you will quickly or easily become an expert, but as long as you have some books or online resources/reference materials you’ll make it. I was never a java programmer and knew there would be a steep learning curve ahead. One thing I had going for me was that I learned OOP almost 20 years ago. A conceptual understanding of inheritance, encapsulation, and polymorphism were still with me so learning Java basics is more like hiking a very large hill as opposed to climbing a mountain. Or so I tell myself. 🙂

Note: If you’re not a programmer, start learning to program in Java now. Get a book, take a course, corral a knowledgeable friend, or do whatever it takes to learn the concepts. Learning Java is an achievable goal if you’re able to understand simple logical concepts, constructs, and remember syntax. Basic programming is not hard; being an exceptional and expert programmer is hard, but right now we’re not looking for a way to get along. Once you understand Java (even a little) come back and try Android development.

Learning Resources – Warning! The market is changing so fast that the majority of available resources are at least partially out of date. Google changes the ADT (Android Developer Tools) plugin for Eclipse frequently*, and that makes it difficult*, but not impossible, for print authors to reflect those updates. As of today, the current Android OS is 4.1 Jelly Bean, and the ADT is r20.03. *Update – Google has updated the ADT 10 times (10x) in the 12 month period from October, 2011 through October, 2012.

With that initial warning, I think web resources are the best place to start. There’s a lot of junk out there to confuse people, but Google’s Android developer site (http://developer.android.com/training/index.html) is as good a place to start as any. It’s probably better than most some of the time, but I’ve found that it too can be out of date and can lag behind with the frequency of changes. Just remember that what you’re reading there may not be current if there has been any SDK/ADT update recently, so be prepared to change accordingly.

I began my resource search at the local Barnes & Noble book store. I wanted to see what was available in the way of “old fashion” books that you can hold, flip through the pages, and read without an external power source.  The shelves held 15-20 new Android development books, but with only a quick review I couldn’t be sure which one(s) were worth taking home. If you’re a beginner,  how to you know if a book is worth buying? They all claim to cover “Android 4” (Ice Cream Sandwich or ICS), but some do a better job than others and some were based on the r15 ADT, which changes things significantly. Remember, every book on the shelf, or available from Amazon today, it at least partially out of date.

I’m not specifically recommending any books in today’s post because I want to finish working through a couple myself, but I’ll leave you with a few caveats.

  1. Read book reviews at Amazon, and pay attention to the review dates. It is not always the case, but reviews from 2011 or early 2012 may be of little help today.
  2. Read the NEGATIVE reviews. What have others found after purchasing? Is the book so riddled with errors that people are frustrated? Is the reviewer making a mistake and their negative review was do to their ignorance? Whatever the reason, you’ll find more value in the negative review than the positive declarations of “Great book!”.
  3. Don’t pay attention to the title. If it says “Android 4” in the title, read the reviews and dig deeper if you can. If you’re in a store, look at the pictures, are they showing references to the ICS SDKs? Do they show the r20 ADT, or is it the r15, or something even older? My recommendation is to avoid any book that doesn’t have screen captures of 4.0 (API 14) or above, and my preference would be for nothing lower than 4.03 (API 15) but that’s hard to find** (See Professional Android 4.0 Application Development by Meier as the exception).
  4. Copyright dates are not realistic. A second printing can generate a 2012 copyright, but the informaiton is outdated, often predating the real ICS release. Again, this may come out in online book reviews.

* There are other things that authors can do to remain current, and that will be the subject of a future post.