B4A Class Torch class

Hello,
this is a simple B4A class to make easy the use of the built-in led of our beloved android devices.
Tested on various devices up to android 8.
The goal is to use the led as a Torch.

The code is commented and comes with an example.

It uses inline java and depends on:
-Javaobject lib
-Phone lib

Cheers!
Davide
 

Attachments

  • torch.zip
    11.3 KB · Views: 785

Pitag

Member
Licensed User
Longtime User
Hi DavideV

the example works like expected!

as TargetSDKVersion is set to 21, who wants to use this code for SDK > 22 will have to deal with RuntimePermission. I can confirm that the code works also with SDK > 22.

Pitag.
 

DavideV

Active Member
Licensed User
Longtime User
Hi DavideV

the example works like expected!

as TargetSDKVersion is set to 21, who wants to use this code for SDK > 22 will have to deal with RuntimePermission. I can confirm that the code works also with SDK > 22.

Pitag.

Yes, you are right. I kept things simple for the example, but of course you must deal with camera permissions.
 

hatzisn

Expert
Licensed User
Longtime User
Hi David, complimenti, nice job. I have seen your video about Interactive Maps in YouTube. Which program do you use for screen capturing? I 've noticed that it also captures the point where you touch the screen... I use AirDroid for screen capturing but it does not capture the point where you touch the screen. Would it be possible to tell me the name of the program you use? Thanks in advance...
 

DavideV

Active Member
Licensed User
Longtime User
Hi David, complimenti, nice job. I have seen your video about Interactive Maps in YouTube. Which program do you use for screen capturing? I 've noticed that it also captures the point where you touch the screen... I use AirDroid for screen capturing but it does not capture the point where you touch the screen. Would it be possible to tell me the name of the program you use? Thanks in advance...

Hello hatzisn, it's a bit O.T., anyway about the touches look at the attached images:
devOptions.png

Then I recorded the phone screen using the Built-in feature of B4A, under Tools->Videocapture
 

hatzisn

Expert
Licensed User
Longtime User
Thank you David. I have seen this before in Android apps recording videos and have asked the same question multiple times (in YouTube of course). Yet no one until now has answered. Thank you very much for your response and for the analytical presentation you have provided.
 

hatzisn

Expert
Licensed User
Longtime User
Top