Androidsdk

From WeWeWeb Wiki
Jump to: navigation, search

Download the SDK from http://developer.android.com/index.html.

Extract it into a directory. (say c:\android-sdk)

Append the folder "c:\android-sdk\tools" to PATH environment variable.

For Linux, add a line the following line into the file .bashrc in home directory:

 export PATH=${PATH}:/opt/android-sdk/tools

If you run the problem, android, the following error message may be disppeared:

 Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-gtk-3550 or swt-gtk in swt.library.path,
 java.library.path or the jar file
       at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)

It is because the version of library cannot be load.

To solve the problem:

  1. Install the packages (libswt-gtk-3.4-java and libswt-gtk-3.4-jni)
  2. Remove the file ./tools/lib/x86/swt.jar
  3. Set a symbolic link with the command "ln -s /usr/lib/java/swt-gtk-3.4.2.jar swt.jar"
  4. set the environment variable with "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jni"

Run setup to download and install the platform. (currently is Android 2.2)

You may experience an error: "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.". Just go to setttings and force http will be ok.

List the target device. In DOS prompt:

 android.bat list target

Add the target device: (android-2.2 any name, and 1 is target id which show in the last command.)

 android.bat create avd -n android-2.2 -t 1

Done!


Goto android