Presentation is loading. Please wait.

Presentation is loading. Please wait.

Android Mobile Application Development

Similar presentations


Presentation on theme: "Android Mobile Application Development"— Presentation transcript:

1 Android Mobile Application Development
Manifest file And Resource Lecture Five Assistant Lecturer Mustafa Ghanem Saeed Computer Science Department College Of Science Cihan University - Sulaimaniyah

2 Manifest Every application must have an AndroidManifest.xml file in its root directory. The manifest file provides essential information about your app to the Android system, which the system must have before it can run any of the app's code. For example, the listing contains the package name, the minimum required SDK and the target SDK, etc... AndroidManifest.xml: This is the Android definition file. It contains information about the Android application such as minimum Android version, permission to access Android device capabilities such as internet access permission, ability to use phone permission, etc.

3 Manifest in APK

4 Manifest Structure The code snippet below shows the basic general structure of the manifest file:

5 List of Information contained in Androidmanifest.xml
Activities and Intents Permission SDK attributes Application Version

6 Manifest Permission Android contains a permission system and predefined permissions for certain tasks. Every application can request required permissions. For example, an application may declare that it requires network access. It can also define new permissions.

7 Runtime permissions The two most important protection levels : Normal permissions are permissions which are deemed harmless for the users privacy or the operation of other applications. For example, the permission to set the time zone. Normal permission are automatically granted to the application. Dangerous permissions affect the users private information, or could potentially affect his data or the operation of other application. For example, the ability to read the users contact data. Dangerous permissions must be granted by the user at runtime to the app. Android 6.0 Marshmallow (API 23) introduced a new runtime permission model. If your application targets Android 6.0, you must use the new permissions model.

8 How to Ask for Permission?

9 Resources Resources are the additional files and static content that your code uses, such as bitmaps, layout definitions, user interface strings, and more.. These resources are always maintained separately in various sub-directories under res/ directory of the project. Android 6.0 Marshmallow (API 23) introduced a new runtime permission model. If your application targets Android 6.0, you must use the new permissions model.

10 Some Resource Types Drawable Resources Layout Resource Menu Resource
Define various graphics with bitmaps or XML. Saved in res/drawable/ and accessed from the R.drawable class. Layout Resource Define the layout for your application UI. Saved in res/layout/ and accessed from the R.layout class. Menu Resource Define the contents of your application menus. Saved in res/menu/ and accessed from the R.menu class. String Resources Define strings, string arrays, and plurals (and include string formatting and styling). Saved in res/values/ and accessed from the R.string, R.array, and R.plurals classes. Style Resource Define the look and format for UI elements. Saved in res/values/ and accessed from the R.style class. Android 6.0 Marshmallow (API 23) introduced a new runtime permission model. If your application targets Android 6.0, you must use the new permissions model.

11 Android R.java file Android R.java is an auto-generated file by aapt (Android Asset Packaging Tool) that contains resource IDs for all the resources of res/ directory. If you create any component in the activity_main.xml file, id for the corresponding component is automatically created in this file. Note: If you delete R.jar file, android creates it automatically. Android 6.0 Marshmallow (API 23) introduced a new runtime permission model. If your application targets Android 6.0, you must use the new permissions model.

12 Android R.java file Example
Android 6.0 Marshmallow (API 23) introduced a new runtime permission model. If your application targets Android 6.0, you must use the new permissions model.

13 Important Questions? Define AndroidManifest.xml ? Ans : Slide 2
Draw Information contained in Androidmanifest.xml? Ans : Slide 5 What is Manifest Permission end explain protection levels in Runtime permissions ? Ans : Slide 6,7 Draw figure illustrate how to ask for Permission in android Application ? Ans : Slide 8 Define Resource in android and list only four Resource Types? Ans : Slide 9, 10 Explain Android R.java file? Ans : Slide 11

14 Questions? Discussion?


Download ppt "Android Mobile Application Development"

Similar presentations


Ads by Google