How to control LED on/off of my android phone ?

basicall

Member
Licensed User
Longtime User
Hi, I could not find which LIB I should include in my project to control LED of my android phone. I am a newbie.:sign0104: Anyone could give me a little hint ?
 

basicall

Member
Licensed User
Longtime User

Hi ZJP,

Thanks for your prompt reply and warm help. I have a question here:

1, The LED I mentioned is a indication light for example when the battery is low it will on/off with red color when I got missed call it will on/off with blue color.

2, I checked that url you posted and I could find "Flashlight" in that camera library. But I think indication LED is not the same thing as Flashlight. So, I think indication LED could not be controled by that camera library.
 
Upvote 0

basicall

Member
Licensed User
Longtime User
In my opinion this should be the most basic feature of basic2adroid yet I could not find answer from online document :sign0163:
 
Upvote 0

basicall

Member
Licensed User
Longtime User
You must set the Icon property and call SetInfo. See the example in the link I posted.

ok. I updated code based on your instruction:

B4X:
Sub Button1_Click

Dim n As Notification

n.Initialize
n.Light = True
n.Icon = "icon"
n.SetInfo("This is the title", "and this is the body.", Main) 'Change Main to "" if this code is in the main module.
n.Notify(1)

End Sub

But, it still could not make the phone LED indicator work. :signOops: I tested it on both Moto and Sony Ericsson.
 
Upvote 0

Similar Threads

Top