Class ApnCtrl

java.lang.Object
com.unitech.api.apn.ApnCtrl

public class ApnCtrl extends Object
The type Apn ctrl.
  • Field Details

  • Constructor Details

    • ApnCtrl

      public ApnCtrl(Context context)
      Instantiates a new Apn ctrl.
      Parameters:
      context - the context
  • Method Details

    • ApnAddProfile

      public Bundle ApnAddProfile(String profileData)
      Add Apn data Apn profile contain {"_id","name","numeric","mcc","mnc","apn","user","server","password", "proxy","port","mmsproxy","mmsport","mmsc","authtype","type","current", "protocol","roaming_protocol","carrier_enabled","bearer","mvno_type","mvno_match_data"}. Profile param need 22 item data without _id.
      Parameters:
      profileData - e.g. kk;46692;466;92;internet;;;;;;;;;0;default,supl;1;IPV4;IPV4;1;0;; (String)
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg = bundle.getString("errorMsg");
    • ApnDeleteProfile

      public Bundle ApnDeleteProfile(String apnName)
      Apn delete profile.
      Parameters:
      apnName - the apn name (String)
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg = bundle.getString("errorMsg");
    • ApnProfileIsExist

      public Bundle ApnProfileIsExist(String apnName)
      Apn profile is exist.
      Parameters:
      apnName - the apn name (String)
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg = bundle.getString("errorMsg");
    • ApnUpdateProfile

      public Bundle ApnUpdateProfile(String profileData)
      Apn update profile. Apn profile contain {"_id","name","numeric","mcc","mnc","apn","user","server","password", "proxy","port","mmsproxy","mmsport","mmsc","authtype","type","current", "protocol","roaming_protocol","carrier_enabled","bearer","mvno_type","mvno_match_data"}. Profile param need 22 item data without _id.
      Parameters:
      profileData - e.g. kk;46692;466;92;internet;;;;;;;;;0;default,supl;1;IPV4;IPV4;1;0;; (String)
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg = bundle.getString("errorMsg");
    • ApnDeleteAll

      public Bundle ApnDeleteAll()
      Apn delete all bundle.
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
    • ApnSetActiveProfile

      public Bundle ApnSetActiveProfile(String apnName)
      Apn set active profile bundle.
      Parameters:
      apnName - the apn name (String)
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
    • ApnGetActivieProfileApnName

      public Bundle ApnGetActivieProfileApnName()
      Apn get activie profile apn name bundle.
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      String appName = bundle.getString("AppName");
    • ApnGetNameList

      public Bundle ApnGetNameList()
      Apn get name list bundle.
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      ArrayList appNameList = bundle.getStringArrayList("ApnNameList");
    • ApnGetProfile

      public Bundle ApnGetProfile(String apnName)
      Apn get profile bundle.
      Parameters:
      apnName - the apn name (String)
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      for loop, bundle.getString(COLUMNS_OF_APN[i])
      final String[] COLUMNS_OF_APN = {
      "_id", "name", "numeric", "mcc", "mnc",
      "apn", "user", "server", "password", "proxy",
      "port", "mmsproxy", "mmsport", "mmsc", "authtype",
      "type", "current", "protocol", "roaming_protocol",
      "carrier_enabled", "bearer", "mvno_type", "mvno_match_data"
      };
    • setAirplaneMode

      public Bundle setAirplaneMode(boolean enabled)
      Set airplane mode.
      Parameters:
      enabled - true or false (boolean)
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
    • getActiveNetworkBearers

      public Bundle getActiveNetworkBearers()
      get Active Network Bearers
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      String getActiveNetworkBearers=bundle.getString("getActiveNetworkBearers");
    • getWWANIpAddress

      public Bundle getWWANIpAddress()
      Get WWAN IP Address
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      String getWWANIpAddress=bundle.getString("getWWANIpAddress");
    • getSignalStrength

      public Bundle getSignalStrength()
      Get Signal Strength
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      String getSignalStrength=bundle.getString("getSignalStrength");
    • getDefaultDataSubscriptionId

      public Bundle getDefaultDataSubscriptionId()
      Get Default Data Subscription ID
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      String getDefaultDataSubscriptionId=bundle.getString("getDefaultDataSubscriptionId");
    • getSupportNetworkBearers

      public Bundle getSupportNetworkBearers()
      Get Support Network Bearers
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      String getSupportNetworkBearers=bundle.getString("getSupportNetworkBearers");