Advertisement
  1. Code
  2. Android SDK
Code

Android Prerequisites: Mac Preparation

Difficulty:BeginnerLength:QuickLanguages:
This post is part of a series called Learn Android SDK Development From Scratch.
Android Prerequisites: Windows Preparation

Want to start writing your own Android apps on your Mac? Make sure your machine is ready to install the Android SDK by taking these preliminary steps. This tutorial will guide you through the installation of tools needed before you install the Android SDK on your Mac development machine.


Step 0: Getting Started

This tutorial is for those familiar with Java and interested in getting started learning app development with the Android SDK. This version of the tutorial is specifically designed to help the Mac developer install the prerequisite applications for Android development on Mac operating systems. You must be running OS X 10.5.8 or later. We used Mac OS X 10.8 (aka Mountain Lion) for this tutorial. If you are using an operating system other than Mac OS, you may want to read the Windows prerequisites tutorial or the Ubuntu prerequisites tutorial before moving forward with this session.

If you're interested in learning Android SDK development but are unfamiliar with Java or just in need of a refresher, you can prepare for this session by reading the Learn Java for Android Development series previously published by Mobiletuts+.


Step 1: Installing a Java Development Kit

Your machine may already have a Java Runtime environment installed, but you must have the JDK installed as well. We'll be using the Oracle Java Development Kit, so go to the official download page and choose the Java Platform link.

On the next page, scroll down and choose your platform and accept the licensing agreement. The installation for Mac is 64-bit only, which is not a problem for most Mac users. It is certainly not an issue for Mac OS X 10.8, which requires newer 64-bit hardware and runs in 64-bit mode by default.

Note: You may need to create an Oracle account to continue downloading the JDK.

Once the disk image is downloaded, find it in Finder and open it. After the volume is opened you should see a window like this:

Double-click on the package to bring up the Installation Wizard.

Follow the installation steps by clicking Continue until you've successfully installed the JDK.


Step 2: Installing Eclipse

Next, you need to install the Eclipse development environment in order to create Android projects. Although Eclipse isn't the only development environment you can use to create Android apps, it has the best support from the Android team and is the easiest for those just getting started with Android development.

Start by going to Eclipse.org and finding one of the download links.

Now choose your version of Eclipse and your platform. For most Mac users, you can choose the 64-bit version. In fact, if you made it through the last step, 64-bit should be the correct option. You should either choose Eclipse IDE for Java EE Developers or Eclipse IDE for Java Developers.

When you have finished downloading the Eclipse package, you'll have a compressed archive (.tar.gz) on your computer. Double-click on it to extract the files from the archive.

When you finish extracting and placing the entire Eclipse directory files in a good location on your Mac (likely the Applications folder), find the Eclipse executable file in your new Eclipse directory and double-click it to launch Eclipse for the first time.

Even though you've installed the JDK, it's possible that you still need to install the Java runtime. If this is the case, Mac OS X will ask you to install it at this time:

Choose Install. The installation will be performed automatically.

Next, you may find that you are still unable to run Eclipse if you're running Mac OS X 10.8 due to security settings. If this is the case, you will be prompted as follows:

At this time, Eclipse is not available via the Mac App Store and, since it doesn't have an installer and isn't from an identified developer, you'll have to change your system security settings to accommodate using this tool.

To fix this issue for all apps, go to System Preferences > Security & Privacy > General, and turn on All applications downloaded from "Anywhere." Doing this is not recommended for everyone, but if you install a lot of third-party applications that don't support the new Mac OS X 10.8 security system, it could save a bunch of time. However, note that doing this does have some risk; malicious apps may be able to install and/or run without your knowledge.

Instead of changing your security policy to allow all third party apps, we recommend the individual application exception method. To make a specific exception solely for Eclipse, control-click Eclipse and choose Open from the menu. This will bring up a dialog warning you of the risks, but this time with an Open button.

Click the Open button and Eclipse will launch. After you have done this once, you won't have to do it again.

If you see the Eclipse splash screen displayed on your screen, it's a good sign:

When you see the Welcome screen, you're ready to move on to the next tutorial in this session and install the Android SDK!


Conclusion

Your Mac development machine is now ready for installation of the Android SDK. In the next tutorial, you'll learn how to install and configure the Android SDK for Android app development. In the meantime, you might considering familiarizing yourself with Eclipse.

You're on your way to becoming an Android developer. What kinds of apps are you looking forward to creating? Let us know in the comments!

About the Authors

Mobile developers Lauren Darcey and Shane Conder have coauthored several books on Android development: an in-depth programming book entitled Android Wireless Application Development (now in it's third edition as a two-volume set), Sams Teach Yourself Android Application Development in 24 Hours, and Learning Android Application Programming for the Kindle Fire: A Hands-On Guide to Building Your First Android Application. When not writing, they spend their time developing mobile software at their company and providing consulting services. They can be reached at via email to androidwirelessdev+mt@gmail.com, via their blog at androidbook.blogspot.com, and on Twitter @androidwireless.

Need More Help Writing Android Apps? Check out our Latest Books and Resources!

Buy Android Wireless Application Development 3rd Edition Volume 1  Buy Sams Teach Yourself Android Application Development in 24 Hours 2nd Edition  Mamlambo code at Code Canyon

Advertisement
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.