"HelloAndroid" - First Android Project

This section provides a tutorial example on how to create the first Android project, HelloAndroid, using the 'android' command. Java source file and resource files are automatically created.

Now let's try to create a new Android application project called: HelloAndroid. I want the project home folder to be \herong\HelloAndroid and source code package to be com.herongyang.

Go to a command window and run the following commands to create the project, HelloAndroid:

C:\>cd \herong
C:\herong>\local\android-sdk-windows\tools\android create project \
   --package com.herongyang --activity HelloAndroid \
   --target android-22 --path .\HelloAndroid

Created project directory: C:\herong\HelloAndroid
Created directory C:\herong\HelloAndroid\src\com\herongyang

Added file C:\herong\HelloAndroid\src\com\herongyang\HelloAndroid.java
Created directory C:\herong\HelloAndroid\res
Created directory C:\herong\HelloAndroid\bin
Created directory C:\herong\HelloAndroid\libs
Created directory C:\herong\HelloAndroid\res\values
Added file C:\herong\HelloAndroid\res\values\strings.xml
Created directory C:\herong\HelloAndroid\res\layout
Added file C:\herong\HelloAndroid\res\layout\main.xml
Created directory C:\herong\HelloAndroid\res\drawable-xhdpi

Created directory C:\herong\HelloAndroid\res\drawable-hdpi
Created directory C:\herong\HelloAndroid\res\drawable-mdpi
Created directory C:\herong\HelloAndroid\res\drawable-ldpi
Added file C:\herong\HelloAndroid\AndroidManifest.xml
Added file C:\herong\HelloAndroid\build.xml
Added file C:\herong\HelloAndroid\proguard-project.txt

The output from the command tells me that:

Remember that the "--target 2" identifies the "Android 5.1.1 Platform" in my Android SDK environment

See next tutorial on how to modify the Java source code generated by the "android" tool.

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

 Creating Android Project with "android" Command

 Listing Target Android Platforms

"HelloAndroid" - First Android Project

 "HelloAndroid.java" - First Android Java Code

 "ant debug" Command and Build Error

 Building the Debug Binary Package

 Installing the Debug Binary Package

 Running the Debug Binary Package

 Android Application Package (APK) Files

 Android Debug Bridge (adb) Tool

 Android 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

 Archived Tutorials


 Full Version in PDF/EPUB