Here we have a sample intent filter block that might be found within an

Here we have a sample intent filter block that might

This preview shows page 28 - 35 out of 47 pages.

Here, we have a sample intent filter block that might be found within an <activity> block. This intent filter definition uses a predefined action called VIEW , the action for viewing particular content. It also handles Intent objects in the BROWSABLE or DEFAULT category and uses a scheme of geoname so that when a URI starts with geoname:// , the Activity with this intent filter can be launched to view the content.
Image of page 28

Subscribe to view the full document.

Registering Other Application Components All application components must be defined within the Android manifest file. In addition to activities, all services and broadcast receivers must be registered within the Android manifest file. Services are registered using the <service> tag. Broadcast receivers are registered using the <receiver> tag. Content providers are registered using the <provider> tag. Services and broadcast receivers use intent filters. If your application acts as a content provider, it must declare this capability using the <provider> tag.
Image of page 29
Working with Permissions Android has been locked down so that applications have limited capability to adversely affect operations outside their process space. Instead, Android applications run within the bubble of their own virtual machine: With their own Linux user account And related permissions
Image of page 30

Subscribe to view the full document.

Registering Permissions Your Application Requires Android applications have no permissions by default. Instead, permissions for shared resources or privileged access —whether it’s shared data, such as the Contacts database, or access to underlying hardware, such as the built-in camera must be explicitly registered within the Android manifest file.
Image of page 31
Registering Permissions Your Application Requires (Cont’d) For devices running versions of Android prior to Marshmallow 6.0 API Level 23, these permissions are granted when the application is installed. For devices running Android Marshmallow 6.0 API Level 23 and newer, permissions with a level of PROTECTION_NORMAL , and some with PROTECTION_SIGNATURE , are granted at installation. Those permissions with a PROTECTION_DANGEROUS must be requested and verified at runtime.
Image of page 32

Subscribe to view the full document.

Registering Permissions Your Application Requires (Cont’d) <uses-permission android:name =” android.permission.READ_CONTACTS ”/> <uses-permission android:name="android.permission.WRITE_CONTACTS"/> This XML excerpt for the preceding Android manifest file defines a permission using the <uses-permission> tag to gain read and write access to the Contacts database.
Image of page 33
Requesting Permissions at Runtime Android Marshmallow introduced a new permission model allowing users to install your application and to accept your application’s permissions once interaction occurs with the features that require them. This new permission model is important because it reduces the amount of friction permissions may have caused in the past, such as users abandoning the installation of your application because they are not comfortable accepting a particular permission.
Image of page 34

Subscribe to view the full document.

Image of page 35
  • Summer '16

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes