Package com.unitech.api.apn
Class ApnCtrl
java.lang.Object
com.unitech.api.apn.ApnCtrl
The type Apn ctrl.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBundleApnAddProfile(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"}.BundleApn delete all bundle.BundleApnDeleteProfile(String apnName) Apn delete profile.BundleApn get activie profile apn name bundle.BundleApn get name list bundle.BundleApnGetProfile(String apnName) Apn get profile bundle.BundleApnProfileIsExist(String apnName) Apn profile is exist.BundleApnSetActiveProfile(String apnName) Apn set active profile bundle.BundleApnUpdateProfile(String profileData) Apn update profile.Bundleget Active Network BearersBundleGet Default Data Subscription IDBundleGet Signal StrengthBundleGet Support Network BearersBundleGet WWAN IP AddressBundlesetAirplaneMode(boolean enabled) Set airplane mode.
-
Field Details
-
BUNDLE_ERROR_CODE
- See Also:
-
BUNDLE_ERROR_MSG
- See Also:
-
ERROR_UNSUPPORTED
- See Also:
-
RESULT_CODE_ERROR
public static final int RESULT_CODE_ERROR- See Also:
-
RESULT_CODE_SUCCESS
public static final int RESULT_CODE_SUCCESS- See Also:
-
-
Constructor Details
-
ApnCtrl
public ApnCtrl(Context context) Instantiates a new Apn ctrl.- Parameters:
context- the context
-
-
Method Details
-
ApnAddProfile
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
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
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
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
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
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");
-