Install and configure Android SDK and ndk on ubuntu9.04

Source: Internet
Author: User
Tags gtk

1. Download the android SDK
As follows:
Http://dl.google.com/android/android-sdk-windows-1.5_r2.zip
Http://dl.google.com/android/android-sdk-linux_x86-1.5_r2.zip
2. Download eclipse 3.4.2
According to official documents, Android SDK can run in IDE of eclipse 3.3 or above. The eclipse version in Ubuntu is too low. We recommend that you use eclipse 3.4.2, which is:
Http://download.actuatechina.com/eclipse/eclipse/downloads/drops/R-3.4.2-200902111700/eclipse-SDK-3.4.2-linux-gtk.tar.gz
3. Install eclipse 3.4.2
Decompress Eclipse:
$ Tar xzvf eclipse-SDK-3.4.2-linux-gtk.tar.gz
Move the decompressed eclipse folder to the target directory. Here, the installation target is/usr/local.
$ Sudo MV Eclipse/usr/local/
4. Install the android SDK
Decompress the android SDK package:
$ Unzip android-sdk-linux_x86-1.5_r2.zip
Move to the target directory: $ MV android-sdk-linux_x86-1.5_r2 Android-SDK
$ Sudo MV Android-SDK/usr/local/
5. Configure environment variables:
Modify ~ /. Bashrc file, add the environment variables of Android SDK and eclipse.
$ VI ~ /. Bashrc
Add at the end of the file
Export Path =/usr/local/Android-SDK/tools:/usr/local/Eclipse: $ path
Save and exit vi
Make the configuration take effect
$ Source ~ /. Bashrc
6. Android AVD configuration information generation
Android AVD creation format: Android create AVD-n your-AVD-name-t your-Targets
Here: The-N parameter is the name of the AVD we want to create; The-t parameter is the ID of available Android targets. We can use the command: Android list to query its specific information.
$ Android list

Available Android targets:
ID: 1
Name: IOS 1.1
Type: Platform
API level: 2
Skins: HVGA-P, hvga (default), QVGA-P, HVGA-L, QVGA-L
ID: 2
Name: IOS 1.5
Type: Platform
API level: 3
Skins: HVGA-P, hvga (default), QVGA-P, HVGA-L, QVGA-L
ID: 3
Name: Google APIs
Type: add-on
Vendor: Google Inc.
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* COM. Google. Android. Maps (maps. Jar)
API for Google Maps
Skins: QVGA-P, HVGA-L, hvga (default), QVGA-L, HVGA-P
Available Android Virtual Devices:

The following uses creating an AVD for Android 1.5 as an example:

$ Android create AVD-N android-sdk-15-T 2

The android 1.5 is a basic Android platform.
Do you wish to create a custom hardware profile [No] Yes

Device Ram size: the amount of physical RAM on the device, in megabytes.
HW. ramsize [96]: 128

Touch-screen support: whether there is a touch screen or not on the device.
HW. touchscreen [Yes]: Yes

Track-ball support: whether there is a trackball on the device.
HW. trackball [Yes]: Yes

Keyboard support: whether the device has a QWERTY keyboard.
HW. keyboard [Yes]: Yes

DPAD support: whether the device has DPAD keys
HW. DPAD [Yes]: Yes

GSM Modem support: whether there is a GSM Modem in the device.
HW. gsmmodem [Yes]: Yes

Camera support: whether the device has a camera.
HW. Camera [No]:

Camera support: whether the device has a camera.
HW. Camera [No]: Yes

Maximum horizontal camera pixels
HW. Camera. maxhorizontalpixels [640]: 854

Maximum vertical camera pixels
HW. Camera. maxverticalpixels [480]: 480

GPS support: whether there is a GPS in the device.
HW. GPS [Yes]: Yes

Battery support: whether the device can run on a battery.
HW. Battery [Yes]: Yes

Accelerometer: whether there is an accelerometer in the device.
HW. Accelerometer [Yes]: Yes

Audio Recording support: whether the device can record audio
HW. audioinput [Yes]: Yes

Audio Playback support: whether the device can play audio
HW. audiooutput [Yes]: Yes

SD card support: whether the device supports insertion/removal of virtual SD cards.
HW. sdcard [Yes]: Yes

Cache partition support: whether we use a/cache partition on the device.
Disk. cachepartition [Yes]: Yes

Cache partition size
Disk. cachepartition. Size [66 MB]: 100 MB

Created AVD ''Android-sdk-15'' Based on Android 1.5

In this way, we have created a 1.5-based AVD. I 'd like to understand the specific meaning above. Next we can test Android emulator:

