|
|
(5 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| 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.
| | {{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/sim-ethenet-wifi/add-apn-api}} |
| | |
| 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:
| |
| com.wizarpos.permission.WRITE_APN_SETTINGS
| |
| | |
| == API Overview ==
| |
| === <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>
| |
| Add an APN setting.
| |
| | |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | 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:'''
| |
| |}
| |
| {|
| |
| |-
| |
| |
| |
| |}
| |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Returns
| |
| |-
| |
| | String || "succeed" is success, "error description" is failure.
| |
| |}
| |
| | |
| | |
| === <big>Add</big>===
| |
| <syntaxhighlight lang="java">String add(String name, String apn);</syntaxhighlight>
| |
| Add an APN setting.
| |
| | |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Parameters
| |
| |-
| |
| | name || '''String:''' Not null.
| |
| |-
| |
| | apn || '''String:''' Not null.
| |
| |}
| |
| {|
| |
| |-
| |
| |
| |
| |}
| |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Returns
| |
| |-
| |
| | String || "succeed" is success, "error description" is failure.
| |
| |}
| |
| | |
| | |
| === <big>AddByMCCAndMNC</big> ===
| |
| <syntaxhighlight lang="java">String addByMCCAndMNC(String name, String apn, String mcc, String mnc);</syntaxhighlight>
| |
| Add an APN setting.
| |
| | |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Parameters
| |
| |-
| |
| | name || '''String:''' Not null.
| |
| |-
| |
| | apn || '''String:''' Not null.
| |
| |-
| |
| | mcc || '''String:''' Not null.
| |
| |-
| |
| | mnc || '''String:''' Not null.
| |
| |}
| |
| {|
| |
| |-
| |
| |
| |
| |}
| |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Returns
| |
| |-
| |
| | String || "succeed" is success, "error description" is failure.
| |
| |}
| |
| | |
| | |
| === <big>SetSelected</big> ===
| |
| <syntaxhighlight lang="java">boolean setSelected(String name);</syntaxhighlight >
| |
| Set default APN.
| |
| | |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Parameters
| |
| |-
| |
| | name|| '''String:''' Not null.
| |
| |}
| |
| {|
| |
| |-
| |
| |
| |
| |}
| |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Returns
| |
| |-
| |
| | boolean || true is success, false is failure.
| |
| |}
| |
| | |
| === <big>getSelected()</big> ===
| |
| <syntaxhighlight lang="java">Map getSelected();</syntaxhighlight >
| |
| Get detail information of the selected APN.
| |
| | |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Returns
| |
| |-
| |
| | Map|| Detail information map.
| |
| |}
| |
| <big>Snippet code:</big>
| |
| <syntaxhighlight lang="java">
| |
| HashMap res = (HashMap)mAPNManagerService.getSelected();
| |
| StringBuilder sb = new StringBuilder();
| |
| if (res != null) {
| |
| sb.append(Telephony.Carriers.NAME + ": ").append(res.get(Telephony.Carriers.NAME) + "\n")
| |
| .append(Telephony.Carriers.APN + ": ").append(res.get(Telephony.Carriers.APN) + "\n")
| |
| .append(Telephony.Carriers.PROXY + ": ").append(res.get(Telephony.Carriers.PROXY) + "\n")
| |
| .append(Telephony.Carriers.PORT + ": ").append(res.get(Telephony.Carriers.PORT) + "\n")
| |
| .append(Telephony.Carriers.MMSPROXY + ": ").append(res.get(Telephony.Carriers.MMSPROXY) + "\n")
| |
| .append(Telephony.Carriers.MMSPORT + ": ").append(res.get(Telephony.Carriers.MMSPORT) + "\n")
| |
| .append(Telephony.Carriers.USER + ": ").append(res.get(Telephony.Carriers.USER) + "\n")
| |
| .append(Telephony.Carriers.SERVER + ": ").append(res.get(Telephony.Carriers.SERVER) + "\n")
| |
| .append(Telephony.Carriers.MMSC + ": ").append(res.get(Telephony.Carriers.MMSC) + "\n")
| |
| .append(Telephony.Carriers.AUTH_TYPE + ": ").append(res.get(Telephony.Carriers.AUTH_TYPE) + "\n")
| |
| .append(Telephony.Carriers.PROTOCOL + ": ").append(String.valueOf(res.get(Telephony.Carriers.PROTOCOL)) + "\n")
| |
| .append(Telephony.Carriers.ROAMING_PROTOCOL + ": ").append(String.valueOf(res.get(Telephony.Carriers.ROAMING_PROTOCOL)) + "\n")
| |
| .append(Telephony.Carriers.TYPE + ": ").append(res.get(Telephony.Carriers.TYPE) + "\n")
| |
| .append(Telephony.Carriers.MCC + ": ").append(res.get(Telephony.Carriers.MCC) + "\n")
| |
| .append(Telephony.Carriers.MNC + ": ").append(res.get(Telephony.Carriers.MNC) + "\n")
| |
| .append(Telephony.Carriers.BEARER + ": ").append(res.get(Telephony.Carriers.BEARER) + "\n")
| |
| .append("mvno_type: ").append(String.valueOf(res.get("mvno_type")).toUpperCase() + "\n")
| |
| .append("mvno_match_data: ").append(res.get("mvno_match_data"));
| |
| }
| |
| </syntaxhighlight >
| |
| | |
| === <big>Clear</big> ===
| |
| <syntaxhighlight lang="java">boolean clear();</syntaxhighlight >
| |
| Clear all APN settings.
| |
| | |
| {|class="wizarpostable"
| |
| |-
| |
| ! scope="row" colspan="2" | Returns
| |
| |-
| |
| | boolean || true is success, false is failure.
| |
| |}
| |
| | |
| | |
| == Download ==
| |
| === AIDL file ===
| |
| Please download the [http://ftp.wizarpos.com/advanceSDK/IAPNManagerService.aidl aidl file]
| |
| === Demo ===
| |
| Please download the [http://ftp.wizarpos.com/advanceSDK/cloudpos/BindCoudposApnService.zip bind service demo]
| |