Enable/Disable Mobile Data API
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:
API Overview
setMobileDataEnabled
Enable/Disable mobile data.
Parameters | |
---|---|
slot | slot number, 1 is slot 1, 2 is slot 2. |
enable | for the mobile data setting, a boolean value is used: true enables mobile data, while false disables it. |
Returns | |
---|---|
boolean | a boolean representation of the result. true if success. false if failure. |
setMobileDataRoamingEnabled
Enable/Disable mobile data roaming.
Parameters | |
---|---|
slot | slot number, 1 is slot 1, 2 is slot 2. |
roaming | for the mobile data roaming setting, a boolean value is used: true enables mobile data roaming, while false disables it. |
Returns | |
---|---|
boolean | a boolean representation of the result. true if success. false if failure. |
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.
Download the Demo App for a practical implementation example.
Last updated