I have a custom camera application and I need to be able to turn flash on(torch mode actually)/off.
What kind of permission do I need in this case?
1.Only
According to android developers permission-group:
Note that this element does not declare a permission itself, only a category in which permissions can be placed. See the
<permission>
element for information on declaring permissions and assigning them to groups
You would need two permissions Manifest.permission:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
to be able to access the camera and the flashlight.
And you would need to declares the hardware features that is used by the application (camera and flash) Features Reference:
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
android:required
indicates whether phones not having these hardware can install your application or not.
On your third point, I think you have a type because uses-permission
tag can not be used with android.hardware...
<uses-permission android:name="android.hardware.camera.flash"/>
Maclir answer is showing all the detail of permission required to use camera and its flash light. you can also use these two permission to use flashlight in your application.
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" />