This article mainly involves creating Android projects, updating existing projects, and ant compilation projects.
I. Prepare ant
Download from ANT Official Website
Http://ant.apache.org/
Ant environment Configuration:
1. Decompress the ant package to the local directory.
2. Set ant_home in the environment variable to your installation directory.
3. Add ant_home/bin to the path of your system environment.
Ii. Use ant
1. First, check whether the environment change of the Android-SDK is added to the path. In this way, you can run the android command in any directory. Otherwise, you need to switch to the Android-SDK \ tools directory.
2. Use Android create to create a project
Parameter description:
-K/-- package: namespace (package name)-A/-- name Project Name
-P/-- path project-T indicates the version number of the Target Platform
C: \ Documents ents and Settings \ Administrator> Android Create Project-K com. Android. Ta
NK-a tank-T 4-p f: \ Tank
List the corresponding IDs of platforms of different versions. Android. Bat list targets/Android list
C: \ Documents ents and Settings \ Administrator> Android. Bat list targets
3. Android update updates existing projects
For an existing Android project, we can update it (modify the version of the platform) to automatically add ant configuration files such as build. xml.
C: \ Documents ents and Settings \ Administrator> Android update project -- name tank-T 11
-P f: \ Tank
4. Ant parameter Introduction
* Debug: Signature construction with debugging
* Release: Build an applicationProgramThe generated APK must be signed before it can be published.
* Install: Install and debug the build package to the running simulator or device;
* Reinstall
* Uninstall
When you use the ant command, you can enter the project directory, or ant debug buildfile: e: \ mylib \ Android \ androidant \ myboardcastreciver \ build. xml
/**
* @ Author Zhang xingye
* Email: xy-Zhang # 163.com
* Android development advanced group:278401545
*
*/