Dizzy death, write ppt write to 11:30, I just want to quietly write code, write a woolen ppt, write finished also said no, let rewrite, head is big, elder brother now just want to do a coder only, now or fish, Man, don't say, can't first day digging pits not fill.
Getting Started
Building Your First APP
Creating an Android Project
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/48/wKiom1R93f2DmLA0AAFNot-yDHc809.jpg "title=" Adt-firstapp-setup.png "alt=" Wkiom1r93f2dmla0aafnot-ydhc809.jpg "/>
Create a project that can not be more familiar, from top to bottom is the app name, project name, package name, Minimum SDK version, highest version, use of the compiled version, app theme
Of course, it can be created with the command line.
Enter under tools/path
Android list targets
You can print out the available target SDK versions.
If you are creating a project, use:
Android Create Project--target <target-id>--name myfirstapp--path <path-to-workspace>/myfirstapp-- Activity mainactivity--package Com.example.myfirstapp
Running Your application very sleepy ...
This lesson is mainly about running apps on real machines and simulators, we'll first specify Sdkversion
<manifest xmlns:android= "Http://schemas.android.com/apk/res/android" ... > <uses-sdk android:minsdkversion = "8" android:targetsdkversion= "/>" ...</manifest>
And then say something about the directory structure of Android project
-
src/
-
Directory for your app ' s main source files. By default, it includes a Activity class that runs when your app is launched using the app icon.
-
res/
-
Contains several sub-directories for app resources. Here is just a few:
-
drawable-hdpi/
-
Directory for drawable objects (such as bitmaps), that is designed for high-density (hdpi) screens. Other drawable directories contain assets designed for other screens densities.
-
layout/
-
Directory for files that define your app's user interface.
-
values/
-
Directory for other various XML files, contain a collection of resources, such as string and color definitions.
src/
The app's source folder, which is the default, includes an activity that runs when you click on the app icon.
res/
Contains a number of app resources. These include:
drawable-hdpi/
A Directory of Drawable objects (such as bitmaps), designed for hdpi screens, and other drawable directories that contain resources designed for other screen densities
layout/
The user interface directory for the app.
values/
A directory of various other XML files that contains a collection of resources, such as string and color definitions.
The next step is how to run the app on a real machine.
-
Load drivers for Android devices
-
Turn on the phone's test mode
You can also use the command line to run
-
Change directories to the root of your Android project and execute:
Ant Debug
-
Make sure the Android SDK platform-tools/ directory are included in your PATH environment variable, then execute:
ADB install bin/myfirstapp-debug.apk
-
On your device, locate myfirstactivity and open it.
That's how you build and run your Android app on a device! To-start developing, continue to the next lesson.
To run on the emulator:
Run on the Emulator
Whether you ' re using Eclipse or the command line, to run your app in the emulator you need to first create anandroid Virtu Al Device (AVD). An AVD are a device configuration for the Android emulator this allows you to model different devices.
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
Figure 1. The AVD Manager showing a few virtual devices.
To create an AVD:
-
Launch the Android Virtual Device Manager:
-
In Eclipse, click Android Virtual Device Manager 650) this.width=650; "Src="/e/u261/themes/default/images/spacer.gif " Style= "Background:url ("/e/u261/lang/zh-cn/images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= " Spacer.gif "/>from the toolbar.
-
From the command line, change directories to and <sdk>/tools/ execute:
Android AVD
-
In the Android Virtual Device Manager Panel, click New.
-
Fill in the details for the AVD. Give it a name, a platform target, an SD card size, and a skin (HVGA is default).
-
Click Create AVD.
-
Select the new AVD from the Android Virtual Device Manager and click Start.
-
After the emulator boots up, unlock the emulator.
To run the app from Eclipse:
-
Open one of your project's files and click Run 650) this.width=650; "Src="/e/u261/themes/default/images/spacer.g If "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/> from the toolbar.
-
In the Run as window, appears, select Android application and click OK.
Eclipse installs the app on your AVD and starts it.
Or to run your app from the command line:
-
Change directories to the root of your Android project and execute:
Ant Debug
-
Make sure the Android SDK platform-tools/ directory are included in your PATH environment variable, then execute:
ADB install bin/myfirstapp-debug.apk
-
On the emulator, locate myfirstactivity and open it.
That's how to build and run your Android app on the emulator! To-start developing, continue to the next lesson.
Steal a lazy, paste directly ...
The AVD here means the simulator Android virtual device
This article is from "Jack's Footsteps" blog, make sure to keep this source http://jack326162646.blog.51cto.com/7640742/1585753
Android official tutorial from zero opener (one)