Creating the Sample Application
A simple Android application will illustrate deployment on an Android device. So, using Eclipse, create a new Android project.
Versioning
Beginning with version 1.0 of the Android SDK, the AndroidManifesl.xml file of every Android applications include the android:versionCode and android:versionName attributes:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.myapp"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".Main"
android:name ="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The android:versionCode attribute represents the version number of your application. For every revision you make to the application, increment this value by 1 so that you can programmatically differentiate it from its previous version. This value is never used by the Android system, but it's useful as a way to obtain the version number of an application. The android:versionName attribute contains versioning information that is visible to the users. It should contain values in the following format: <major>.<minor>.<point>.If you are planning to publish your application on the Android Market, the AndroidManifest.xml file must have the following attributes:
- android:versionCode
- android:versionName
- android:name
- android:name
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.learn2develop.MyKillerApp"
android:versionCode="1"
android:versionName="1.0.0">
<uses-sdk android:minSdkVersion="5" />
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".MyKillerApp"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
As the current version of the SDK is 1.0, there is no necessity for you to specify the minimum version of the SDK required.