Point your browser to http:java.sun.comjavasedownloads index.jsp Click the JDK link under the Java Platform JDK heading see Figure 2-5.

37

Chapter 2: Prepping Your Development Headquarters

7. Click Install Selected.

The Choose Packages to Install dialog box opens.

8. Select the Accept radio button to accept the license and then click Install see Figure 2-9.

Figure 2-9: The Choose Packages to Install dialog box.

9. In the next dialog box, select Accept and click Install.

The Installing Archives dialog box opens, displaying a progress bar see Figure 2-10. Figure 2-10: The Installing Archives dialog box.

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

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. 38 Part I: The Nuts and Bolts of Android Following and setting your tools path This step is optional, but I highly recommend setting the tools path because it saves you from having to remember and type the full path when you’re accessing the Android Debug Bridge adb via the command line. The adb lets you manage the state of an emulator or Android device so that you can debug your application or interact with the device at a high level. The adb tool is very in-depth, so I don’t go into a lot of detail about it here; for detailed information, see the Android documentation. To add the Android tools to your system-path variable, follow these steps:

1. Open Control Panel, and double-click the System icon to open System Preferences.

2. Click the Advanced System Settings link see Figure 2-11 to open the System Properties window.

Figure 2-11: The Advanced System Settings link. 3. Click the Environment Variables button see Figure 2-12 to bring up the Environment Variables dialog box. Adding the Android NDK The Android Native Development Kit NDK is a set of tools that allows you to embed compo- nents 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 replace- ment for the SDK; it’s an added functionality set that complements the SDK.