EasyManuals Logo
Home>Zebra>Handhelds>PS20 Series

Zebra PS20 Series User Manual

Zebra PS20 Series
259 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #201 background imageLoading...
Page #201 background image
DataWedge
201
Example
Comments
The scanner and its parameters are set based on the currently active Profile.
//
// Call before sending the enumeration query
//
public void registerReciever(){
IntentFilter filter = new IntentFilter();
filter.addAction("com.symbol.datawedge.api.RESULT_ACTION");//RESULT_ACTION
filter.addCategory(Intent.CATEGORY_DEFAULT);
registerReceiver(enumeratingBroadcastReceiver, filter);
}
//
// Send the enumeration command to DataWedge
//
public void enumerateScanners(){
Intent i = new Intent();
i.setAction("com.symbol.datawedge.api.ACTION");
i.putExtra("com.symbol.datawedge.api.ENUMERATE_SCANNERS", "");
this.sendBroadcast(i);
}
public void unRegisterReciever(){
unregisterReceiver(enumeratingBroadcastReceiver);
}
//
// Create broadcast receiver to receive the enumeration result
//
private BroadcastReceiver enumeratingBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.d(TAG, "Action: " + action);
if(action.equals("com.symbol.datawedge.api.RESULT_ACTION")){
//
// enumerate scanners
//
if(intent.hasExtra("com.symbol.datawedge.api.RESULT_ENUMERATE_SCANNERS")) {
ArrayList<Bundle> scannerList = (ArrayList<Bundle>)
intent.getSerializableExtra("com.symbol.datawedge.api.RESULT_ENUMERATE_SCANNERS");
if((scannerList != null) && (scannerList.size() > 0)) {
for (Bundle bunb : scannerList){
String[] entry = new String[4];
entry[0] = bunb.getString("SCANNER_NAME");
entry[1] = bunb.getBoolean("SCANNER_CONNECTION_STATE")+"";
entry[2] = bunb.getInt("SCANNER_INDEX")+"";
entry[3] = bunb.getString("SCANNER_IDENTIFIER");
Log.d(TAG, "Scanner:" + entry[0] + " Connection:" + entry[1] + " Index:" + entry[2] + " ID:" + entry[3]);
}
}
}
}
}
};

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Zebra PS20 Series and is the answer not in the manual?

Zebra PS20 Series Specifications

General IconGeneral
BrandZebra
ModelPS20 Series
CategoryHandhelds
LanguageEnglish

Related product manuals