Package com.unitech.api.apn
Class ApnCtrl
- java.lang.Object
-
- com.unitech.api.apn.ApnCtrl
-
public class ApnCtrl extends java.lang.ObjectThe type Apn ctrl.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBUNDLE_ERROR_CODEstatic java.lang.StringBUNDLE_ERROR_MSGstatic java.lang.StringERROR_UNSUPPORTEDstatic intRESULT_CODE_ERRORstatic intRESULT_CODE_SUCCESS
-
Constructor Summary
Constructors Constructor Description ApnCtrl(android.content.Context context)Instantiates a new Apn ctrl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.os.BundleApnAddProfile(java.lang.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.android.os.BundleApnDeleteAll()Apn delete all bundle.android.os.BundleApnDeleteProfile(java.lang.String apnName)Apn delete profile.android.os.BundleApnGetActivieProfileApnName()Apn get activie profile apn name bundle.android.os.BundleApnGetNameList()Apn get name list bundle.android.os.BundleApnGetProfile(java.lang.String apnName)Apn get profile bundle.android.os.BundleApnProfileIsExist(java.lang.String apnName)Apn profile is exist.android.os.BundleApnSetActiveProfile(java.lang.String apnName)Apn set active profile bundle.android.os.BundleApnUpdateProfile(java.lang.String profileData)Apn update profile.android.os.BundlesetAirplaneMode(boolean enabled)Set airplane mode.
-
-
-
Field Detail
-
BUNDLE_ERROR_CODE
public static final java.lang.String BUNDLE_ERROR_CODE
- See Also:
- Constant Field Values
-
BUNDLE_ERROR_MSG
public static final java.lang.String BUNDLE_ERROR_MSG
- See Also:
- Constant Field Values
-
ERROR_UNSUPPORTED
public static final java.lang.String ERROR_UNSUPPORTED
- See Also:
- Constant Field Values
-
RESULT_CODE_ERROR
public static final int RESULT_CODE_ERROR
- See Also:
- Constant Field Values
-
RESULT_CODE_SUCCESS
public static final int RESULT_CODE_SUCCESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
ApnAddProfile
public android.os.Bundle ApnAddProfile(java.lang.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- example: kk;46692;466;92;internet;;;;;;;;;0;default,supl;1;IP;IP;1;0;; (String)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
ApnDeleteProfile
public android.os.Bundle ApnDeleteProfile(java.lang.String apnName)
Apn delete profile.- Parameters:
apnName- the apn name (String)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
ApnProfileIsExist
public android.os.Bundle ApnProfileIsExist(java.lang.String apnName)
Apn profile is exist.- Parameters:
apnName- the apn name (String)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
ApnUpdateProfile
public android.os.Bundle ApnUpdateProfile(java.lang.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- example: kk;46692;466;92;internet;;;;;;;;;0;default,supl;1;IP;IP;1;0;; (String)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
ApnDeleteAll
public android.os.Bundle ApnDeleteAll()
Apn delete all bundle.- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-
ApnSetActiveProfile
public android.os.Bundle ApnSetActiveProfile(java.lang.String apnName)
Apn set active profile bundle.- Parameters:
apnName- the apn name (String)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-
ApnGetActivieProfileApnName
public android.os.Bundle ApnGetActivieProfileApnName()
Apn get activie profile apn name bundle.- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
String appName = bundle.getString("AppName");
-
ApnGetNameList
public android.os.Bundle ApnGetNameList()
Apn get name list bundle.- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
ArrayList appNameList = bundle.getStringArrayList("ApnNameList");
-
ApnGetProfile
public android.os.Bundle ApnGetProfile(java.lang.String apnName)
Apn get profile bundle.- Parameters:
apnName- the apn name (String)- Returns:
- A bundle contains the error code and message
int erroeCode = 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 android.os.Bundle setAirplaneMode(boolean enabled)
Set airplane mode.- Parameters:
enabled- true or false (boolean)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-
-