Start a new topic

Android Camera FlashLight

Android Camera FlashLight

Hello everybody.

I want to know how can I turn on/off the flashlight from the device camera, using a button.

I use this code, but it isn't work:

camera =;

Parameters p = camera.getParameters();





PD: Extra question, Why when I have my wikitude app in background, I can't open the Native Camera app?



Hi Sergio,
Do you know that you can activate the flashlight with a JS API that we have introduced with the SDK 4.0?

I talked with our Android developer and he told me that you need to call the activity life cycle methods like onCreate, onPostCreate, ... on your ArchiteView object. 
You can find a example on what you need to do exactly in the



Turns the device flashlight on or off. Use the isFlashlightAvailable property to check if the device has a flashlight or not. If the device has no flashlight and the property is set to true, this will have no effect.

Default: false



true if the device has a flashlight, false otherwise. 

Note that the following permissions are required on Android: 

<uses-permission android:name="android.permission.FLASHLIGHT"/> 
<uses-feature android:name="" />

Default: false


Best regards


Thanks again Andreas, really I didn't know for use the flashlight with JS.

But in documentation I don't find the example o the instructions for do that.

Can you help me please?

Login or Signup to post a comment