| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 1 | page.title=Exploring the SDK |
| Scott Main | 527b7623 | 2013-05-15 02:33:57 -0700 | [diff] [blame] | 2 | excludeFromSuggestions=true |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 3 | walkthru=1 |
| 4 | |
| 5 | @jd:body |
| 6 | |
| 7 | |
| 8 | <p>The Android SDK is composed of modular packages that you can download separately using |
| 9 | the Android SDK Manager. For example, when the SDK Tools are updated or a new version of |
| 10 | the Android platform is released, you can use the SDK Manager to quickly download them to |
| 11 | your environment. Simply follow the procedures described in <a |
| 12 | href="{@docRoot}sdk/installing/adding-packages.html">Adding Platforms and Packages</a>.</p> |
| 13 | |
| 14 | <p>There are several different packages available for the Android SDK. The table below describes |
| 15 | most of the available packages and where they're located once you download them.</p> |
| 16 | |
| 17 | |
| 18 | <h2 id="Packages">Available Packages</h2> |
| 19 | |
| 20 | |
| 21 | <table> |
| 22 | <tr><th>Package</th><th>Description</th><th>File Location</th></tr> |
| 23 | <tr> |
| 24 | <td><a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a></td> |
| 25 | <td>Contains tools for debugging and testing, plus other |
| 26 | utilities that are required to develop an app. If you've just installed the SDK starter package, |
| 27 | then you already have the latest version of this package. Make sure you keep this up to date.</td> |
| 28 | <td>{@code <sdk>/tools/}</td></tr> |
| 29 | <tr><td>SDK Platform-tools</td> |
| 30 | <td>Contains platform-dependent tools for developing and debugging |
| 31 | your application. These tools support the latest features of the Android platform and are typically |
| 32 | updated only when a new platform becomes available. These tools are always backward compatible with |
| 33 | older platforms, but you must be sure that you have the latest version of these tools when you |
| 34 | install a new SDK platform.</td> |
| 35 | <td>{@code <sdk>/platform-tools/}</td> |
| 36 | </tr> |
| 37 | |
| 38 | <tr> |
| 39 | <td>Documentation</td> |
| 40 | <td>An offline copy of the latest documentation for the Android |
| 41 | platform APIs.</td> |
| 42 | <td>{@code <sdk>/docs/}</td> |
| 43 | </tr> |
| 44 | <tr><td>SDK Platform</td> |
| 45 | <td>There's one SDK Platform available for each version of Android. It includes an {@code |
| 46 | android.jar} file with a fully compliant Android library. In order to build an Android app, you must |
| 47 | specify an SDK platform as your build target.</td> |
| 48 | <td>{@code <sdk>/platforms/<android-version>/}</td> |
| 49 | </tr> |
| 50 | <tr> |
| 51 | <td>System Images</td> |
| 52 | <td>Each platform version offers one or more different system images (such as for ARM |
| 53 | and x86). The Android emulator requires a system image to operate. You should always test your |
| 54 | app on the latest version of Android and using the emulator with the latest system image is a |
| 55 | good way to do so.</td> |
| 56 | <td>{@code <sdk>/platforms/<android-version>/}</td> |
| 57 | </tr> |
| 58 | <tr> |
| 59 | <td>Sources for Android SDK</td> |
| 60 | <td>A copy of the Android platform source code that's useful for |
| 61 | stepping through the code while debugging your app.</td> |
| 62 | <td>{@code <sdk>/sources/}</td> |
| 63 | </tr> |
| 64 | <tr> |
| 65 | <td><a href="{@docRoot}tools/samples/index.html">Samples for SDK</a></td> |
| 66 | <td>A collection of sample apps that demonstrate a variety of the |
| 67 | platform APIs. These are a great resource to browse Android app code. The API Demos app in |
| 68 | particular provides a huge number of small demos you should explore.</td> |
| 69 | <td>{@code <sdk>/platforms/<android-version>/samples/}</td> |
| 70 | </tr> |
| 71 | <tr> |
| 72 | <td><a href="http://developers.google.com/android">Google APIs</a></td> |
| 73 | <td>An SDK add-on that provides both a platform you can use to develop an app |
| 74 | using special Google APIs and a system image for the emulator so you can test your app using the |
| 75 | Google APIs.</td> |
| 76 | <td>{@code <sdk>/add-ons/}</td> |
| 77 | </tr> |
| 78 | |
| 79 | <tr> |
| Scott Main | 4e2c9dc | 2013-07-23 19:35:17 -0700 | [diff] [blame] | 80 | <td><a href="{@docRoot}tools/support-library/index.html">Android Support</a></td> |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 81 | <td>A static library you can include in your app sources in order to use powerful |
| 82 | APIs that aren't available in the standard platform. For example, the support library |
| 83 | contains versions of the {@link android.support.v4.app.Fragment} class that's compatible with |
| 84 | Android 1.6 and higher (the class was originally introduced in Android 3.0) and the {@link |
| 85 | android.support.v4.view.ViewPager} APIs that allow you to easily build a side-swipeable UI.</td> |
| 86 | <td>{@code <sdk>/extras/android/support/}</td> |
| 87 | </tr> |
| 88 | <tr> |
| Dirk Dougherty | 2b286bb | 2012-11-29 17:25:09 -0800 | [diff] [blame] | 89 | <td><a href="{@docRoot}google/play/billing/index.html">Google Play Billing</a></td> |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 90 | <td>Provides the static libraries and samples that allow you to |
| 91 | integrate billing services in your app with Google Play.</td> |
| 92 | <td>{@code <sdk>/extras/google/}</td> |
| 93 | </tr> |
| 94 | <tr> |
| Dirk Dougherty | 2b286bb | 2012-11-29 17:25:09 -0800 | [diff] [blame] | 95 | <td><a href="{@docRoot}google/play/licensing/index.html">Google Play Licensing</a></td> |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 96 | <td>Provides the static libraries and samples that allow you to perform license verification for |
| 97 | your app when distributing with Google Play.</td> |
| 98 | <td>{@code <sdk>/extras/google/}</td> |
| 99 | </tr> |
| 100 | </table> |
| 101 | |
| 102 | <p>The above table is not comprehensive and you can <a |
| 103 | href="#AddingSites">add new sites</a> to download additional packages from third-parties.</p> |
| 104 | |
| 105 | <p>In some cases, an SDK package may require a specific minimum revision of |
| 106 | another package or SDK tool. For example, there may be a dependency between the ADT Plugin for |
| 107 | Eclipse and |
| 108 | the SDK Tools package. When you install the SDK Tools |
| 109 | package, you should also upgrade to the required version of ADT (if you |
| 110 | are developing in Eclipse). In this case, the major version number for your ADT plugin should |
| 111 | always match the revision number of your SDK Tools (for example, ADT 8.x requires SDK Tools r8). |
| 112 | </p> |
| 113 | |
| 114 | <p>The development tools will notify you with debug warnings if there is dependency that you need to |
| 115 | address. The Android SDK Manager also enforces dependencies by requiring that you download any |
| 116 | packages that are needed by those you have selected.</p> |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | <h2 id="AddingSites">Adding New Sites</h2> |
| 123 | |
| 124 | <p>By default, <strong>Available Packages</strong> displays packages available from the |
| 125 | <em>Android Repository</em> and <em>Third party Add-ons</em>. You can add other sites that host |
| 126 | their own Android SDK add-ons, then download the SDK add-ons |
| 127 | from those sites.</p> |
| 128 | |
| 129 | <p>For example, a mobile carrier or device manufacturer might offer additional |
| 130 | API libraries that are supported by their own Android-powered devices. In order |
| 131 | to develop using their libraries, you must install their Android SDK add-on, if it's not already |
| 132 | available under <em>Third party Add-ons</em>. </p> |
| 133 | |
| 134 | <p>If a carrier or device manufacturer has hosted an SDK add-on repository file |
| 135 | on their web site, follow these steps to add their site to the Android SDK |
| 136 | Manager:</p> |
| 137 | |
| 138 | <ol> |
| 139 | <li>Select <strong>Available Packages</strong> in the left panel.</li> |
| 140 | <li>Click <strong>Add Add-on Site</strong> and enter the URL of the |
| 141 | <code>repository.xml</code> file. Click <strong>OK</strong>.</li> |
| 142 | </ol> |
| 143 | <p>Any SDK packages available from the site will now be listed under a new item named |
| 144 | <strong>User Add-ons</strong>.</p> |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | <h2 id="troubleshooting">Troubleshooting</h2> |
| 150 | |
| 151 | <p><strong>Problems connecting to the SDK repository</strong></p> |
| 152 | |
| 153 | <p>If you are using the Android SDK Manager to download packages and are encountering |
| 154 | connection problems, try connecting over http, rather than https. To switch the |
| 155 | protocol used by the Android SDK Manager, follow these steps: </p> |
| 156 | |
| 157 | <ol> |
| 158 | <li>With the Android SDK Manager window open, select "Settings" in the |
| 159 | left pane. </li> |
| 160 | <li>On the right, in the "Misc" section, check the checkbox labeled "Force |
| 161 | https://... sources to be fetched using http://..." </li> |
| 162 | <li>Click <strong>Save & Apply</strong>.</li> |
| 163 | </ol> |
| 164 | |
| 165 | |
| 166 | |
| 167 | |