Start a new topic

Flash light issues

Flash light issues

We are trying to add a new button that turns on the flash light view in an activity that contains the architect view. We are not able to create a new instance of the Camera class to turn on the flash light due to the fact that the architect view is already using the Camera class. We are aware that we can turn on the flash light from javascript however this needs an internet connection. We need to be able to turn on the Flash lights nativly? Any sugestions for this issue? Is there any function to turn on the Falsh light from the architect view via Java not Java script.


Here is a sample function on the toggeling of the flashlight:

function toggleFlashlight()
    if ( AR.context.hardware.flashlightAvailable ) {
        if (false == state) {
            AR.context.hardware.flashlight = true;
            state = true;
        } else {
            AR.context.hardware.flashlight = false;
            state = false;
    } else {
        alert('no flashlight available');

I hope this helps. Greetings


Hi Nicola

Thank you for your prmot response.

In our case, we our using wikitude studio, the files are not local, so your proposed code requires an internet connection  to be able to turn on the Flash Light.

Is there any other way to turn on the Flash Light without the need for an internet connection (when we are using wikitude studio)


Thank You

Login or Signup to post a comment