Retrieve LAS User List Using Intent

Retrieve LAS User List Using Intent

Intent Definition

The PTT Pro Client sends an INTENT that provides the list of users in a specific area (LAS Friendly Name) within a particular site.
The PTT Pro Client can now locate users within the same site or department via intent.
The minimum required PTT Pro for Android version is 3.3.10312 and later.
Name
Definition
Action
com.symbol.wfc.pttpro.ACTION_PTT_PRO_LOCATE_LAS_FRIENDLY_NAME
Intent Type
broadcast
Extra 0
Returns the user's LAS Information.
          Type
String
          Name
friendlyName
          Value
  • If the extra name is friendlyName
    • It is mandatory to provide a friendly name.
    • The friendly name is case-sensitive.
    • Use the name exactly as it is created on the LAS server.
  • If the extra name is friendlyName and Users are configured with the specified friendlyName , the list of users belonging to that friendlyName will be shared.
  • One must register the locate ( com.symbol.wfc.pttpro.ACTION_PTT_PRO_LOCATE_LAS_FRIENDLY_NAME_STATUS) intent specified in the table below under the Register Intent section.
ADB Example:
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_PTT_PRO_LOCATE_LAS_FRIENDLY_NAME --es friendlyName 'Reception'

Register Intent

The following information is about the Intent and the extra parameter that other applications need to register to get the result of the
ACTION_PTT_PRO_LOCATE_LAS_FRIENDLY_NAME
intent.
Name
Definition
Action
com.symbol.wfc.pttpro.ACTION_PTT_PRO_LOCATE_LAS_FRIENDLY_NAME_STATUS
Extra 0
Returns
friendly_name_status
          Type
Int
          Name
friendly_name_status
          Value
  • 0 indicates a failure and checks friendly_name_error_reason extra for more information.
  • 1 Indicates response for a list of users belonging to that friendly name.
Extra 1
Returns
locate_result
          Type
String
          Name
friendly_name_result
          Value
If
friendly_name_status
is 1: List of users belonging to that friendly name will be shared if
friendly_name_status
is returned as 1, as shown below
This will return list of users belonging to that friendly name as an array of String.
Example:
{ [user1,user2,user3,user4,...] }
Extra 2
Returns
friendly_name_error_reason
          Type
String
          Name
friendly_name_error_reason
          Value
If
friendly_name_status
is returned as 0,
friendly_name_error_reason
provides details about the failure. The reason can be one of the following:
  • Invalid friendly name
  • No users found under the specified friendly name.
  • Network is not available.
  • LAS is not configured.
The first two error messages are ended with the friendly name.
Extra 3
Returns
friendly_name
          Type
String
          Name
friendly_name
          Value
Returns the friendly LAS name passed as part of the
com.symbol.wfc.pttpro.ACTION_PTT_PRO_LOCATE_LAS_FRIENDLY_NAME
intent

Code Snippet

Send Broadcast
Intent intent = new Intent(); intent.setAction("com.symbol.wfc.pttpro.ACTION_PTT_ PRO_LOCATE_LAS_FRIENDLY_NAME");   intent.putExtra("friendlyName","Reception");   sendBroadcast(intent);
Register Intent
IntentFilter intent = new IntentFilter(); intent.addAction("com.symbol.wfc.pttpro.ACTION_PTT _PRO_LOCATE_LAS_FRIENDLY_NAME_STATUS"); registerReceiver(mReceiver,intent); public void onReceive(Context context, Intent intent) { String action= intent.getAction(); if(action.equals("com.symbol.wfc.pttpro.ACTION_PTT_PRO_LOCATE _LAS_FRIENDLY_NAME_STATUS")) { int status = intent.getIntExtra("friendly_name_status" , 0); String friendlyName = intent.getStringExtra("friendly_name"); if (status == 0) { String error_reason = intent.getStringExtra("friendly_name_error_reason"); Log.i(TAG, "friendlyName: "+friendlyName+" error_reason : "+ error_reason ); }else if (status == 1){ String friendly_name_result = intent.getStringExtra("friendly_name_result"); Log.i(TAG, "friendly_name_result : "+friendly_name_result +" friendlyName: "+friendly_name); } } }