Best code examples for Android NetworkInfo class (android.net.NetworkInfo)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android NetworkInfo class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android NetworkInfo examples from Open Source projects
This code example shows how to use the following methods: isConnectedOrConnecting
12:	if (netInfo != null && netInfo.isConnectedOrConnecting()) { 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: isConnected
23:	boolean connected = (activeNetInfo != null) && (activeNetInfo.isConnected()); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: isAvailable
83:	return networkInfo != null  && networkInfo.isAvailable(); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: isConnected
246:	if (activeNetwork != null && activeNetwork.isConnected()) { 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: getType
44:	return connected() && networkInfo.getType() == TYPE_WIFI; 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnectedOrConnecting
45:	boolean isConnected = (activeNetwork != null) && activeNetwork.isConnectedOrConnecting(); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: isAvailable, isConnected
29:	object.put("available", wifi.isAvailable()); 
30:	object.put("connected", wifi.isConnected()); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getType
28:	return ni != null && ni.getType() == ConnectivityManager.TYPE_WIFI; 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
138:	return info != null && info.isConnected(); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: isAvailable, isConnected
93:	return ni == null || !ni.isAvailable() || !ni.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isAvailable
106:	if (activeNetworkInfo != null && activeNetworkInfo.isAvailable()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getType
21:	int type = networkInfo.getType(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnectedOrConnecting
46:	if(activeNetwork.isConnectedOrConnecting()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isAvailable, isConnected
133:	return networkInfo != null && networkInfo.isAvailable() && networkInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isAvailable
45:	return (info != null) && info.isAvailable(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
89:	return activeNetworkInfo.isConnected(); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: isConnectedOrConnecting
108:	state = wifiNetwork.isConnectedOrConnecting(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getType
79:	switch (ni.getType()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isAvailable, isConnected
48:	if (ni != null && ni.isAvailable() && ni.isConnected()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
23:	if (activeNetwork != null && activeNetwork.isConnected()) { 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: isConnectedOrConnecting
54:	return info != null && info.isConnectedOrConnecting(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnectedOrConnecting
69:	if (netInfo != null && netInfo.isConnectedOrConnecting()) 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
17:	return activeNetwork.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getType
45:	return activeNetwork.getType() == ConnectivityManager.TYPE_WIFI; 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnectedOrConnecting
144:	if (netInfo != null && netInfo.isConnectedOrConnecting()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getType
79:	switch (ni.getType()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
103:	if (info.isConnected()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnectedOrConnecting
62:	if( networkInfo == null || !networkInfo.isConnectedOrConnecting() ) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getType
305:	return network1.getType() == network2.getType(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
73:	if (netInfo != null && netInfo.isConnected()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
20:	return ni.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
20:	if (mWifi.isConnected()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
104:	return wifiInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
429:	return info.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
37:	boolean isConnected = networkInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
29:	if (netInfo != null && netInfo.isConnected()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
12:	return networkInfo != null && networkInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
200:	return networkInfo != null && networkInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
336:	if (networkInfo != null && networkInfo.isConnected()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
132:	ret = wifiInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
103:	if (wifiInfo != null) bw = wifiInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
184:	if (mobileInfo != null) bm = mobileInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
56:	return netInfo.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
50:	if (wifi!=null && wifi.isConnected()) { 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
113:	return (activeNetwork != null && activeNetwork.isConnected()); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
58:	networkChanged(info == null || !info.isConnected()); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
13:	return info != null && info.isConnected(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: isConnected
31:	if (netInfo != null && netInfo.isConnected()) { 
Full Snippet Info
9
CodeRank
Related Android NetworkInfo Questions & Answers:
Other Android NetworkInfo Examples
16:			  if (connectivity != null) 
17:			  {
18:				  NetworkInfo[] info = connectivity.getAllNetworkInfo();
19:				  if (info != null) 
20:					  for (int i = 0; i < info.length; i++)

Read More

19:	          if (connectivity != null)
20:	          {
21:	              NetworkInfo[] info = connectivity.getAllNetworkInfo();
22:	              if (info != null)
23:	                  for (int i = 0; i < info.length; i++)

Read More

19:	          if (connectivity != null)
20:	          {
21:	              NetworkInfo[] info = connectivity.getAllNetworkInfo();
22:	              if (info != null)
23:	                  for (int i = 0; i < info.length; i++)

Read More

See Code Examples for Android NetworkInfo Methods: