EasyManuals Logo
Home>Zebra>PDA>MC93 Series

Zebra MC93 Series Integrator Guide

Zebra MC93 Series
186 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 #140 background imageLoading...
Page #140 background image
DataWedge
140
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

Other manuals for Zebra MC93 Series

Questions and Answers:

Question and Answer IconNeed help?

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

Zebra MC93 Series Specifications

General IconGeneral
BrandZebra
ModelMC93 Series
CategoryPDA
LanguageEnglish

Related product manuals