How to Compile an Android Project on Windows
After you create an Android application, you must compile the code to create the files necessary to run on a cellular device. You build and compile the application from the Windows command line. The Android development environment has its own compiler, but you must add the compiler directory to the Windows environment variables before compiling the software.
Instructions
-
-
1
Click the Windows "Start" button and type "cmd" in the search text box. Press "Enter" to open the MS-DOS command line.
-
2
Type the following code to add the Java compiler directory to the Windows environment variable:
set JAVA_HOME=c:\java\<jdkdir>
Replace the "<jdkdir>" with the directory that contains your Android development software.
-
-
3
Compile the application. Use the following statement to compile your program:
ant debug file.java
Replace "file.java" with your own Android development package file.
-
4
Run the compiled code. To check for any bugs, type the following statement to run the application in the Droid emulator:
adb install file.apk
Replace "file.apk" with your own compiled application.
-
1