Back to project page Bussan.
The source code is released under:
Copyright 2011 Kristian Bendiksen. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ...
If you think the Android project Bussan listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package no.kriben.bussan; //from w ww . j a va2 s.com import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class ConnectivityChecker { public static boolean isOnline(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (cm == null) return false; NetworkInfo info = cm.getActiveNetworkInfo(); if (info == null) return false; return info.isConnectedOrConnecting(); } }