Tuesday, 29 January 2013

Build Command Line | Android Tutorial pdf

Command Line

For developers not using Eclipse, in your terminal, change into the Skeleton/Now directory, then run the following command:
ant clean install
The Ant-based build should emit a list of steps involved in the installation process, which look like this:
Buildfile: /home/some-balding-guy/projects/Skeleton/Now/build.xml
[setup] Android SDK Tools Revision 8
[setup] Project Target: Google APIs
[setup] Vendor: Google Inc.
[setup] Platform Version: 2.1-update1
[setup] API level: 7
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]
[setup] WARNING: No minSdkVersion value set. Application will install on all
Android versions.
[setup]
[setup] Importing rules file: tools/ant/main_rules.xml
clean:
[delete] Deleting directory /home/some-balding-guy/projects/Skeleton/Now/bin
-debug-obfuscation-check:
-set-debug-mode:
-compile-tested-if-test:
-dirs:
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/some-balding-guy/projects/Skeleton/Now/bin
[mkdir] Created dir: /home/some-balding-guy/projects/Skeleton/Now/gen
[mkdir] Created dir: /home/some-balding-guy/projects/Skeleton/Now/bin/classes
-pre-build:
-resource-src:
[echo] Generating R.java / Manifest.java from the resources...
-aidl:
[echo] Compiling aidl files into Java classes...
-pre-compile:
compile:
[javac] /opt/android-sdk-linux/tools/ant/main_rules.xml:361: warning:
'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to
false for repeatable builds
[javac] Compiling 2 source files to /home/some-baldingguy/
projects/Skeleton/Now/bin/classes
-post-compile:
-obfuscate:
-dex:
[echo] Converting compiled files and external libraries into /home/somebalding-
guy/projects/Skeleton/Now/bin/classes.dex...
-package-resources:
[echo] Packaging resources
[aapt] Creating full resource package...
-package-debug-sign:
[apkbuilder] Creating Now-debug-unaligned.apk and signing it with a debug key...
debug:
[echo] Running zip align on final apk...
[echo] Debug Package: /home/some-balding-guy/projects/Skeleton/Now/bin/Nowdebug.
apk
BUILD SUCCESSFUL
Total time: 4 seconds

Note the BUILD SUCCESSFUL at the bottom – that is how you know the application compiled successfully.
When you have a clean build, in your emulator or device, open up the application launcher, typically found at the bottom of the home screen:
                                                   Android emulator application launcher
Notice there is an icon for your Now application. Click on it to open it and see your first activity in action. T o leave the application and return to the launcher, press the "BACK button", located to the right of the [MENU] button, and looks like an arrow pointing to the left.

No comments: