Getting the Android SDK

The Android SDK is composed of a debugger, Android libraries, a device emulator, documentation, sample code, and tutorials. You can't develop Android apps without the Android SDK.

To download the Android SDK, follow these steps:

  1. Point your browser to http://developer.android.com/sdk/index.html.
  2. Choose the latest version of the SDK starter package for your platform. If you're using Windows, please select the recommended download as it has an installer to streamline the installation process for you.
  3. Extract the SDK archive (.zip or .tgz).

    I recommend extracting /Library/android on Mac OS X because I reference this location later in this chapter.

    You've just downloaded the Android SDK.

  4. Navigate to the directory where you extracted the SDK, and double-click the SDK Manager.exe file. (In Mac OS X, double click the android file in the tools directory.)
  5. If you're prompted to accept the authenticity of the file, click Yes.

    The Android SDK and AVD Manager dialog box opens.

  6. Select the SDK Platform Android 3.0 check box.

    For the purposes of this book, select version 3.0, as shown in Figure 4-3. At this writing, 3.0 is the latest and greatest version of Android. Check the boxes for the documentation and samples that correspond with Android version 3.0 (API 11).

    Figure 4-3: Choose packages to install.

    image

    image Every time a new version of the Android OS is released, Google also releases an SDK that contains access to the added functionality in that version. If you want to include Bluetooth functionality in your app, for example, make sure that you have selected Android SDK version 2.0 or later, because this functionality isn't available in earlier versions.

  7. Click Install Selected.

    The Choose Packages to Install dialog box opens. (See Figure 4-4.)

  8. Select the Accept radio button to accept the license and then click Install.
  9. In the next dialog box, select Accept and click Install.

    The Installing Archives dialog box opens, displaying a progress bar.

  10. When the archives installation is complete, click the Close button.

image While the Android SDK is attempting to connect to the servers to obtain the files, you may occasionally receive a Failure to fetch URL error. If this happens to you, navigate to Settings, select Force https://… Sources to be Fetched Using http://, and then attempt to download the available packages again.

Adding the Android NDK

The Android Native Development Kit (NDK) is a set of tools that allows you to embed components that use native code — code that you've written in a native language such as C or C++.

If you decide to take on the NDK, you still have to download the SDK. The NDK isn't a replacement for the SDK; it's an added functionality set that complements the SDK. You can learn more about the NDK here: http://d.android.com/sdk/ndk/.

Figure 4-4: The Choose Packages to Install dialog box.

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.184.29