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

From wizarPOS
(Replaced content with "{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/sim-ethenet-wifi/set-preferred-network-type-api}}")
Tag: Replaced
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
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.
{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/sim-ethenet-wifi/set-preferred-network-type-api}}
 
  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 ==
=== <big>setPreferredNetworkType</big>===
  <syntaxhighlight lang="java">boolean setPreferredNetworkType(int phoneId, int networkType);</syntaxhighlight>
Set the preferred network type. Used for device configuration by some CDMA operators.
 
{|class="wizarpostable"
|-
! scope="row" colspan="2" | Parameters
|-
| phoneId || '''int:''' The ID of the subscription to set the preferred network type for.
|-
| networkType  || '''int:'''  The preferred network type, defined in RILConstants.java.
|}
{|
|-
|}
{|class="wizarpostable"
|-
!  scope="row" colspan="2" | Returns
|-
|  boolean || true is success, false is failure.
|}
 
 
=== <big>getPreferredNetworkType</big>===
  <syntaxhighlight lang="java">int getPreferredNetworkType(int phoneId);</syntaxhighlight>
Get the preferred network type. Used for device configuration by some CDMA operators.
 
{|class="wizarpostable"
|-
! scope="row" colspan="2" | Parameters
|-
| phoneId ||  '''int:''' The ID of the subscription to set the preferred network type for.
|}
{|
|-
|}
{|class="wizarpostable"
|-
!  scope="row" colspan="2" | Returns
|-
|  int || The preferred network type, defined in RILConstants.java.
|}
 
 
=== <big>getSupportedNetworkTypes</big>===
  <syntaxhighlight lang="java">NetworkType[] getSupportedNetworkTypes();</syntaxhighlight>
Get supported network type array. NetworkType: name, typeId;
 
{|class="wizarpostable"
|-
!  scope="row" colspan="2" | Returns
|-
|  NetworkType[]|| The supported network type array.
|}
 
== Download ==
=== Demo ===
Please download the [http://ftp.wizarpos.com/advanceSDK/apitest2.zip demo]

Latest revision as of 09:12, 7 April 2024

Please visit new link of same subject:

https://smartpossdk.gitbook.io/cloudpossdk/faq/sim-ethenet-wifi/set-preferred-network-type-api

We're making a move! Our site's content is migrating to a new URL, to provide you with an enhanced browsing experience. Please update your bookmarks accordingly. Thank you for your continuous support!