google android 新SDK终于发布(the Android 0.9 SDK beta)

   日期:2024-12-26    作者:p9tos 移动:http://oml01z.riyuangf.com/mobile/quote/50357.html

http://code.google.com/android/intro/upgrading.html

 

 

This guide will help you migrate your development environment and applications to the Android 0.9 SDK beta. Use this guide if you've been developing for Android on any of the m3 or m5 versions of the SDK.

The Andoid 0.9 SDK beta includes:

  • Extensions, changes and improvements to the framework and library APIs
  • New developer tools
  • Enhancements to existing developer tools
  • Redesigns to the home screen, some applications and UI
  • Plus various other improvements throughout the system

To take advantage of these features, you need to install the new SDK and upgrade your existing Android applications. The sections below guide you through the process.

Download the SDK and unpack it into a safe location.

After unpacking the new SDK, you should:

  • Wipe your emulator data.

    Some data formats have changed since the last SDK release, so any previously saved data in your emulator must be removed. Open a console/terminal and navigate to the directory of your SDK. Launch the emulator with the option.

    Windows:
    Mac/Linux:

  • Update your PATH variable (Mac/Linux; optional).

    If you had previously setup your PATH variable to point to the SDK tools directory, then you'll need to update it to point to the new SDK. E.g., for a or file:

If you develop on Eclipse and are using the ADT plugin, follow these steps to install the new plugin that accompanies the latest SDK.

Eclipse 3.3 (Europa) Eclipse 3.4 (Ganymede)
  1. Select Help > Software Updates > Find and Install....
  2. Select Search for updates of the currently installed features and click Finish.
  3. If any update for ADT is available, select and install.
  4. Restart Eclipse.
  1. Select Help > Software Updates...
  2. Select the Installed Software tab.
  3. Click Update...
  4. If an update for ADT is available, select it and click Finish.
  5. Restart Eclipse.

After restart, update your Eclipse preferences to point to the SDK directory:

  1. Select Window > Preferences... to open the Preferences panel. (Mac OSX: Eclipse > Preferences)
  2. Select Android from the left panel.
  3. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
  4. Click Apply, then OK.

All applications must now be signed before you can install them on the emulator. Both the ADT plugin and the Ant-based build tools support this requirement by signing compiled .apk files with a debug key. To do so, the build tools use the Keytool utility included in the JDK to to create a keystore and a key with a known alias and password. For more information, see Signing Your Applications.

To support signing, you should first make sure that Keytool is available to the SDK build tools. In most cases, you can tell the SDK build tools how to find Keytool by making sure that your JAVA_HOME environment variable is set and that it references a suitable JDK. Alternatively, you can add the JDK version of Keytool to your PATH variable.

If you are developing on a version of Linux that originally came with Gnu Compiler for Java, make sure that the system is using the JDK version of Keytool, rather than the gcj version. If keytool is already in your PATH, it might be pointing to a symlink at /usr/bin/keytool. In this case, check the symlink target to make sure that it points to the keytool in the JDK.

If you use Ant to build your .apk files (rather than ADT for Eclipse), you must regenerate your build.xml file. To do that, follow these steps:

  1. In your Android application project directory, locate and delete the current build.xml file.
  2. Run activitycreator, directing output to the folder containing your application project.

Run in this way, activityCreator will not erase or create new Java files (or manifest files), provided the activity and package already exists. It is important that the package and the activity are real. The tool creates a new build.xml file, as well as a new directory called "libs" in which to place 3rd jar files, which are now automatically handled by the Ant script.

After updating your SDK, you will likely encounter breakages in your code, due to framework and API changes. You'll need to update your code to match changes in the Andriod APIs.

One way to start is to open your project in Eclipse and see where the ADT identifies errors in your application. From there, you can lookup respective changes in the Overview of Changes and API Diffs Report.

If you have additional trouble updating your code, visit the Android Discussion Groups to seek help from other Android developers.


特别提示:本信息由相关用户自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。


举报收藏 0评论 0
0相关评论
相关最新动态
推荐最新动态
点击排行
{
网站首页  |  关于我们  |  联系方式  |  使用协议  |  隐私政策  |  版权隐私  |  网站地图  |  排名推广  |  广告服务  |  积分换礼  |  网站留言  |  RSS订阅  |  违规举报  |  鄂ICP备2020018471号