$ Emulator @ android-sdk-15-show-Kernel

In this way, you can start Android emulator:


The-show-Kernel Parameter is added to print the android kernel information on the terminal.

Next we configure eclipse to support Android SDK:

Open eclipse, help-> Software Updates-> available software, and click
Add site, enter
Http://dl-ssl.google.com/android/eclipse/

Then install. After that, you can create an Android Application on Eclipse.

Reference: http://blog.mcuol.com/User/weishuangbo/Article/13320_1.htm

 

If you still cannot install ADT plugin and encounter the error message like this:
"
Cannot complete the install because one or more required items cocould
> Not be found.
> Software
Being installed: Android development tools
> 0.9.5.v200911191123-20404 (COM. Android. Ide. Eclipse. ADT. feature. Group
> 0.9.5.v200911191123-20404)
> Missing requirement: Android development tools
> 0.9.5.v200911191123-20404 (COM. Android. Ide. Eclipse. ADT. feature. Group
> 0.9.5.v200911191123-20404) requires 'org. Eclipse. WST. xml. UI 0.0.0'
> It cocould not be found
"
There may be miss some Plugins in your eclipse
1. Go to "help/install new software...
2. Add http://download.eclipse.org/releases/galileo/ to the update sites list (strange it's not installed by default on Ubuntu)
3. From there, install WST (use the filter box to find the package)
4. Restart eclipse
5. Go back to "help/install new software..." and install the android ADT as explained on the android website.

OK, till here you may have a breath, an android SDK with Eclipse IDE has been successfully installed in you Ubuntu system.
Reference: http://blog.chinaunix.net/u3/104357/showart_2132259.html

 

Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml appears when installing Android SDK for Linux

There are some differences between installing Android AVD manager on Linux and Windows:

In Linux, you can switch to the android SDK/tools directory and run

1. $ Cd ~ /***/Android-SDK/tools

2. $ Android // you can open Android AVD Manager

 

When Android sdk2.0 is installed with AVD manager in Ubuntu today, the following error occurs:
Failed to fetchurl https://dl-ssl.google.com/android/repository/repository.xml
As prompted, check the settings:
Force https: //... sources to be fetched using http ://...,
And click Save & apply, but the following message is still displayed:
Failed to fetchurl https://dl-ssl.google.com/android/repository/repository.xml
The force function is ineffective when it should be set. I searched the following online. Many people have encountered similar problems, and the android official team has not proposed a solution, but a method was found in Google group (see http://groups.google.com/group/android-developers/browse_thread/thread/63a44163a8d07cd9? PLI = 1 ):
You can set an environment variable in the command line before running the android update SDK:
Export gdk_native_windows = true
Then, execute the android update SDK, set force https: //... sources to be fetched using http: //..., and click Save & apply.
In fact, I later found that no environment variables can be set. The main reason for the above problem is that I checked force ...... After that, click the Save & Apply button with the mouse. The UI does not respond to the click event. A very simple method is to press enter because the check box is complete, the Default Option Button is save & apply. Press enter directly. If it is not the default button, you can click it to change it to the selected button, and then press Enter.

Refer to: http://blog.csdn.net/JiangBo_HIT/archive/2009/11/24/4860996.aspx

 

After some effort, Ah, finally can run Hello Android, congratulate you!

 

 

 

 

Install Android ndk on Ubuntu 10.04

1. Download The ndk package ,:

Http://www.ideasandroid.com/android/sdk/android-ndk-r4-linux-x86.zip

Http://dl.google.com/android/ndk/android-ndk-r4b-linux-x86.zip

2. Unzip the package to the/home/ideasandroid/dev/directory.

After decompression directory structure:/home/ideasandroid/dev/android-ndk-r4


3. Configure the path (this step can also be omitted, but the path/home/myleft/android-ndk-r4b/ndk-build will be added later ):

Run sudo gedit/etc/profile on the command line and add the following content to the end of the file:

# Set ndk env

Ndkroot =/home/myleft/android-ndk-r4b

Export Path = $ ndkroot: $ path

After saving, restart the machine. Now the android ndk has been installed.

4. Compile the sample project:

Run the command CD/home/myleft/android-ndk-r4b/samples/Hello-JNI to enter the root directory of the sample project, and then run the following command:

Ndk-build

You will see the system will compile the libhello-jni.so

Now that the sample project has been compiled, You can import the hello-JNI project to ADT for further testing.

Http://love.myleft.org/home.php? MoD = Space & uid = 21 & Do = Blog & id = 601.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.