How to Set the Preferred Network Type for Cellular Networks Using API: Difference between revisions

From wizarPOS
(Created page with "The system provides the AIDL interface to set the Preferred network type, The package name is '''com.wizarpos.wizarviewagentassistant''', and the class name is '''com.wizarpos...")
 
No edit summary
Line 1: Line 1:
The system provides the AIDL interface to set the Preferred network type, 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 the package and add permissions to the Android manifest file.
The system provides the AIDL interface to set the preferred network type, 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.


   Please note that:
   Please note that:

Revision as of 06:10, 29 June 2021

The system provides the AIDL interface to set the preferred network type, 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.

 Please note that:
 
 * Insert SIM card first

Permission

The application declares the following permissions in the manifest:

 com.wizarpos.permission.MODIFY_PHONE_STATE

API Overview

setPreferredNetworkType

boolean setPreferredNetworkType(int subId, int networkType);

Set the preferred network type. Used for device configuration by some CDMA operators.

Parameters
subId int: The id of the subscription to set the preferred network type for.
networkType int: The preferred network type, defined in RILConstants.java.
Returns
boolean "true" is success, "false" is failure.


getPreferredNetworkType

int getPreferredNetworkType(int subId);
Get the preferred network type. Used for device configuration by some CDMA operators.
Parameters
subId int: The id of the subscription to set the preferred network type for.
Returns
int The preferred network type, defined in RILConstants.java.


Download

Demo

Please download the demo