EasyManuals Logo
Home>Zebra>PDA>TC20

Zebra TC20 User Manual

Zebra TC20
171 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 #95 background imageLoading...
Page #95 background image
DataWedge
95
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 TC20 and is the answer not in the manual?

Zebra TC20 Specifications

General IconGeneral
BrandZebra
ModelTC20
CategoryPDA
LanguageEnglish

Related product manuals