Wednesday, February 29, 2012

Android API Difference between 3.0 and 4.0 OS - Ice Cream Sandwich

API Difference between Honeycomb and Ice Cream Sandwich

The overall difference between API Levels 13 and 14 is approximately 3.95%. The table below lists the numbers of program elements (packages, classes, constructors, methods, and fields) that were added, changed, or removed. The table includes only the highest-level program elements — that is, if a class with two methods was added, the number of methods added does not include those two methods, but the number of classes added does include that class.

Type Additions Changes Removals Total
Packages 5 48 0 53
Classes and Interfaces 90 192 0 282
Constructors 19 2 0 21
Methods 265 94 29 408
Fields 405 34 16 455
Total 804 370 45 1219

Here I found the list of removed classes, methods and interfaces in Android SDK 4.0.

  • freeze ()
  • GPU 
  • hide ()
  • obtain (long, long, int, int, int[], PointerCoords[], int, float, float, int, int, int, int)
  • readData
    • type  (float[]) in android.renderscript.AllocationAdapter 
    • type  (int[]) in android.renderscript.AllocationAdapter 
  • setAlpha (float)
  • setDataSource (String)
  • setFlags (int, int)
  • setFreezeTint (int)
  • setLayer (int)
  • setMatrix (float, float, float, float)
  • setOrientation (int, int)
  • setPosition (int, int)
  • setSize (int, int)
  • setSummaryOff
    • type  (int) in android.preference.CheckBoxPreference 
    • type  (CharSequence) in android.preference.CheckBoxPreference 
  • setSummaryOn
    • type  (int) in android.preference.CheckBoxPreference 
    • type  (CharSequence) in android.preference.CheckBoxPreference 
  • setTransparentRegionHint (Region)
  • show ()
  • subData (int, FieldPacker)
  • subData1D
    • type  (int, int, byte[]) in android.renderscript.AllocationAdapter 
    • type  (int, int, float[]) in android.renderscript.AllocationAdapter 
    • type  (int, int, int[]) in android.renderscript.AllocationAdapter 
    • type  (int, int, short[]) in android.renderscript.AllocationAdapter 
  • subData2D
    • type  (int, int, int, int, float[]) in android.renderscript.AllocationAdapter 
    • type  (int, int, int, int, int[]) in android.renderscript.AllocationAdapter 
  • subElementData (int, int, FieldPacker)
  • unfreeze ()

Android Ant Build - Android Automated Build

I am trying to write very simple tutorial to build Android APK using Ant tool.  To build APK using eclipse is very easy, normally developer use it but in some specially senario you need to build APK using command line. 

Setup Environment 

1. JDK :Install JDK and set JAVA_HOME 
2. Android SDK :Download Android Platforms using Android SDK
3. Ant :Install Ant and set ANT_HOME 
Now, Take your any project developed in eclipse or any other IDE. I am taking project from eclipse.
Step 1 : Copy your project folder from Eclipse Workspace to the Desktop
Step 2 : Create keystore file using keytool command
1keytool -genkey -v -keystore <file name="">.keystore -alias <alias name=""> -keyalg RSA -keysize 2048 -validity 365</alias></file>
Step 3 : Copy keystore file in your project folder
Step 4 : Create "" file using any text editor, this file contain information about keystore file. create your keystore file `
Step 4 : Create "" file, If you have created project using eclipse, this file will available, If not create file with following content, change api level as per your project.
01# This file is automatically generated by Android Tools.
02# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
04# This file must *NOT* be checked in Version Control Systems,
05# as it contains information specific to your local configuration.
08# location of the SDK. This is only used by Ant
09# For customization when using a Version Control System, please read the
10# header note.

Step 6 : Create "build.xml" with following content, change project name "MyAndroidProject".
1<project default="help" name="MyAndroidProject">
2    <property file="">
3    <property file="">
4    <loadproperties srcfile="">
5    <fail message="sdk.dir is missing. Make sure to generate using 'android update project' or to inject it through an env var" unless="sdk.dir">
6    <import file="${sdk.dir}/tools/ant/build.xml">
Step 7 : Now, It's time to start build, open terminal, go to the project folder and execute following command
1ant release
Step 8 : You APK file will be at following path.
1Project Folder -> bin -> MyAndroidProject-release.apk


Create following files in your Project Folder and execute "ant release" command
  1. keystore
  5. build.xml
For more information you can refer following link