You've prepared your development machine and installed the Android SDK. Great! But are you sure all of your tools are updated? Learn how to keep the Android SDK and your app development tools up-to-date with this tutorial.
Step 0: Getting Started
This tutorial is part of the Mobiletuts+ "Learn Android SDK Development From Scratch!" session. This installment covers Eclipse, Android ADT, and Android SDK updates and will perform some operations from the command-line. These tips and tricks apply to all supported development environments -Windows, Mac, and Linux.
Tip 1: Updating Eclipse
Eclipse has a built-in software update system to update both itself and any installed plugins, such as the Android tools (ADT). To initiate an update from within Eclipse, complete the following steps:
Launch Eclipse. Go to Help, Check for updates...
When the check is completed, you'll be presented with a screen of Available Updates, if any. Updates are not automatically installed, you must select the software updates you wish to install. This screenshot shows an Eclipse environment where the Android tools have updates available.
Select any updates you wish to install. Generally, you'll want all of the checkboxes selected. Press the Next button. Review your choices. Press Next again.
On some platforms, you may see a message stating you don't have sufficient privileges to update some components. On these platforms, you'll need to relaunch Eclipse with administrator or root privileges.
Next, review and accept the license agreements associated with the software updates.
Finally, press Finish to complete the update wizard.
As with installing new software, Eclipse may ask you to restart. You should do so to make sure the installation is complete.
Tip 2: Check for New Tools in Existing Repositories
Sometimes new tools are added to the Android Eclipse repository. This has happened several times with the ADT. New items are not automatically downloaded during the Eclipse update process, either. Instead, you will need to check for new tools in the repository. To do this, follow these steps:
Go to Help, Install New Software... Then click on the drop down for the "Work with" field.
Choose the Android repository you previously created. Wait a moment and you'll see all available packages from this site.
Select any newly available packages you might want to add to your development environment.
Here in the demo environment you can see the NDK Plugins and the Tracer for OpenGL ES are newly available for download. We'll install those now.
Press the Next button and complete the installation as you normally would.
Tip 3: Update Android SDK Components
In addition to components available through Eclipse, the ADT can also update components and download new ones using the Android SDK Manager.
Launch the Android SDK Manager from within Eclipse by selecting Window > Android SDK Manager. An easier way to do this is simply clicking the little icon with the bugdroid head and the down arrow (shown in the upper left corner of the screenshot below). Wait for it to fully load and refresh. "Done loading packages" should display at the bottom when ready.
Select all of the updates you'd like to install. Then press the Install # packages... button. As with the original Android SDK install, you'll need to confirm the packages and then downloading and installation will commence. This part usually asks if you want to restart adb. You usually will want to since this ensures a good installation.
You will then get a reminder about updating Eclipse. But you've already done this, right? If you haven't, you may need to go back into the Android SDK Manager to check for newer items; some items are only available once you've updated ADT itself.
Tip 4: Handling Android SDK Update Failures
On operating systems where in-use files and directories can be locked, the Android SDK Manager will sometimes fail to update existing SDK files. If this happens to you, the solution is fairly simple -you need to perform the update outside of Eclipse.
Exit Eclipse. Wait for it to fully close. Make sure no other instances of Eclipse are running.
From the command line, run the "android" tool with no parameters. (You have the Android SDK binaries in your path, right?) When the android tool loads up, it should look very familiar:
It's the stand-alone version of the Android SDK Manager. With Eclipse now shut down, you should be able to complete your package update or installation.
We hope these tips have helped you out.
Do you have your own tips for keeping your development environment up-to-date? Let us know in the comments and perhaps they'll be added to the next update of this tip list!
You're on your way to Android development. 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 email@example.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!
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.Update me weekly
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post