Check whether the Network is available and whether the Network is available
/*** Check whether the Network is available. 1 * @ param act * @ return */public boolean isNetConnected (Activity act) {ConnectivityManager manager = (ConnectivityManager) act. getApplicationContext (). getSystemService (Context. CONNECTIVITY_SERVICE); if (manager = null) {return false;} NetworkInfo networkinfo = manager. getActiveNetworkInfo (); if (networkinfo = null |! Networkinfo. isAvailable () {return false;} return true;}/*** checks whether the Network is available 2 */private boolean isNetConnected () {PppoeManager pppoeManager = PppoeManager. getInstance (); EthernetManager ethernetManager = EthernetManager. getInstance (); ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService (CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager. getNetworkInfo (ConnectivityManager. TYPE_WIFI); if (networkInfo. isConnected () | ethernetManager. isNetworkConnected () | pppoeManager. getPppoeStatus (). equals (PppoeManager. PPPOE_STATE_CONNECT) {return true;} else {return false ;}}
How to check whether the Network is available
Ipconfig-all to see if the gateway can be obtained, similar
Local Ethernet Adapter connection:
Connection to a specific DNS suffix .......:
Description ......: Realtek PCIe GBE Family Controller
Physical address ......: A4-BA-DB-c2-01-14
DHCP is enabled... no
Automatic configuration is enabled... yes
IPv4 address ......: 192.168.1.78 (preferred)
Subnet Mask ......: 255.255.255.0
Default Gateway ......: 192.168.1.1
DNS server ......: 202.106.0.20
NetBIOS on TCPIP...: Enabled
Ping www.baidu.com
It's almost known.
The most sensible method is to log on to qq. If you can log on, it is available. If you cannot log on, it is not available.
How can I check whether my bandwidth is used by others?
Hello!
As long as you do not use a wireless router to access the Internet, your broadband will not be used. If your broadband account is not bound to the line, your account will be stolen by others. When you dial the Internet, error 691 is displayed.
If you use a wireless router to share the Internet and download the network monitor in my space, this software can help you check that several computers are surfing the internet in the LAN, if you find someone using your network, you can change the security password of the wireless router. Hi.baidu.com/..2.html