Keeping the Android SDK Updated
The SDK must be kept updated to allow App developers to work with the latest APIs on the evolving Android platform.
Use the Android SDK Manager program to update the existing installed SDK packages and to install new SDK packages.
The Android Operating System (OS) is constantly evolving and therefore so is the Android Software Development Kit (SDK). The ongoing development of Android is driven by:
- Google's research and development.
- Phone manufacturers developing new and improved handsets.
- Addressing security issues and possible exploits.
- The need to support new devices (e.g. support for tablets devices was added with version 3.0).
- Support for new hardware interfaces (e.g. adding support for Near Field Communication in version 2.3).
- Fixing bugs.
- Changes in the underlying Linux kernel.
- Deprecation of redundant programming interfaces.
- New uses (e.g. Android TV).
- The wider Android development community.
Installation of Android Studio and the Android SDK has been covered elsewhere (see Setting Up Android Studio or http://developer.android.com/sdk/installing/index.html). When Android Studio is run it will check for updates, to both Studio and the SDK. A message is displayed when updates are available. Most updates will be performed via the SDK Manager program. Studio will close and the SDK Manager will run, otherwise Manager can be accessed from within Studio or directly from the Android SDK install location.
In Studio selecting SDK Manager from the toolbar or via the Tools and Android menu shows the Android SDK Settings. The Launch Standalone SDK Manager link runs the external SDK Manager program.
The Android SDK is divided into several packages. The SDK Manager automatically scans for updates to existing packages and will list new packages. Available updates will be shown in a list (alongside available optional packages).
Available updates will be checked ready for download and installation, uncheck the ones not required. Unless short on disk space you can have all the API packages installed. Click the Install x packages button. If an update or package has licence terms that require accepting they are listed. Highlight each package to read the licence terms. The package can be accepted or rejected using the radio buttons. Rejected packages are marked with a red cross. Alternatively highlight the parent package and click on Accept All to accept everything that is available. All packages and updates ready to download and install will be shown with a green tick. Click Install, whilst the download and installation is progressing the log can be viewed by pressing the log icon in the bottom right of the Andriod SDK Manager dialog.
Any errors during the download and installation will be shown in red in the log dialog. Updates that affect the Android Debug Bridge (ADB) will result in a request to restart ADB. (Click Yes to restart ADB.) Obsolete packages will have been deleted during the download and installatiion. Close the log dialog, if open, and the Android SDK Manager dialog when all packages have been updated.
Occasionally there will be errors during the update process, more likely if there has been a long gap between updates and the SDK versions have moved on several points. The quickest way to resolve the errors is to manually update the SDK tools.
- Download the SDK Zip file from the Download the Android SDK web page at http://developer.android.com/sdk/index.html (scroll down to the command line tools section).
- Close Studio, any AVDs and any other programs.
- Close Android Debug Bridge (in Windows use Task Manager to end the adb.exe process).
- Copy the contents of the SDK Zip file over the current SDK install location.
- Run SDK Manager.exe as administrator (in Windows use the context menu, usually right-click, and select Run as administrator, click Yes to the security message that appears).
Android is an evolving platform, checking for updates every few weeks allows you to work with the latest tools and APIs.
Setting Up Android Studio