0

I need to convert the following java code to an adb command to trigger scanner on a Zebra Android Scanner (not camera) mobile device.

I found the code on the the Zebar site as follwos,

Intent i = new Intent();

i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.SOFT_SCAN_TRIGGER", "");

Parameters

ACTION [String]: "com.symbol.datawedge.api.ACTION"

EXTRA_DATA [String]: "com.symbol.datawedge.api.SOFT_SCAN_TRIGGER" : The parameter as a string, using any of the following:

START_SCANNING - starts scanning when triggered

STOP_SCANNING - stops or interrupts scanning when triggered

TOGGLE_SCANNING - toggles between START_SCANNING and STOP_SCANNING when triggered

I tired the following

adb shell am start -a com.symbol.datawedge.api.ACTION --ez com.symbol.datawedge.api.SOFT_SCAN_TRIGGER "START_SCANNING"

throws

Error: Invalid boolean value: start_scanning

if i change the START_SCANNING to true (not valid as per Zebra site) it throws

Starting: Intent { act=com.symbol.datawedge.api.ACTION (has extras) }
Error: Activity not started, unable to resolve Intent { act=com.symbol.datawedge.api.ACTION flg=0x10000000 (has extras) }
  • The extra to be passed is a string, yet you have defined it as a boolean with --ez. Replace it with -e or --es for string and then test. – Firelord Jan 24 at 16:09
  • Thanks for your quick reply. I tired both --ez and -e. both shows exception as "C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell am start -a com.symbol.datawedge.api.ACTION -e com.symbol.datawedge.api.SOFT_SCAN_TRIGGER "START_SCANNING" Starting: Intent { act=com.symbol.datawedge.api.ACTION (has extras) } Error: Activity not started, unable to resolve Intent { act=com.symbol.datawedge.api.ACTION flg=0x10000000 (has extras) }" – naanku Jan 24 at 16:32
  • What app is it? Or could you please provide the relevant Activity in the apps android manifest to verify that every matches up and declared. – Bo Lawson Jan 26 at 0:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.