Android development-Environment setup and HelloWorld and androidhelloworld
Android development has recently started, with no foundation starting from 0.
First, you should know the official website of Android development:
Http://developer.android.com/index.html
The tutorial on the website itself is excellent. It is recommended that you read this article from scratch:
Http://developer.android.com/training/index.html
Let's get to the point where we will start to introduce environment setup and HelloWorld.
1. Establish the environment
1. Download the SDK, reference: http://developer.android.com/sdk/index.html
Note:
1. If you do not have Eclipse, you can download the integrated packages that contain Eclipse, SDK, and ADT plug-ins.
2. If you already have Eclipse, select: on the website, and then download:
2. After the download is complete, you need to download the response software package through SDK Manager: refer to the article Http://developer.android.com/sdk/installing/adding-packages.html.
3. Download ADT plug-in: Reference: http://developer.android.com/sdk/installing/installing-adt.html
Complete Chinese Reference: http://hi.baidu.com/wlj1013/item/3e6080351168b9302f0f815c
2. HelloWorld
Reference: http://developer.android.com/training/basics/firstapp/index.html
Problems encountered during the process:
1. A solution that does not display the Android SDK Manager and Android Virtual Device Manager icons after installing the ADT plug-in eclipse is restarted
2. Create the Second Activity mentioned in:
In the window that appears, open theAndroid folder and select Android Activity. Click Next.
In fact, you should choose:Android Activity with fragment.
3. When the ActionBarActivity is created, the reference to the v7 package is missing.
Specific reference can refer to: https://developer.android.com/tools/support-library/setup.html
However, be sure to note that: you must ensure thatThe android-support-v7-appcompat is in the same workspace as your project, and the path cannot contain Chinese characters.
4. The program still reports an error:
The method add (int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, Fragment, String)
The reason is the class file reference error, solution: http://stackoverflow.com/questions/15517786/the-method-addint-fragment-string-in-the-type-fragmenttransaction-is-not-app
After setting up the android development environment, the first HELLOWORLD program has two errors:
Beqoqewtyq4636534270yxovpaantn8763162877 is good. You can try it.
Rrgaprsmns51752720862012-2-7 in the afternoon 10: 40: 44xh hold ndt medicine q? B \ policyc, m ~ Yes. Let's see where the SDK path can be stored. You only need to configure the environment variables in Eclipse. After Eclipse is configured, there will be an AVD icon in the toolbar.
During Android development, helloworld is run and the virtual machine can be started. The console has no output and the program cannot run.
First, you need to add some windows for viewing logs and driver information. Click window-> show view-> other, select android in the pop-up window, add two windows: devices and logcat, and select devices in the window in the lower-right corner of myeclipse to see if there is no virtual machine information, if you start the virtual machine and the window is blank, your adb is not linked to the virtual machine, and the android program console will usually print a prompt that the driver cannot be found, if there is driver information, check whether there is log output in the logcat window. If there is no log information, restart myeclipse again and check logcat again, if not, the VM is not connected to myecplise. Check whether the environment has any problems.