Hi,
I think there's a function of the iPhone which flash on the back LED. Maybe this has inspired me.
Anyway, I have searched for a way to something like that. As my phone has got a front LED (flash light for photos), I thought it would be nice to flash it on when something happens. Perhaps when I come home. So, I have found out that the front LED can be flashed on when you use the action to take a photo, choose front camera and the suitable setting of the flash.
But I don't want to take a photo. Especially, because you can't choose the pattern it should flash up. Moreover, I don't need a picture .
So what I am looking for: a way to include the front flash which should light up. If possible, the ability to set a pattern (something like that with the vibration; pause, vibrate, pause, vibrate...) because it always takes some time to activate and deactivate the LED. So, you don't need to set actions like pauses and flashs. But that could be a bit hard to implement I think. For now it would be enough just to able to control the front flash. Thanks in advance.
Regards,
Mar
Front LED/flash
Moderator: Martin
Re: Front LED/flash
Sorry to bump old thread. But I just see the implementation of the dual flash app. A quick search show how to use java to turn on the front flash using Camera2 API : https://stackoverflow.com/questions/419 ... h-of-phone
Don't know if this work on all phone, but I have activated Camera2 API at my RN5 whyred, RR 6.2 Oreo 8.1. Using the script below, I can turn on/off the flash for back and front flash.
Change 1 (front flash) to 0 for back flash. True and false is to turn on and off.
It will be much better if this is implemented directly into current action "Flashlight". Add option to choose back or front camera (if the phone support front flash). Will be nice also if we have the ability to set a pattern. So we can make it blink or act like a morse code.
Don't know if this work on all phone, but I have activated Camera2 API at my RN5 whyred, RR 6.2 Oreo 8.1. Using the script below, I can turn on/off the flash for back and front flash.
Code: Select all
cm = callJavaMethod(getContext(), "android.content.Context", "getSystemService(java.lang.String)", "camera");
callJavaMethod(cm, "android.hardware.camera2.CameraManager", "setTorchMode(java.lang.String, boolean)", 1, true)
It will be much better if this is implemented directly into current action "Flashlight". Add option to choose back or front camera (if the phone support front flash). Will be nice also if we have the ability to set a pattern. So we can make it blink or act like a morse code.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Front LED/flash
I've tried this script on my new phone wich has a little weak monochromatic led (that seems to be turned on just from pre installed apps),
and it's seems working good as a workaround for those who has the same problem.
It's necessary to build some "cicle" to turn the flash on /off and something else wich stops it automatically.
I hope this will not cause a huge battery drain.
I agree too, the implementation of this function into the "flashlight" action would be great!
and it's seems working good as a workaround for those who has the same problem.
It's necessary to build some "cicle" to turn the flash on /off and something else wich stops it automatically.
I hope this will not cause a huge battery drain.
I agree too, the implementation of this function into the "flashlight" action would be great!