1 page.title=Upgrading the SDK 2 sdk.version=1.1_r1 3 @jd:body 4 5 <!-- 6 <div class="sidebox-wrapper"> 7 <div class="sidebox"> 8 9 <h2>Useful Links</h2> 10 11 <ul class="noindent"> 12 <li><a href="migrating/0.9-1.0/changes-overview.html">Overview of Changes</a> 13 <p>A high-level look at what's changed in Android, with 14 discussion of how the changes may affect your apps.</p></li> 15 16 <li><a href="migrating/0.9-1.0/changes.html">API Diff Report</a> 17 <p>A detailed report that lists all the specific changes in the latest SDK.</p></li> 18 19 <li><a href="RELEASENOTES.html">Release Notes</a> 20 <p>Version details, known issues, and resolved issues. </p></li> 21 22 <li><a href="http://groups.google.com/group/android-developers">Android Developers Group</a> 23 <p>A forum where you can discuss migration issues and learn from other Android developers. </p></li> 24 25 <li><a href="http://code.google.com/p/android/issues/list">Android Issue Tracker</a> 26 <p>If you think you may have found a bug, use the issue tracker to report it.</p></li> 27 </ul> 28 29 </div> 30 </div> 31 --> 32 33 <p>This document describes how to move your development environment and existing 34 Android applications from an Android 1.0 SDK to the Android 1.1, Release 1 SDK. 35 If you are migrating applications from an earlier SDK, please read the upgrading 36 document available in the Android 1.0 SDK package. 37 </p> 38 39 <p>To ensure that your applications are compliant with the Android 1.1 system available 40 on mobile devices, you need to install the Android 1.1 SDK and port your existing Android 41 applications to it. The sections below will guide you through the process.</p> 42 43 <h2 id="install-new">Installing the Latest SDK</h2> 44 45 <p><a href="{@docRoot}sdk/1.1_r1/index.html">Download the SDK</a> and unpack it into a safe location.</p> 46 47 <p>After unpacking the new SDK and saving it an appropriate location, you should:</p> 48 49 <ul> 50 <li>Wipe your emulator data. <p>Some data formats have changed since the last 51 SDK release, so any previously saved data in your emulator must be removed. Open a console/terminal 52 and navigate to the <code>/tools</code> directory of your new SDK. Launch the 53 emulator with the <code>-wipe-data</code> option. 54 <p>Windows: <code>emulator -wipe-data</code><br/> 55 Mac/Linux: <code>./emulator -wipe-data</code></p> 56 </li> 57 <li>Update your PATH variable (Mac/Linux; optional). <p>If you had previously setup your 58 PATH variable to point to the SDK tools directory, then you'll need to update it to 59 point to the new SDK. For example, for a <code>.bashrc</code> or <code>.bash_profile</code> file: 60 <code>export PATH=$PATH:<em><your_new_sdk_dir></em>/tools</code></p> 61 </li> 62 <li>If (and only if) you are developing using Ant, you will also need to modify 63 your build.xml properties to point to the new SDK. 64 <p>Open the <code>default.properties</code> file associated with your build.xml 65 file (typically located in the same directory). In the default.properties 66 file, update the <code>sdk-folder</code> property with the full path to 67 the new SDK directory.</p></li> 68 </ul> 69 70 <a name="Updating_the_ADT_plugin" id="Updating_the_ADT_plugin"></a> 71 <h2 id="update-plugin">Update your ADT Eclipse Plugin</h2> 72 73 <p>If you develop on Eclipse and are migrating from an Android 1.0 74 SDK, no update of the ADT plugin is needed — skip to <a href="#updateEclipsePrefs">Update your Eclipse SDK Preferences</a>. </p> 75 76 <p>If you are migrating from an earlier version of the SDK, you will 77 need to update the ADT plugin. <p>You may also want to upgrade your 78 ADT plugin when a new version becomes available for your existing version 79 of the SDK.</p> 80 81 <p>The steps below describe how to update the ADT plugin to the latest 82 version available. </p> 83 84 <table style="font-size:100%"> 85 <tr><th>Eclipse 3.3 (Europa)</th><th>Eclipse 3.4 (Ganymede)</th></tr> 86 <tr> 87 <td width="50%"> 88 <ol> 89 <li> Select <strong>Help</strong> > <strong>Software Updates</strong> > <strong>Find and Install...</strong>. </li> 90 <li> Select <strong>Search for updates of the currently installed features</strong> and click <strong>Finish</strong>. </li> 91 <li> If any update for ADT is available, select and install. </li> 92 <li> Restart Eclipse.</li> 93 </ol> 94 <p> Alternatively, </p> 95 <ol> 96 <li> Select <strong>Help</strong> > <strong>Software Updates</strong> > <strong>Manage Configuration</strong>. </li> 97 98 <li> Navigate down the tree and select <strong>Android Development Tools <version></strong> </li> 99 <li> Select <strong>Scan for Updates</strong> under <strong>Available Tasks</strong>.</li> 100 </ol> 101 </td> 102 <td> 103 <ol> 104 <li>Select <strong>Help</strong> > <strong>Software Updates...</strong></li> 105 <li>Select the <strong>Installed Software</strong> tab.</li> 106 <li>Click <strong>Update...</strong></li> 107 <li>If an update for ADT is available, select it and click <strong>Finish</strong>.</li> 108 <li>Restart Eclipse.</li> 109 </ol> 110 </td> 111 </tr> 112 </table> 113 114 <h2 id="updateEclipsePrefs">Update your Eclipse SDK Preferences</h2> 115 116 <p>The last step is to update your Eclipse preferences to point to the new SDK directory:</p> 117 <ol> 118 <li>Select <strong>Window</strong> > <strong>Preferences...</strong> to open the Preferences panel. (Mac OSX: <strong>Eclipse</strong> > <strong>Preferences</strong>)</li> 119 <li>Select <strong>Android</strong> from the left panel.</li> 120 <li>For the SDK Location in the main panel, click <strong>Browse...</strong> and locate the SDK directory.</li> 121 <li>Click <strong>Apply</strong>, then <strong>OK</strong>.</li> 122 </ol> 123 124 <h2 id="migrate">Migrate Your Applications, if Necessary</h2> 125 126 <p>If (and only if) you have written apps in an SDK released previous to 127 the Android 1.0 SDK, you will need to migrate your applications. After 128 installing the new SDK and updating the ADT Plugin (if applicable), you 129 may encounter breakages in your application code, due to 130 framework and API changes. You'll need to update your code to match the 131 latest APIs.</p> 132 133 <p>One way to start is to open your project in Eclipse and see where the ADT 134 identifies errors in your application. You can also look up 135 specific changes in the Android APIs in the 136 <a href="{@docRoot}sdk/android-1.1.html#api-changes">Android 1.1 Version 137 Notes</a> document.</p> 138 139 140 <p>If you have additional trouble updating your code, visit the 141 <a href="http://groups.google.com/group/android-developers">Android Developers Group</a> 142 to seek help from other Android developers.</p> 143 144 <p>If you have modified one of the ApiDemos applications and would like to migrate it 145 to the new SDK, note that you will need to uninstall the version of ApiDemos that comes 146 preinstalled in the emulator. For more information, or if you encounter an "reinstallation" 147 error when running or installing ApiDemos, see the troubleshooting topic 148 <a href="{@docRoot}resources/faq/troubleshooting.html#apidemosreinstall">I can't install ApiDemos 149 apps in my IDE because of a signing error</a> for information about how to solve the problem.</p> 150 151