How to Enable and Disable Mobile Data Using API: Difference between revisions
No edit summary |
|||
Line 40: | Line 40: | ||
== Download == | == Download == | ||
=== AIDL file=== | === AIDL file=== | ||
Please download the [http://ftp.wizarpos.com/advanceSDK/ISystemExtApi.aidl AIDL file]. | Please download the [http://ftp.wizarpos.com/advanceSDK/ISystemExtApi.aidl AIDL file]. | ||
=== Demo=== | |||
We have developed a small demo that retrieves the MNC (Mobile Network Code), MCC (Mobile Country Code), and IMSI (International Mobile Subscriber Identity) from a SIM card. Additionally, it utilizes the AIDL (Android Interface Definition Language) interface to enable and disable the data network. | |||
Please download the [https://github.com/SmartPOSSamples/WhileListOfSim.git demo]. |
Revision as of 08:37, 24 January 2024
The system provides the AIDL interface to Enable/Disable mobile data or mobile data roaming, When connect the service, the package name is com.wizarpos.wizarviewagentassistant, and the class name is com.wizarpos.wizarviewagentassistant.SystemExtApiService. When the application uses the interface, it must import wizarviewagentassistant and add permissions to the Android manifest file.
Permission
The application declares the following permissions in the manifest:
android.permission.CLOUDPOS_SET_MOBILE_DATA
API Overview
setMobileDataEnabled
boolean setMobileDataEnabled(int slot, boolean enable);
Enable/Disable mobile data.
Parameters | |
---|---|
slot | int: 1 = slot 1, 2 = slot 2. |
enable | boolean: true/false. |
Returns | |
boolean | whether the new state has been set, true is success, falas is fail. |
setMobileDataRoamingEnabled
boolean setMobileDataRoamingEnabled(int slot, int roaming);
Enable/Disable mobile data roaming.
Parameters | |
---|---|
slot | int: 1 = slot 1, 2 = slot 2. |
roaming | int: 0 = disable, 1= enable. |
Returns | |
boolean | whether the new state has been set, true is success, false is fail. |
Download
AIDL file
Please download the AIDL file.
Demo
We have developed a small demo that retrieves the MNC (Mobile Network Code), MCC (Mobile Country Code), and IMSI (International Mobile Subscriber Identity) from a SIM card. Additionally, it utilizes the AIDL (Android Interface Definition Language) interface to enable and disable the data network.
Please download the demo.