[Resolved] Ketai LED Flash Mode Torch (Flashlight)
in
Android Processing
•
5 months ago
Hi all.
I'm learning coding and specialy Processing (2.0b8). For my first Android App, I need to execute the phone flashlight (i9100).
I thought Ketai librarie was the solution but the phone flash don't agree with me.
I try something like that (mainly cut/paste from ketai page):
This code doesn't works when I Ioad the app for the first time but works if I press the Home phone button then reload the app. If I do the same (Home button then app), there is a crash !
How can this happen ? Exit and reload make flashlight work ! But it works only one time ...
Thanks for your help.
I'm learning coding and specialy Processing (2.0b8). For my first Android App, I need to execute the phone flashlight (i9100).
I thought Ketai librarie was the solution but the phone flash don't agree with me.
I try something like that (mainly cut/paste from ketai page):
- import ketai.camera.*;
- KetaiCamera cam
- cam = new KetaiCamera(this, 320, 240, 24);
- if (ZoneFlash()) {
- FlashOnOff = ! FlashOnOff;
- if (cam.isFlashEnabled()) {
- cam.disableFlash();
- } else {
- cam.enableFlash();
- }
- }
This code doesn't works when I Ioad the app for the first time but works if I press the Home phone button then reload the app. If I do the same (Home button then app), there is a crash !
How can this happen ? Exit and reload make flashlight work ! But it works only one time ...
Thanks for your help.
1