How to Configure Access Point Name (APN) Settings: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The | The system provides AIDL interface to set APN, package name is '''com.wizarpos.wizarviewagentassistant''', class name is '''com.wizarpos.wizarviewagentassistant.APNManagerService''' . The application must import the package when using the interface and add the permission in android manifest file. | ||
== Permission == | == Permission == | ||
com.wizarpos.permission.WRITE_APN_SETTINGS | com.wizarpos.permission.WRITE_APN_SETTINGS | ||
Line 5: | Line 5: | ||
== API Overview == | == API Overview == | ||
=== <big> | === <big>AddByAllArgs</big>=== | ||
<syntaxhighlight lang="java">String addByAllArgs(String name, String apn, String mcc, String mnc, String proxy, String port, String MMSProxy, String MMSPort, String userName, String server, String password, String MMSC, String authType, String protocol, String roamingProtocol, String type, String bearer, String MVNOType, String MVNOMatchData);</syntaxhighlight> | <syntaxhighlight lang="java">String addByAllArgs(String name, String apn, String mcc, String mnc, String proxy, String port, String MMSProxy, String MMSPort, String userName, String server, String password, String MMSC, String authType, String protocol, String roamingProtocol, String type, String bearer, String MVNOType, String MVNOMatchData);</syntaxhighlight> | ||
Add an APN setting. | Add an APN setting. | ||
Line 63: | Line 63: | ||
=== <big> | === <big>Add</big>=== | ||
<syntaxhighlight lang="java">String add(String name, String apn);</syntaxhighlight> | <syntaxhighlight lang="java">String add(String name, String apn);</syntaxhighlight> | ||
Add an APN setting. | Add an APN setting. | ||
Line 87: | Line 87: | ||
=== <big> | === <big>AddByMCCAndMNC</big> === | ||
<syntaxhighlight lang="java">String addByMCCAndMNC(String name, String apn, String mcc, String mnc);</syntaxhighlight> | <syntaxhighlight lang="java">String addByMCCAndMNC(String name, String apn, String mcc, String mnc);</syntaxhighlight> | ||
Add an APN setting. | Add an APN setting. | ||
Line 115: | Line 115: | ||
=== <big> | === <big>SetSelected</big> === | ||
<syntaxhighlight lang="java">boolean setSelected(String name);</syntaxhighlight > | <syntaxhighlight lang="java">boolean setSelected(String name);</syntaxhighlight > | ||
Set default APN. | Set default APN. | ||
Line 137: | Line 137: | ||
=== <big> | === <big>Clear</big> === | ||
<syntaxhighlight lang="java">boolean clear();</syntaxhighlight > | <syntaxhighlight lang="java">boolean clear();</syntaxhighlight > | ||
Clear all APN settings. | Clear all APN settings. |
Revision as of 03:28, 19 November 2018
The system provides AIDL interface to set APN, package name is com.wizarpos.wizarviewagentassistant, class name is com.wizarpos.wizarviewagentassistant.APNManagerService . The application must import the package when using the interface and add the permission in android manifest file.
Permission
com.wizarpos.permission.WRITE_APN_SETTINGS
The app declares the permission in the manifest.
API Overview
AddByAllArgs
String addByAllArgs(String name, String apn, String mcc, String mnc, String proxy, String port, String MMSProxy, String MMSPort, String userName, String server, String password, String MMSC, String authType, String protocol, String roamingProtocol, String type, String bearer, String MVNOType, String MVNOMatchData);
Add an APN setting.
Parameters | |
---|---|
name | String: Not null. |
apn | String: Not null. |
mcc | String: Not null. |
mnc | String: Not null. |
proxy | String: |
port | String: |
MMSProxy | String: |
MMSPort | String: |
userName | String: |
server | String: |
password | String: |
MMSC | String: |
authType | String: Null(default),PAP,CHAP,PAP/CHAP |
protocol | String: IPV4(default),IPV6,IPV4/IPV6 |
roamingProtocol | String: IPV4(default),IPV6,IPV4/IPV6 |
type | String: |
bearer | String: Null(default),LTE,eHRPD |
MVNOType | String: Null(default),SPN,IMSI,GID |
MVNOMatchData | String: |
Returns | |
---|---|
String | "succeed" is success, "error description" is failure. |
Add
String add(String name, String apn);
Add an APN setting.
Parameters | |
---|---|
name | String: Not null. |
apn | String: Not null. |
Returns | |
---|---|
String | "succeed" is success, "error description" is failure. |
AddByMCCAndMNC
String addByMCCAndMNC(String name, String apn, String mcc, String mnc);
Add an APN setting.
Parameters | |
---|---|
name | String: Not null. |
apn | String: Not null. |
mcc | String: Not null. |
mnc | String: Not null. |
Returns | |
---|---|
String | "succeed" is success, "error description" is failure. |
SetSelected
boolean setSelected(String name);
Set default APN.
Parameters | |
---|---|
name | String: Not null. |
Returns | |
---|---|
boolean | true is success, false is failure. |
Clear
boolean clear();
Clear all APN settings.
Returns | |
---|---|
boolean | true is success, false is failure. |
Download
Please download the aidl file