Android (Android) mobile phone development environment build Helloword

Source: Internet
Author: User
Tags file size

Because I made an Android wallpaper site, so we suddenly thought of the Android phone development, and here's a look at my Android environment configuration article.

This contact with the environment, everything is very strange, spent an afternoon, took a lot of detours, but eventually the environment to build. Here's a summary of the steps to build:

First step: Install the Java SDK
The JDK "Jdk-6u25-windows-i586.exe" used in this article environment allows readers to download the latest installer on the official Oracle website. (Reference address: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html). The installation step is no longer described in detail, this said more meaningless.
Step Two: Install Eclipse
This article uses eclipse is "Eclipse-jee-indigo-sr2-win32.zip", the reader needs to download themselves, the file size of 212MB or so.
Step Three: Install ANDROID-SDK
Official reference Document (E): http://developer.android.com/sdk/installing.html
First download back to install the package "Android-sdk_r17-windows.zip" to extract it to the D:program filesandroid-sdk-windows directory.
Fourth step: Install an Android ADT
Also downloaded from http://developer.android.com for the SDK "Adt-17.0.0.zip" installation package for Windows Eclipse plugin, the latest version may be newer than this one. Cover directly to the root directory of the Eclipse installer.
Fifth step: Online updates download the Android SDK Library
Open first, after opening, the following figure shows:. Select a specific version of the SDK download back. Depending on your network speed may need to wait 3 minutes to a few hours, such as my speed is slower, download 2 hours. The Android version of my choice is, click Install packages to start online
Download the installation.
Sixth step: Create AvD
Note: Students with Android phone can skip directly, look at the seventh step (AVD is very CPU-intensive, I said I can't stand it).
What the hell is AVD? "Android Simulation Device", is this small robot, open and choose "NEW" to create an Android simulation device, what is the simulation device? is actually an Android phone simulator. Enter the emulation device name and platform and the CPU type, and then you can create it. As shown in figure:
Seventh Step: Android Phone (real machine) installation
1. First you need to download a suitable USB driver on your mobile phone network, which is more than my Lenovo A500 I will automatically install the driver with the "Pea pod". (This step is necessary, otherwise the PC will not recognize your device, you will not be able to connect to the USB debug mode)
2. Open the following switch on your phone: System setup--> application--> development-->USB debugging. Select it.
Eighth step: Create the first Android project: Helloword

1. Start, create an Android project: Helloandroid. Add a Class "Helloandroid", the source code is as follows

The code is as follows Copy Code

Package com.example.helloandroid;
Import android.app.Activity;
Import Android.os.Bundle;
Import android.widget.*;
public class Helloandroid extends activity {
public void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
TextView TV = new TextView (this);
Tv.settext ("Hello, Android");
Setcontentview (TV);
}
}

2. Click the button and double-click the Android application in the Run Configuration dialog box to set the following:

(Note: True machine debugging mode Please select the Red circle box option, AVD Debugger Please select the emulation device below.) )

I use the real machine, so I will automatically appear the following dialog box, select My Device

Click OK, my phone screen can already see "Hello,word", what about you?

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.