How to Configure Access Point Name (APN) Settings

From wizarPOS
Revision as of 08:01, 24 March 2020 by Jeff (talk | contribs)

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 Notice:
 
 * SIM card should be inserted firstly
 * The MCC, MNC should be same with the inserted SIM card

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

AIDL file

Please download the aidl file

Demo

Please download the bind service demo