Add APN API
The system provides the AIDL interface to set the APN. The package name is com.wizarpos.wizarviewagentassistant, and the class name is com.wizarpos.wizarviewagentassistant.APNManagerService. When the application uses the interface, it must import the package and add permissions to the Android manifest file.
Please note that:
Insert SIM card first
The MCC, MNC should be the same as SIM card inserted
Permission
The application declares the following permissions in the manifest:
API Overview
AddByAllArgs
Add an APN setting. All paramers can not be set to Null.
Parameters | Value |
---|---|
name | the name of the APN setting. It can not be null or "". |
apn | the apn of the APN setting. It can not be null or "". |
mcc | the mcc of the APN setting. It can not be null or "". |
mnc | the mnc of the APN setting. It can not be null or "". |
proxy | the proxy of the APN setting. It can not be null, but can be "". |
port | the port of the APN setting. It can not be null, but can be "". |
MMSProxy | the MMSProxy of the APN setting. It can not be null, but can be "". |
MMSPort | the MMSPort of the APN setting. It can not be null, but can be "". |
userName | the userName of the APN setting. It can not be null, but can be "". |
server | the server of the APN setting. It can not be null, but can be "". |
password | the password of the APN setting. It can not be null, but can be "". |
MMSC | the MMSC of the APN setting. It can not be null, but can be "". |
authType | the authType of the APN setting. It can not be null or "", but can be "-1", PAP, CHAP, PAP/CHAP. |
protocol | the protocol of the APN setting. It can not be null or "", but can be IP, IPV4, IPV6, IPV4/IPV6. |
roamingProtocol | the roamingProtocol of the APN setting. It can not be null or "", but can be IP, IPV4, IPV6, IPV4/IPV6. |
type | the type of the APN setting. It can not be null, but can be "". |
bearer | the bearer of the APN setting. It can not be null or "", but can be "0", LTE, eHRPD. |
MVNOType | the MVNOType of the APN setting. It can not be null, but can be "", SPN, IMSI, GID. |
MVNOMatchData | the MVNOMatchData of the APN setting. It can not be null, but can be "". |
Returns | |
---|---|
String | a string representation of the result. "succeed" if success. "error description" if failure. |
Add
Parameters | |
---|---|
name | the name of the APN setting. It can not be null or "". |
apn | the apn of the APN setting. It can not be null or "". |
Returns | |
---|---|
String | a string representation of the result. "succeed" if success. "error description" if failure. |
AddByMCCAndMNC
Add an APN setting.
Parameters | |
---|---|
name | the name of the APN setting. It can not be null or "". |
apn | the apn of the APN setting. It can not be null or "". |
mcc | the mcc of the APN setting. It can not be null or "". |
mnc | the mnc of the APN setting. It can not be null or "". |
Returns | |
---|---|
String | a string representation of the result. "succeed" if success. "error description" if failure. |
SetSelected
Set default APN.
Parameters | |
---|---|
name | the name of the APN setting. It can not be null or "". |
Returns | |
---|---|
boolean | a boolean representation of the result. true if success. false if failure. |
getSelected()
Get detail information of the selected APN.
Returns | |
---|---|
Map | a map representation of the result. Detail information map of the selected APN. |
Snippet code:
Clear
Clear all APN settings.
Returns | |
---|---|
boolean | a boolean representation of the result. true if success. false if failure. |
Download
AIDL file
Please download the aidl file
Demo
Please download the bind service demo
Last updated