android - Strategy for a global network connection listener -


what best strategy have network connection listener application started when application starts , closes when activity exists. use service in register phonestatelistener this:

((telephonymanager)app.getsystemservice(context.telephony_service)).listen(phonestatelistener,                                       phonestatelistener.listen_data_connection_state); 

there no api nor class available android sdk can register listener, , wait network status changes.

basically need figure out solution fits project requirements.

i found solution (from response) useful network listener android, create register boradcastreceiver waiting connectivity changes (via intent-filter).


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -