Simple android example

Source: Internet
Author: User
Tags intl

 

1. Installation

1. Download the android SDK, which is in windows. Decompress the package to the local directory.

Figure 1

For the SDK decompress directory, you can add the tools directory to the path of the system.

: Http://developer.android.com/intl/zh-CN/sdk/1.5_r3/index.html

Note: 1 SDK comparison, 200 M. wait patiently

2. We will specify the android SDK installation location in Eclipse, so we can decompress it here.

2. Use Eclipse 3.4 for development, So download Eclipse 3.4. I am using Eclipse3.4.2's J2ee version.

: Http://www.eclipse.org/downloads/packages/release/ganymede/sr2

3. Download Android Development Tools (ADT ). Is an Eclipse plug-in. Decompress the package and copy it to the dorpsins directory under the Eclipse installation directory.

Http://developer.android.com/intl/zh-CN/sdk/adt_download.html I downloaded is
ADT-0.9.1.zip

Note: You can refer to the http://developer.android.com/intl/zh-CN/sdk/1.5_r3/installing.html#installingplugin to install, but the problem is that Eclipse update installation is too slow, so I chose to install manually.

2. Compile a program

For android development, IBM has a series of articles: http://www.ibm.com/?works/cn/opensource/theme/android.

The first section describes android development and contains a subprogram to download the source code of the program. Prepare to import in Eclipse.

Download Source Code address: http://download.boulder.ibm.com/ibmdl/pub/software/dw/opensource/os-android-devel-FlashLight.zip

1. Restart Eclipse to install the ADT plug-in. If the installation is successful, you can see the interface shown in figure

Figure 2

Three new icons are displayed in the toolbar, one of which is in the mobile phone shape. Have you seen them?

2. Introduce the downloaded engineering source code to eclipse

3. Configure the location of the andriod SDK and go to the Preferences page of Eclipse. The Android tab is displayed in Window --> Preferences.

Figure 3

Specify the Android SDK installation directory in SDK Location

4. Configure Android Virtual Devices. To run the Android program on a computer, you must configure a Virtual device. We can use the Android Virtual Devices Manager provided by the plug-in to help us configure it.

Configuration method: In Figure 2, you must see the mobile phone icon and click it to start Android Virtual Devices Manager.

Figure 4

Specify Name and Target in Create AVD. There is no limit on Name. Target is selected as the 1.5 option. Click Create AVD to complete the creation.

5. When running the program, eclipse may report a compilation error after the project is introduced. If it is caused by the R. java file, ignore it.

Click project to go to the run configuration page and configure it. 5. Figure 6

Figure 5

Figure 6

After the configuration is complete, run. Wait a moment, eclipse will start emulator (a simulator), 7.

Figure 7

At this point, your configuration is successful, and you must wait patiently (this takes some time). When figure 8 is displayed, the program runs successfully.

Figure 8

3. References:

1 http://code.google.com/intl/zh-CN/android/ google Homepage

2 http://www.javaeye.com/wiki/topic/382270 in java eye about AVD questions post

One of the 3 http://www.ibm.com/developerworks/cn/opensource/os-android-devel/index.html IBM Series

4 http://blog.csdn.net/k7sem/archive/2007/11/15/1886871.aspx a platform elementary tutorial

5 http://developer.android.com/intl/zh-CN/index.html android Developers

Source: simple android example-Alf column-CSDN blog

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.