accessing android device LED through unity

Hi Unity developers!

I am trying to find a way to turn ON and OFF my android device camera flash LED for my augmented reality app (using metaio SDK). I searched a lot on different forums and blog but found nothing. I am a noob in unity and am coding in C#.

Guys, I am stuck with this issue since 3-4 days. It would be a great help if you could help me sort out this LED thingy.

Thanks in advance! :slight_smile:

Unity does not provide any function for accessing the flash LED.
Maybe metaio can help you:

http://helpdesk.metaio.com/questions/16814/android-cloud-plugin-accessing-torch-led-on-camera

Hi Malzbier!

Thanks for the link. I tried this code out. But there is no function like “IMetaioSDKAndroid” in metaio. I am using metaioSDK 5.0.1.

public void toggleTorch(View v) {

if (isLightOn) {

IMetaioSDKAndroid.startTorch(this);

Log.i(TAG, “torch is turn off!”);
isLightOn = false;

} else {

Log.i(TAG, “torch is turn on!”);

IMetaioSDKAndroid.stopTorch(this);
isLightOn = true;
}
}

I have faced this thing many times, many of the functions mentioned on doxygen are not accessible for unity (or I am missing something, as I said I’m a noob).
If you have solved it could you shed some light on this issue?

Thanks!

Did you solve this?
I’m stuck in the same problem, and I can not find IMetaioSDKAndroid.startTorch() too.

If you did some other way, can you share it ?

thanks in advance !