is 3G network connection - Android Network

Android examples for Network:Network Connection

Description

is 3G network connection

Demo Code


//package com.java2s;
import android.content.Context;
import android.net.ConnectivityManager;

public class Main {
    public static boolean is3G(Context context) {
        ConnectivityManager manager = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        boolean is3g = manager.getNetworkInfo(
                ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting();
        return is3g;
    }/*  w  ww .j  a v  a2s. c o  m*/
}

Related Tutorials