How can permissions be added to an Android export?
In detail do I have to add the following to the generated AndroidManifest
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
I solved it.
I added the following line to my Type declaration in the .uxl
<Require Android.Manifest.RootElement="<uses-permission android:name="android.permission.CAMERA"/>" />
Well you beat me to it! This will work for uxl.
For those using bindings you can do the following:
Given that I can do this for
<Extensions Backend="CPlusPlus" Condition="Android">
<Require AndroidManifest.Permission="android.permission.NFC" />
Is there a better (neater) way I can add
<uses-feature> than the method suggested above?
<uses-feature android:name="android.hardware.nfc.hce" android:required="false"/>
Looking at other libraries, it seems there is a better way. Here’s more details on what else you can do to Manifest.
@Iain actually it’s best not to set permissions that way as then you can end up with issues on android versions >6. See here for details https://www.fusetools.com/docs/native-interop/android-permissions