Example usage for android.net ConnectivityManager startUsingNetworkFeature

List of usage examples for android.net ConnectivityManager startUsingNetworkFeature

Introduction

In this page you can find the example usage for android.net ConnectivityManager startUsingNetworkFeature.

Prototype

@Deprecated
public int startUsingNetworkFeature(int networkType, String feature) 

Source Link

Document

Tells the underlying networking system that the caller wants to begin using the named feature.

Usage

From source file:jp.takuo.android.mmsreq.Request.java

private int beginMmsConnectivity(ConnectivityManager ConnMgr) throws NoConnectivityException {
    Log.d(LOG_TAG, "startUsingNetworkFeature: MOBILE, enableMMS");
    int result = ConnMgr.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, "enableMMS");

    Log.d(LOG_TAG, "beginMmsConnectivity: result=" + result);

    switch (result) {
    case APN_ALREADY_ACTIVE:
    case APN_REQUEST_STARTED:
        return result;
    }/*from  w ww  .  ja  v a 2 s.c  o m*/

    throw new NoConnectivityException("Cannot establish MMS connectivity");
}

From source file:com.android.development.Connectivity.java

private void onCrash() {
    ConnectivityManager foo = null;
    foo.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, Phone.FEATURE_ENABLE_MMS);
}