If you want to learn all the steps needed to develop an application on Android, it's best to do this on the command line, and below you can throw away which slowly eclipse, and then build the following Auto.cmd file, run Auto.cmd, your computer D : \work\njh1 folder will produce a snjh.apk file, which will be automatically installed on your phone and run automatically, which requires 13 steps, of course, the environment for JDK1.7,ADT22.3,SDK api-17,d: Disk to create folder work, When these environments are well-equipped, they will work and add the following statement to the PATH variable in the system environment
D:\eclipse-jee-juno-SR2-win32\sdk\tools;
D:\eclipse-jee-juno-SR2-win32\sdk\platform-tools;
D:\eclipse-jee-juno-SR2-win32\sdk\build-tools\19.0.0;
C:\Program Files\java\jdk1.7.0_45\bin;
Download the Apkbuilder.bat file into the Tools folder of the SDK
Suppose the Android SDK folder is under the SDK folder in D:\eclipse-jee-juno-SR2-win32
=========== Below is the Auto.cmd script file ====================================================================
REM Work Area D:\work
REM project Folder D:\njh1
REM Bag COM.NJH2
rem main form name mainactivity
REM Engineering NJH
REM Signature Package file snjh.apk
REM 1. Setting up the environment
Set Lib1=d:\eclipse-jee-juno-sr2-win32\sdk\platforms\android-17\android.jar
D:
Cd\work
REM 2. Building the Project
Call Android Create Project-p njh1-n njh-k com.njh2-a mainactivity-t "ANDROID-17"
CD NJH1
REM 3. Compiling resource files
mkdir Gen
AAPT p-f-m-j gen-s res-i%lib1%-M Androidmanifest.xml
REM 4. Compiling Java files
Javac-encoding utf-8-target 1.7-bootclasspath%lib1%-D bin Src\com\njh2\*.java Gen\com\njh2\r.java
REM 5. Generate Dex Run files
Call DX--dex--output=bin\classes.dex bin
REM 6. Generate Precompiled AP_ Package
mkdir assets
AAPT Package-f-S res-i%lib1%-A assets-m androidmanifest.xml-f BIN\NJH.AP_
REM 7. Generate APK file
Call Apkbuilder d:\work\njh1\bin\Njh.apk-v-u-z d:\work\njh1\bin\Njh.ap_-F D:\WORK\NJH1\BIN\CLASSES.DEX-RF d:\work\ NJH1\SRC-NF D:\WORK\NJH1\LIBS-RJ D:\work\njh1\libs
REM 8. Generating a signature KeyStore file
Keytool-genkey-alias njh.keystore-keyalg rsa-validity 1000-keystore njh.keystore-dname "CN=com.njh2,OU=Njh,O=localh OST,L=W,ST=W,C=CN "-keypass 123456-storepass 123456
REM 9. Generate Signature APK file
Jarsigner-verbose-digestalg sha1-sigalg md5withrsa-keystore Njh.keystore-signedjar SNjh.apk d:\work\njh1\bin\ njh.apk Njh.keystore
REM 10. Remove Phone program COM.NJH2
ADB uninstall COM.NJH2
REM 11. Install mobile App snjh.apk
ADB install-r d:\work\njh1\SNjh.apk
REM 12. Start the phone program COM.NJH2
ADB shell am start com.njh2/. Mainactivity
REM 13. Stop the ADB service
ADB kill-server
Cd..
Cmd