Android Question start service when wifi is connected ?

Devv

Active Member
Licensed User
Longtime User
Is it possible to start service when wifi is connected without the help of any other service ?
 

udg

Expert
Licensed User
Longtime User
Use a broadcast receiver (static one) to listen for OS wi-fi events.
When the event occurs, your process is created and the service run. Is this what are you looking for?
 
Upvote 0

Devv

Active Member
Licensed User
Longtime User
May you help me more please ?
i am not familiar with android dev site and i dont know how to make a static broadcast receiver
can you give me a small example please ?
 
Upvote 0

udg

Expert
Licensed User
Longtime User
First step should be a quick reading from the forum: intent filters tutorial.
Secondly, use reference to this broadcast intent.

Try yourself to modify code from the tutorial with intent above then come back to this thread for further assistance. I hope this way to be of more help to you than just putting together some code for a blinded copy&paste.

udg
 
Upvote 0

Devv

Active Member
Licensed User
Longtime User
First step should be a quick reading from the forum: intent filters tutorial.
Secondly, use reference to this broadcast intent.

Try yourself to modify code from the tutorial with intent above then come back to this thread for further assistance. I hope this way to be of more help to you than just putting together some code for a blinded copy&paste.

udg

Ok bro i'll do my best then i'll feed back , thanks
 
  • Like
Reactions: udg
Upvote 0
Top