views:

287

answers:

3

I need some advices about the Android OS and application.

I wonder if the Android OS is able to push network connecting status to applications. (I found applications can get a network connecting status from android OS. But I can't find reverse cases.)

However, I am thinking android OS may push network connecting status to applications.


when application is installed on android os, is it possible to register something for monitoring phone's network status on android os.

Because I want my application can receive phone's network status from android os.(not by asking directly to android os.)

It means: when phone's network status changes, does android os automatically informs phone's network status to application?

I'm sorry my English writing is bad TT;

Have a nice weekend~

Korean: 안드로이드 OS에서 직접 어플리케이션에 네트워크 상태 변화를 알리도록 할 수 있는 방법이 있을까요?

만약 저 방법이 안된다면, 안드로이드에 어플리케이션이 설치될 때 어플리케이션과 연결된 listener(혹은 유사한 무엇)를 안드로이드 OS에 설치할 수 있을까요? 이 listener가 어플리케이션과는 상관 없이 안드로이드 OS의 네트워크 상태를 확인해 네트워크 상태가 변경되면 해당 정보를 어플리케이션에 보내주는 형태로 개발해보고 싶습니다.

좋은 정보나 조언 등 있으시면 부탁드리겠습니다.

즐거운 주말 되세요~

+5  A: 

From ConnectivityManager documentation:

Class that answers queries about the state of network connectivity. It also notifies applications when network connectivity changes.

Nikola Smiljanić
Sadly there is no example in the connectivity manager on how to exactly do the listening
Janusz
A: 

If you're just looking for phone network connection status then register your PhoneStateListener by passing it to android.telephony.TelephonyManager listen

See PhoneStateListener for a list of listening options. **Note: **this only applies to Cellular network connection status changes not wifi, etc.

10ToedSloth