AndroidManifest – permissions

One important step we need to do is to review the permissions requested in the AndroidManifest.xml file. Asking only for the permissions needed is a good and recommended practice, as your app may be analyzed and your publication may be revoked if you request more than truly required permissions.

In our Favors app, this is what the manifest permissions look like:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.handson">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
...
</manifest>

Besides permissions, there is also the uses-feature tag (see Chapter 10, Accessing Device Features from the Flutter App), which can limit installation on devices with a specific feature available (this is not our case), so it's important to review it too.

The android.permission.INTERNET permission is used by the Flutter framework with the Observatory tool, so, if your application works offline, you can remove this during release builds (this is not our case, as we use Firebase technologies).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.8.42