In a project prepared by the SDK tools , you can create .apk with ant debug to get started.
You can also learn how to use the SDK tools directly and automate what you learn using Makefiles or scripts. Terminal IDE, a market application that provides a development environment on the device, does this without ant, or does, or more involved build systems, so there are scripts in its sample projects that directly call javac, dx, aapt. For example, one of my build scripts on this system:
set -x P=net/rapacity/wizardry rm src/$P/R.java mkdir -m 770 -p dist || exit mkdir -m 770 -p build/classes || exit aapt p -f -M AndroidManifest.xml -F build/resources.res \ -I ~/system/classes/android.jar -S res/ -J src/$P || exit cd src for F in \ sokoban2/{Maze,TileView,MazeActivity}.java \ R.java Maze.java EmptyActivity.java {emptyquiet,gadgets,sokoban}/Maze{,Activity}.java \ ; do echo $F > ~/tmp/.remake javac -d ../build/classes $P/$F 2> ~/tmp/javac.out ../redcat ~/tmp/javac.out grep error ~/tmp/javac.out && exit done cd .. ( cd build/classes; dx --dex --verbose --no-strict --output=../core.dex net ) || exit apkbuilder dist/core.apk -u -z build/resources.res -f build/core.dex || exit signer dist/core.apk core-debug.apk
All that fusses with redcat, javac.out, etc., is to abort the assembly with an error (javac unhelpfully returns 0 regardless of success), and also allows you to quickly try again to compile the last attempt to check if the errors are fixed. ant, maven, even the wise use of make, will provide you with this stuff.
Julian fondren
source share