is CM Wap Network - Android Network

Android examples for Network:Network Status

Description

is CM Wap Network

Demo Code


//package com.java2s;

import android.content.Context;

import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Main {
    public static boolean isCMWap(Context context) {

        ConnectivityManager conManager = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo networkInfo = conManager.getActiveNetworkInfo();
        if (networkInfo != null) {
            if (networkInfo.getExtraInfo() == null) {
                return false;
            } else {
                return (networkInfo.getExtraInfo()
                        .equalsIgnoreCase("cmwap") ? true : false);
            }/* ww  w . ja  v  a 2 s .com*/
        }
        return false;
    }
}

Related Tutorials