开发者

Broadcast reveiver for detecting availability of a new network

开发者 https://www.devze.com 2023-03-27 03:48 出处:网络
I am looking to find an inten开发者_运维技巧t action that is fired when a new network is detected on your android phone. Is thea any? I have checked the documentation, the only one that is close is an

I am looking to find an inten开发者_运维技巧t action that is fired when a new network is detected on your android phone. Is thea any? I have checked the documentation, the only one that is close is android.net.conn.CONNECTIVITY_CHANGE I want to write a Broadcast receiver that listens to a new network detected. Alternatively is there like volatile a content provider for the networks your android phone detects? Thanx


Do you want to be informed when your Android device connects to a new network? In that case you need to use NETWORK_STATE_CHANGED_ACTION. This question at SO deals with something similar (specific to WiFi though). You might find something similar to deal with a higher abstraction (i.e, Network in place of Wifi).

If you want to be informed when a new network (i.e, AP) is visible to your Android device, try looking at WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.

0

精彩评论

暂无评论...
验证码 换一张
取 消