Declaring Features

Your camera implementation works great now. One more task remains: Tell potential users about it. When your app uses a feature like the camera – or near-field communication, or any other feature that may vary from device to device – it is strongly recommended that you tell Android about it. This allows other apps (like the Play Store) to refuse to install your app if it uses a feature the device does not support.

To declare that you use the camera, add a <uses-feature> tag to your AndroidManifest.xml (Listing 16.18).

Listing 16.18  Adding a <uses-feature> tag (manifests/AndroidManifest.xml)

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.bignerdranch.android.criminalintent" ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.