B Brian Dean Well-Known Member Licensed User Longtime User Sep 4, 2022 #1 I want to turn on the phone LED (ie "torch mode") but without opening the camera. I have found a few examples on the forum but most are eight or ten years old and appear to require full camera access. I found what would have been a perfect answer here but it does not work for my phone (Pixel 4a). All solutions seem to require Java code and that is beyond my ability. I suppose that I could open the camera and cover it with an opaque panel. Is there a better way?
I want to turn on the phone LED (ie "torch mode") but without opening the camera. I have found a few examples on the forum but most are eight or ten years old and appear to require full camera access. I found what would have been a perfect answer here but it does not work for my phone (Pixel 4a). All solutions seem to require Java code and that is beyond my ability. I suppose that I could open the camera and cover it with an opaque panel. Is there a better way?
Solution agraham Sep 4, 2022 Try this. It's a mod to your 'perfect answer' and it works targeting SDK 30 on my Pixel 4a.
BlueVision Well-Known Member Licensed User Longtime User Sep 4, 2022 #2 Tricky theme indeed. I tried to manage that a longer time ago. Success? Well, it depends somehow also on the hardware used. In my opinion it would be much better to separate the led-light from the camera. Waiting for this since ages. I think this is the point. As long as the torch is connected to the camera from the point of software, you will need camera access. Have you seen this posted by Johan? That was the solution for me, but worked also not on all phones I own. Upvote 0
Tricky theme indeed. I tried to manage that a longer time ago. Success? Well, it depends somehow also on the hardware used. In my opinion it would be much better to separate the led-light from the camera. Waiting for this since ages. I think this is the point. As long as the torch is connected to the camera from the point of software, you will need camera access. Have you seen this posted by Johan? That was the solution for me, but worked also not on all phones I own.
B Brian Dean Well-Known Member Licensed User Longtime User Sep 4, 2022 #3 Have you seen this posted by Johan? Click to expand... Yes - It was one of the first that I found. But I probably did not look at it as closely as I should have, thinking that it was maybe out-of-date and I would be finding something better. I will go back and look at it again. Thanks for reminding me. Upvote 0
Have you seen this posted by Johan? Click to expand... Yes - It was one of the first that I found. But I probably did not look at it as closely as I should have, thinking that it was maybe out-of-date and I would be finding something better. I will go back and look at it again. Thanks for reminding me.
agraham Expert Licensed User Longtime User Sep 4, 2022 #4 Try this. It's a mod to your 'perfect answer' and it works targeting SDK 30 on my Pixel 4a. Attachments Torch2.zip Torch2.zip 11.7 KB · Views: 527 Upvote 0 Solution
B Brian Dean Well-Known Member Licensed User Longtime User Sep 4, 2022 #5 Try this. Click to expand... Thanks - it works fine. I spend two days scrabbling around doing "due diligence" before posting a question, but when I do post I get a solution in less than an hour. That tells you something about this forum. Upvote 0
Try this. Click to expand... Thanks - it works fine. I spend two days scrabbling around doing "due diligence" before posting a question, but when I do post I get a solution in less than an hour. That tells you something about this forum.
Johan Schoeman Expert Licensed User Longtime User Sep 4, 2022 #6 agraham said: Try this. It's a mod to your 'perfect answer' and it works targeting SDK 30 on my Pixel 4a. Click to expand... Works on my Samsung device too. Upvote 0
agraham said: Try this. It's a mod to your 'perfect answer' and it works targeting SDK 30 on my Pixel 4a. Click to expand... Works on my Samsung device too.
Jmu5667 Well-Known Member Licensed User Longtime User Jan 10, 2023 #7 agraham said: Try this. It's a mod to your 'perfect answer' and it works targeting SDK 30 on my Pixel 4a. Click to expand... What did you mod in this, the class ? I am having an issue with battery drain after using this class and closing the torch. Upvote 0
agraham said: Try this. It's a mod to your 'perfect answer' and it works targeting SDK 30 on my Pixel 4a. Click to expand... What did you mod in this, the class ? I am having an issue with battery drain after using this class and closing the torch.
agraham Expert Licensed User Longtime User Jan 10, 2023 #8 I didn't mod the flashTorch class. I just asked for Flashlight permission in Activity_Create. Upvote 0
Jmu5667 Well-Known Member Licensed User Longtime User Jan 10, 2023 #9 agraham said: I didn't mod the flashTorch class. I just asked for Flashlight permission in Activity_Create. Click to expand... Ok, thanks Andrew Upvote 0
agraham said: I didn't mod the flashTorch class. I just asked for Flashlight permission in Activity_Create. Click to expand... Ok, thanks Andrew