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 TypeMethodDescriptionandroid.os.BundleApnAddProfile(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"}.android.os.BundleApn delete all bundle.android.os.BundleApnDeleteProfile(String apnName) Apn delete profile.android.os.BundleApn get activie profile apn name bundle.android.os.BundleApn get name list bundle.android.os.BundleApnGetProfile(String apnName) Apn get profile bundle.android.os.BundleApnProfileIsExist(String apnName) Apn profile is exist.android.os.BundleApnSetActiveProfile(String apnName) Apn set active profile bundle.android.os.BundleApnUpdateProfile(String profileData) Apn update profile.android.os.Bundleget Active Network Bearersandroid.os.BundleGet Default Data Subscription IDandroid.os.BundleGet Signal Strengthandroid.os.BundleGet Support Network Bearersandroid.os.BundleGet WWAN IP Addressandroid.os.BundlesetAirplaneMode(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(android.content.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;IP;IP;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;IP;IP;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 android.os.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 android.os.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 android.os.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 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 errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-
getActiveNetworkBearers
public android.os.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 android.os.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 android.os.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 android.os.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 android.os.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");
-