The first and most important piece of software you need to download is, of course, the Android SDK. The Android SDK contains a debugger, libraries, an emulator, documentation, sample code, and tutorials.
FIGURE 1-8
The Android SDK is packaged in a zip file. You can download it and unzip its content (the android-sdk-windows folder) into a folder, say C:\Android 4.0\. For Windows user, Google recommends that you download the installer_r15-windows.exe file instead and use it to set up the tools for you automatically. The following steps walk you through the installation process using this approach.
Installing the Android SDK Tools
When you have downloaded the installer_r15-windows.exe file, double-click it to start the installation of the Android tools. In the welcome screen of the Setup Wizard, click Next to continue.
If your computer does not have Java installed, you will see the error dialog shown in Figure 1-9. However, even if you have Java installed, you may still see this error. If this is the case, click the Report error button and thenclick Next.
FIGURE 1-9
You will be asked to provide a destination folder to install the Android SDK tools. Enter a destination path (see Figure 1-10) and click Next.
When you are asked to choose a Start Menu folder to create the program’s shortcut, take the default “Android SDK Tools” and click Install. When the setup is done, check the “Start SDK Manager (to download system images,etc.)” option and click Finish (see Figure 1-11). This will start the SDK Manager.
FIGURE 1-10
FIGURE 1-11
Configuring the Android SDK Manager
The Android SDK Manager manages the various versions of the Android SDK currently installed on your computer. When it is launched, you will see a list of items and whether or not they are currently installed on yourcomputer (see Figure 1-12).
Check the relevant tools, documentation, and platforms you need for your project. Once you have selected the items you want, click the Install button to download them. Because it takes a while
to download from Google’s server, it is a good idea to download only what you need immediately, and download the rest when you have more time. For now, you may want to check the items shown in the figure.
FIGURE 1-12
Each version of the Android OS is identified by an API level number. For example, Android 2.3.3 is level 10 (API 10), while Android 3.0 is level 11 (API 11), and so on. For each level, two platforms are available. For example, level 14offers the following:
➤ SDK Platform
➤ Google APIs by Google Inc.
The key difference between the two is that the Google APIs platform contains additional APIs provided by Google (such as the Google Maps library). Therefore, if the application you are writing requires Google Maps, you need tocreate an AVD using the Google APIs platform (more on this is provided in Chapter 9, “Location-Based Services.”
You will be asked to choose the packages to install (see Figure1-13). Check the Accept All option and click Install.
FIGURE 1-13
The SDK Manager will proceed to download the packages that you have selected. The installation takes some time, so be patient. When all the packages are installed, you will be
asked to restart the ADB (Android Debug Bridge). Click Yes.
Không có nhận xét nào:
Đăng nhận xét