Day 1.1 android manifest file - 12092012


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Day 1.1 android manifest file - 12092012

  1. 1. Mr. Pritesh N. Patel Assistant Professor MCA ISTAR –V.V. Nagar 1Mr. Pritesh N. Patel
  2. 2. Enforcing Application System Requirement  Used to specify any system requirements necessary for application to run properly.  For e.g. application might required that handset have GPS, compass or camera.  It also specify that application relied upon Bluetooth APIs available within Android SDK and version.  This information is used while installing the .apk.  Also used to filter application by features. 2Mr. Pritesh N. Patel
  3. 3.  What we can configure…  Android SDK version supported by application.  Android platform features used by application.  Android Hardware configuration required by application.  Screen Size and pixel densities supported by application.  External libraries that are linked to apllication. 3Mr. Pritesh N. Patel
  4. 4.  Targeting Specific SDK version  Android devices run different versions of android platform.  Cheap device may run older version while expensive device may run latest version.  We can specify version in AMF using…  <uses-sdk> tag and have following attribute  minSdkVersion Specify lowest API level to support for backward compatibility.  targetSdkVersion Specify optimum API level support.  maxSdkVersion Specify highest API level support for future compatibility. 4Mr. Pritesh N. Patel
  5. 5. Android SDK versions and there API levels 5Mr. Pritesh N. Patel
  6. 6. Example <uses-sdk android:minSdkVersion=“1” android:targetSdkVersion=“3” android:maxSdkVersion=“5” />  We rarely defined maxSdkVersion.  It is used to specify forward compatibility. 6Mr. Pritesh N. Patel
  7. 7. Enforcing Application Platform Requirement  Android devices have different hardware and software configurations. For e.g.  Some device may have built-in keyboards and may be software keyboard.  Some device may support 3D graphic or other may be little or none.  Android manifest file has several informational tags for flagging the system features and hardware configurations supported by an our android application. 7Mr. Pritesh N. Patel
  8. 8. Specifying Supported Input Methods <uses-configuration> tag is used to specify input methods and application supports. <uses-configuration android:reqHardKeyboard=“true” android:reqTouchScreen=“finger” /> <uses-configuration android:reqHardKeyboard=“true” android:reqTouchScreen=“stylus” /> 8Mr. Pritesh N. Patel
  9. 9.  Syntax <uses-configuration android:reqFiveWayNav=["true"|false"] android:reqHardKeyboard=["true“|"false"] android:reqKeyboardType=["undefined" | "nokeys" | "qwerty”| "twelvekey"] android:reqNavigation=["undefined" | "nonav" | "dpad” |"trackball“|"wheel"] android:reqTouchScreen=["undefined" | "notouch" | "stylus" |"finger"] /> 9Mr. Pritesh N. Patel
  10. 10. Specifying Required Device features <uses-feature> tag is used to specify android device feature which our application supports. The feature may be multitouch support or camera feature. E.g. <uses-feature android:name=“android.hardware.sensor.light” /> <uses-feature android:name=“android.hardware.sensor.proximity” /> 10Mr. Pritesh N. Patel
  11. 11. Specifying support Screen Size <supports-screens> tag is used to specify android device screen type which our application supports.  Screen Type in term of size may be small, normal and large.  Screen Type in term of pixel density may be low, medium and hidh E.g. <supports-screens android:smallScreens=“true” android:normalScreens=“true” android:largeScreens=“true” android:anydensityScreens=“true” /> 11Mr. Pritesh N. Patel
  12. 12. Syntax 12Mr. Pritesh N. Patel
  13. 13. Working with external libraries <uses-library> tag is used to specify additional packages used by our application apart from default packages like E.g. <uses-library android:name=“com.sharedlibrary.shareStuff” /> It is generally used to link Google APIs. 13Mr. Pritesh N. Patel
  14. 14. Registering Activities 14  Each activity within the application must be defined within android manifest file in <activity> tag.  It is mandatory to specify activity in a manifest file otherwise it will not launch or run. E.g. <activity android:name=“HelloWorldActivity“ android:icon="@drawable/icon" android:label="@string/app_name" /> While using package <activity android:name=“.HelloWorldActivity” /> or <activity android:name=“mypack.Sample.HelloWorldActivity” /> Mr. Pritesh N. Patel
  15. 15. Syntax 15Mr. Pritesh N. Patel
  16. 16. 16Mr. Pritesh N. Patel