Outdated: Building the Debug Binary Package

This section provides a tutorial example on how to build the debug binary package of the HelloAndroid application using the Apache Ant tool and the build file.

This tutorial was based on Android SDK R17 with Android 4.0.3 and left here as a reference.

Let me try to build the "debug" binary output first.

C:\>cd \herong\HelloAndroid
C:\herong\HelloAndroid>\local\apache-ant-1.8.3\bin\ant debug
Buildfile: C:\herong\HelloAndroid\build.xml

-set-mode-check:

-set-debug-files:

-set-debug-mode:

-debug-obfuscation-check:

-setup:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\herong\HelloAndroid\bin\res
     [echo] Gathering info for HelloAndroid...
    [setup] Android SDK Tools Revision 17
    [setup] Project Target: Google APIs
    [setup] Vendor: Google Inc.
    [setup] Platform Version: 4.0.3
    [setup] API level: 15
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup] API<=15: Adding annotations.jar to the classpath.
    [setup]
    [setup] ------------------
    [setup] WARNING: No minSdkVersion value set. Application will 
            install on all Android versions.

-build-setup:
    [mkdir] Created dir: C:\herong\HelloAndroid\gen
    [mkdir] Created dir: C:\herong\HelloAndroid\bin\classes

-pre-build:

-code-gen:
     [echo] ----------
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 3 source files to 
            C:\herong\HelloAndroid\bin\classes

-post-compile:

-obfuscate:

-dex:
      [dex] Converting compiled files and external libraries into 
            C:\herong\HelloAndroid\bin\classes.dex...

-crunch:
   [crunch] Crunching PNG Files in source dir: 
            C:\herong\HelloAndroid\res
   [crunch] To destination dir: C:\herong\HelloAndroid\bin\res
   [crunch] Processing image to cache: C:\herong\HelloAndroid\res...
   [crunch]   (processed image to cache entry C:\herong\HelloAndr...
   [crunch] Processing image to cache: C:\herong\HelloAndroid\res...
   [crunch]   (processed image to cache entry C:\herong\HelloAndr...
   [crunch] Processing image to cache: C:\herong\HelloAndroid\res...
   [crunch]   (processed image to cache entry C:\herong\HelloAndr...
   [crunch] Crunched 3 PNG files to update cache

-package-resources:
     [aapt] Creating full resource package...

-package:
[apkbuilder] Current build type is different than previous build: 
             forced apkbuilder run.
[apkbuilder] Creating HelloAndroid-debug-unaligned.apk and signing it 
             with a debug key...

-post-package:

-do-debug:
 [zipalign] Running zip align on final apk...
     [echo] Debug Package: C:\herong\HelloAndroid\bin\Hello
Android-debug.apk
[propertyfile] Creating new property file: C:\herong\HelloA
ndroid\bin\build.prop
[propertyfile] Updating property file: C:\herong\HelloAndro
id\bin\build.prop
[propertyfile] Updating property file: C:\herong\HelloAndro
id\bin\build.prop
[propertyfile] Updating property file: C:\herong\HelloAndro
id\bin\build.prop

-post-build:

debug:

BUILD SUCCESSFUL
Total time: 7 seconds

By looking at the output, I think my HelloAndroid binary package, HelloAndroid-debug-unaligned.apk, is ready to be tested on the Android emulator.

Last update: 2012.

Table of Contents

 About This Book

 Installing JDK 1.8 on Windows System

 Installation of Android SDK R24 and Emulator

 Installing Apache Ant 1.9 on Windows System

 Developing First Android Application - HelloAndroid

 Android Application Package (APK) Files

 Android Debug Bridge (adb) Tool

 Android File Systems

 Android 4.0.3 File Systems

 AboutAndroid - Application to Retrieve System Information

 android.app.Activity Class and Activity Lifecycle

 View Objects and Layout Resource Files

 Using "adb logcat" Command for Debugging

 Build Process and Package File Content

 Building Your Own Web Browser

 Android Command Line Shell

 Samsung Galaxy Tab 3 Mini Tablet

 USB Debugging Applications on Samsung Tablet

 Android Tablet - LG-V905R

 USB Debugging Applications on LG-V905R Tablet

 Android Phone - LG-P925g

 USB Debugging Applications on LG-P925g Phone

Outdated Tutorials

 Outdated: Downloading and Installing JDK 1.7

 Outdated: Downloading and Installing Android SDK R17

 Outdated: Running Android SDK Manager

 Outdated: Installing Android Platform 4.0.3 and Libraries

 Outdated: Verifying Android Platform Installation

 Outdated: Creating Android Virtual Device (AVD)

 Outdated: Launching Android Emulator in AVD Manager

 Outdated: Android Emulator Built-in Applications

 Outdated: Android Emulator Built-in Web Browser

 Outdated: Downloading and Installing Apache Ant 1.8

 Outdated: "HelloAndroid" - First Android Project

Outdated: Building the Debug Binary Package

 Outdated: Installing the Debug Binary Package

 Outdated: Running the Debug Binary Package

 Outdated: Rebuild the Debug Binary Package

 Outdated: Redefine Text in Resource Files

 Outdated: Installing Android PDF Viewer APK File

 Outdated: Copy PDF File to Android Emulator's File System

 Outdated: Installing Adobe Reader APK File

 Outdated: "adb shell" - Remote Shell Interface

 Outdated: "adb push" and "adb pull" Commands

 References

 PDF Printing Version