Fedora 12安装Android SDK

1. 下载Android SDK

由于android网站国内不能直接访问, 请通过以下网址下载


http://androidappdocs.appspot.com/index.html

http://dl.google.com/android/android-sdk-windows-1.6_r1.zip

Windows: http://dl.google.com/android/android-sdk-windows-1.6_r1.zip

Mac OS X (intel): http://dl.google.com/android/android-sdk-mac_x86-1.6_r1.zip

Linux (i386): http://dl.google.com/android/android-sdk-linux_x86-1.6_r1.tgz

ADT Plugin for Eclipse 0.9.3: http://dl.google.com/android/ADT-0.9.3.zip

ophone develop : http://www.ophonesdn.com/

http://blog.csdn.net/vagrxie/archive/2009/08/04/4409464.aspx

android developer: http://www.anddev.org/


2. 添加Android SDK

运行android后,在选择Available Packages时遇到错误消息:
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: HTTPS SSL error. You might want to force download through HTTP in the settings.
解决方法是:
  • 创建配置文件: ~/.android/androidtool.cfg,在该文件中添加一行

sdkman.force.http=true

(该方法无效)
  • 打开"Settings" 选项并选中misc section "force https:// ... sources to be fetched using http://..." ,重启android. (点击Save后没有反应,重启后发现该选项并没有选中,无效)
  • export GDK_NATIVE_WINDOWS=true before running android sdk manager.
    It fixes both the save button and the install button for me. (该方法可行)

3. 为Eclipse安装ADT插件

安装ADT的方法 Installing and Updating ADT
遇到的问题: During installation, there's an error about requiring org.eclipse.wst.sse.ui.
下面是我的经验:

The Google Plugin for Eclipse depends on other specific Eclipse components, such as WST . Your installation of Eclipse may not yet include all of them, but they can be easily installed by following these instructions.

Eclipse 3.5 (Galileo)

  1. Select Help > Install New Software...
  2. Click the hyperlink for Available Software Sites .
  3. Ensure there is an update site named Galileo . If this is not present, click Add... and enter http://download.eclipse.org/releases/galileo for the Location.(在这一步,添加完Galileo之后,最好能安装一下这个site的可用的关键更新)
  4. Now go through the installation steps ; Eclipse should download and install the plugin's dependencies.

完成上面的步骤之后,Google App Engine和 Web Toolkit插件就被安装到了Eclipse。此时你仍然需要按照 http://androidappdocs.appspot.com/sdk/eclipse-adt.html 所陈述的步骤再安装ADT并配置SDK。


如果按照上述方法仍然无法安装ADT,最好通过System->Administration->Add/Remove Software彻底删除Eclipse,删除$HOME/.eclipse文件夹,更新操作系统,然后重装Eclipse。如果选择自己下载Eclipse,运行时很可能会遇到"JVM terminated. Exit Code=-1"的问题。因此还是建议通过Add/Remove Software或者yum install eclipse安装。重新安装完eclipse,再按照上述步骤先安装GAE和GWT,然后安装ADT。

ADT成功安装后,在Eclipse的Window->Preferences中,可以找到Android这一项:
装完ADT之后就可以按照 http://androidappdocs.appspot.com/guide/tutorials/hello-world.html 的示例开始体验Android程序了!