Android environment combination and development

Source: Internet
Author: User

The first time I played Android development, I summarized the environment collocation and the first program so that new users can quickly find a solution to similar problems.
I. Environment matching
Jdk installation and configuration are unnecessary. coffee is hot everywhere on the Internet.
Eclipse
All versions above 3.3 can be used
I'm using the latest version 3.7: http://mirrors.ustc.edu.cn/eclipse/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-win32.zip
 
Android sdk
Download to the official website is better (http://www.android.com/) there are a lot of things worth seeing,

I downloaded the second one. Click "Install". After the installation is complete, you do not need to start the manager, configure the environment variables, and skip this step without going online.
ADT plugin
Start eclipse click help ---> Install New Software ----> click work with after add name fill in: ADT plugin location after entering: http://dl-ssl.google.com/android/eclipse/ click next after a while, there will be four files, select the first two. If the network speed is not strong, you need to be patient. After the completion, the system prompts restart eclipse. Then click window --> preferences. Then, the android on the left is filled with the android root directory, for example, F: \ Android \ android-sdk. A message is displayed, indicating that platform cannot be found. Click OK.
Then click window --> Android SDK and ADT Manager --> Available packages ---> there are four options for Android Repository:

The numbers behind different versions are different. These files are required.
One step to install accetp all is to update all four files. It takes some time, mainly because my network speed is not very good. China Telecom, China Mobile, China Unicom, why doesn't Netcom want to speed up this? Moreover, since China Unicom's merger and acquisition of China Netcom, the network speed of our dormitory has been decreasing, and the network fee has become more and more expensive. The monopoly is not good.
After that, you can write our first java program.
 
It is easier to create an AVD first
After configuration
Emulator-avd and the avd name you created
If this problem occurs: emulator window was out of view and was recentred
In eclipse, click window ----> Android SDK and ADT Manager ---> Virtual Devices
Select the created avd point edit and

The number can be correctly written at will.
 
The first hello world Program:
You don't need to say anything about the project. When you enter the package, at least two layers will be prompted.
Program:
Import android. app. Activity;
Import android. OS. Bundle;
Import android. widget. TextView;
Public class hello extends Activity {
/** Called when the activity is first created .*/
@ Override
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
 
// SetContentView (R. layout. main );
TextView TV = new TextView (this );
TV. setText ("Hello World !!! ");
SetContentView (TV );
}
}
In AndroidMainfest. xml
Android: name = ". Hello" here is the class name.
Then run the command.
Next I made a mistake, that is, I could not see my program.
Stay on the same interface, because I use sdk3.2. After the welcome interface is opened, slide and unlock it before you can access your program. I am dizzy. I have been searching for it online for a long time. I don't know why.
Everything is hard at the beginning. If I write something wrong, I hope I can give some advice. This will be helpful to everyone. If this article is helpful to you, this is not a waste of time. If you have any questions, leave a message and learn from each other.
 
 
Author: "netsky"

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.