Пример #1
0
        /**
         * Check if there is fast connectivity
         * @param context
         * @return
         */
        public static bool IsConnectedFast(Context context)
        {
            NetworkInfo      info = NetworkConnectivity.GetNetworkInfo(context);
            TelephonyManager tm   = TelephonyManager.FromContext(context);

            return(info != null && info.IsConnected && NetworkConnectivity.IsConnectionFast(info.Type, tm.NetworkType));
        }
Пример #2
0
        /**
         * Check if there is any connectivity to a mobile network
         * @param context
         * // @param type
         * @return
         */
        public static bool IsConnectedMobile(Context context)
        {
            NetworkInfo info = NetworkConnectivity.GetNetworkInfo(context);

            return(info != null && info.IsConnected && info.Type == ConnectivityType.Mobile);
        }
Пример #3
0
        /**
         * Check if there is any connectivity
         * @param context
         * @return
         */
        public static bool IsConnected(Context context)
        {
            NetworkInfo info = NetworkConnectivity.GetNetworkInfo(context);

            return(info != null && info.IsConnected);
        }