Android Application Development lecture 1: Setting up an android development environment in Ubuntu Linux

Source: Internet
Author: User

Step 1: Install the dependent package, mainly to build a Java environment

Search openjdk in the search, tag the openjdk-6-jdk and openjkd-6-lib, and other dependencies are automatically resolved. Then install the Selected Package.

Step 2: Install android

Go to the android developer website (http://androidappdocs.appspot.com/sdk/index.html), download the latest Android SDK, and decompress the downloaded package. Because eclipse is associated with this SDK, decompress it to a suitable directory and grant other users the read permission.

The package I downloaded is a android-sdk_r04-linux_86.tgz. The folder obtained after decompression is a android-sdk-linux_86. Then go to the tools directory under the android-sdk-linux_86 directory.

Create a 2 GB sdcard (defined by the size) in this directory and name it sdcard1. The command to create sdcard1 is:

Java code
  1. ./Mksdcard 2048 M sdcard1
    ./Mksdcard 2048 M sdcard1

    This process takes one or two minutes.

    Then, open the android SDK and AVD manager and download the corresponding package. The command to open Android SDK and AVD manager is:

    Java code
    1. $ Sudo./android
    $ Sudo./android

    Select available packages, and then select the package: SDK platform Android 2.0.1, API 6, revision 1 and Google APIS by Google Inc., Android API 3, revision 3. If you cannot select or refresh is not available, create a file named androidtool. cfg in the android-sdk-linux_86 directory with the content: sdkman. Force. Http = true. In the settings option of Android SDK and AVD manager
    Force https: //... sources to be fetched using http. Try again. It should be okay.

    Next, create a virtual Android device in the tools directory and run the following command:

    Java code
    1. ./Android create AVD-N devicetest-T 2
    ./Android create AVD-N devicetest-T 2

    Devicetest is the name of the android virtual device you want to create.

    After that, some settings will be available. You can select one as prompted.

    Step 3: Run

    In the tools directory, run the command (root permission is required ):

    Java code
    1. #./Emulator @ devicetest-sdcard sdcard1
    #./Emulator @ devicetest-sdcard sdcard1

    Configure eclipse
    After the android SDK is installed, open eclipse and choose help> install new software...

    In the open dialog box, work with: Enter the https://dl-ssl.google.com/android/eclipse/ and it will automatically download available plug-ins. Select all the items you need (three in total), click next, and then download and install them.

    After the plug-in is installed, the android project appears in window-> preferences. Here, select the location of the android SDK directory that you just downloaded and installed, the development environment you have installed is listed below. Click OK to save the settings.

    An android SDK and AVD manager will be added to the window menu. This is the same as the android SDK tool. You can select the development environment here, here we will use it to add a new simulator. In virtual devices, select new, open the create new Android Virtual Device window, name it, select the system running the simulator, simulate the SD card size, and click OK to add a simulator.

    In this way, the android development environment under Linux is built.

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.