Android Question Blinking LED - How would I do that?

IslandMedic

Member
Licensed User
Longtime User
ok, I would like to put on my screen a status LED type images. I want the user to be able to see a blinking light when there is traffic on on the network. So ideally while traffic is leaving the client one green light would flash and then when traffic is coming into the client from the server the second one would flash. then a combination of two leds and colors could give them a status of the client/server

green green => Online and talking
green yellow => connected, not logged in
green reg => connected , not authorized

yellow, yellow => internet access but no websocket access
red, red => no internet access

this kind of thing. I was thinking that this would be a good use for animated gif's but that seems more complicated than just showing the image. Does anyone have some good ideas on how to achieve this?

thanks

Brad
 

Isac

Active Member
Licensed User
Longtime User
This is a piece of code that I used in my project, to intercept the network


B4X:
t.Initialize( "t",5000)

B4X:
Sub t_Tick
    Dim job As HttpJob
    job.Initialize("job",Me)
    job.Download("http://www.google.it")
End Sub
Sub JobDone (job As HttpJob)  ' controllo rete
'    job.Initialize("job",Me)
'    job.Download("http://www.google.it")
    If job.Success = False Then
    ImageView3.Visible=False
    ProgressDialogShow2("I can not find the connection,the address is not available ",True)
    Else
    ProgressDialogHide
    ImageView3.Visible=True
    End If
End Sub
 
Upvote 0

IslandMedic

Member
Licensed User
Longtime User
yeah I was more asking about how to make a graphical image "blink" on the screen when there is net traffic. Visual indicator to the user that they are online and stuff is working. so it was more about manipulating the image to make it blink.

thanks

Brad
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
yeah I was more asking about how to make a graphical image "blink" on the screen when there is net traffic. Visual indicator to the user that they are online and stuff is working. so it was more about manipulating the image to make it blink.

thanks

Brad
Attached an example. Use different LED images and perhaps edit whatever images you are using with GIMP to make white backgrounds transparent.

1.png


2.png
 

Attachments

  • BlinkingLED.zip
    131.1 KB · Views: 406
Last edited:
Upvote 0
Top