Android development path (1) Build a development environment using helloworld routines

Source: Internet
Author: User

Reprinted please note this article from: programming artist poechant csdn blog http://blog.csdn.net/poechant

I am mainly engaged in end-to-end development after weekdays. I am recently interested in Mobile Application Layer Development. I will try it and record it here. Thank you for your criticism.

1. Download the android SDK

SDK of each platform version: http://developer.android.com/sdk/index.html

2. Install eclipse

Each platform version: http://www.eclipse.org/downloads.

There are multiple versions of Linux, windows, and Mac OS. I downloaded the 64 bits version of Mac OS at the following address:

Http://www.eclipse.org/downloads/download.php? File =/technology/EPP/downloads/release/indigo/SR1/eclipse-jee-indigo-SR1-macosx-cocoa-x86_64.tar.gz

Eclipse installation is simple, as long as it is simply decompressed. It is best to configure the workspace used for development before decompression.

3. Configure the eclipse Android SDK Environment

In eclipse, select "install new software" in "help" on the menu bar ". Input:

Https://dl-ssl.google.com/android/eclipse/

As shown in:

Next, download and install the package. However, during the installation process, try to select Version 2.2 or version 2.1, which is too high, and the compatibility of the developed applications will be poor. Currently, mainstream application development usually uses these two versions. For poechant, Version 2.2 and version 4.3 are selected. One is used to develop general-purpose applications and one is used to try new features of the new version of Android.

In the eclipse menu bar, select "preference" under "Eclipse" (for Windows, select "preference" under "window"), and then select "android ", in the SDK location, browse to the root directory of the SDK you downloaded. For example:


4. Create an AVD

What is AVD for the most Android fish? AVD is an android virtual device, which is an android virtual device used to simulate Android devices.

In the window menu, select AVD manager and click New on the right:


After filling in the information, you can create it.


5. Create a hello World Application

Create an android project, that is, file-New-project-android project:


Then, enter some basic information about the application and the SDK version. The following directories and files are displayed:



6. Write the hello World Program

package com.sinosuperman.android;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloWorldActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView tv = new TextView(this);        tv.setText("Hello World");        setContentView(tv);    }}

7. Run Hello World

Right-click your application root directory and select Run as-android application from the menu below:

The following window is displayed:


Soon the following screen will appear:

If the machine you are using has good performance, the following picture may appear soon:

Drag the lock on the screen to the right side, and the helloworld program you have written will appear:

Reprinted please note this article from: programming artist poechant csdn blog http://blog.csdn.net/poechant

-

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.