I am trying to show a live preview of the rear facing camera in Codename One. I use for that the native interface (I am targetting Android first).
To allow my app t
In the past, you add the permission you want to your manifest and then it is requested when your user attempts to install your app. As of Android 6.0+, this has changed. Now you can just request a permission when your app needs it for the first time. After the user grants you permission, you don't need to ask again next time. Some benefits of this include keeping your user aware of why you need specific permissions and not requesting permissions that you don't actually need.
You can read more about how to implement it here: https://developer.android.com/training/permissions/requesting.html
There is no way to use a phones camera without asking for permission at some point.
You need to add the following build hint:
android.xpermissions=<uses-permission android:name="android.permission.CAMERA" android:required="false"/>
You can also add this to the cn1lib so it is injected automatically.