Android Question Zebra(former Symbol Motorola) mobile device

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Does anybody have any expirience with TC25 barcode scanning using intent?

Regards and thanks in advance
Georg


Maybe something like this:
Place this code in a service module, I wasn't too sure about the extras, so hopefully one will work for you, but I doubt it.
B4X:
Sub Process_Globals
    Dim BRTC25 As BroadCastReceiver
End Sub

Sub Service_Create
    BRTC25.Initialize("BRZebraScan")
End Sub

Sub Service_Start (StartingIntent As Intent)
    BRTC25.SetPriority(2147483647)
    BRTC25.registerReceiver("com.symbol.emdk.datawedge.api.ACTION_SOFTSCANTRIGGER")
End Sub

'Hopefully something will appear in your logs, good luck.
Sub BRZebraScan_OnReceive (Action As String, Extra As Object)
    Dim IntGetBCData As Intent = Extra
    Log(IntGetBCData.GetExtra("com.symbol.emdk.datawedge.data_string"))
    Log(BytesToString(IntGetBCData.GetExtra("com.symbol.emdk.datawedge.decode_data"), 0, IntGetBCData.GetExtra("length"), "UTF-8"))
End Sub


Enjoy...
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Does anybody have any expirience with TC25 barcode scanning using intent?
1. You need to add your app using the Datawedge app to receive the Intents.
2. You need to configure the Datawedge to send Broadcast intents.

Basically you need to setup a Broadcast receiver for the Intents.

Note that i used a TC56 for my tests. But i guess they are similar. maybe ;-)

Logger connected to: Zebra Technologies TC56
--------- beginning of main
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
Logger connected to: Zebra Technologies TC56
--------- beginning of main
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (zebrasvc) Create ***
BroadcastReceiver has been initialized.
** Service (zebrasvc) Start **
(Intent) Intent { cmp=b4a.example.zebraintents/.zebrasvc }
no extras
BroadcastReceiver_OnReceive(com.symbol.datawedge.DWDEMO)
Bundle[{com.motorolasolutions.emdk.datawedge.source=scanner, com.symbol.datawedge.source=scanner, com.symbol.datawedge.label_type=LABEL-TYPE-EAN8, com.motorolasolutions.emdk.datawedge.data_string=84157065, com.symbol.datawedge.data_dispatch_time=1563013925850, com.symbol.datawedge.data_string=84157065, com.motorolasolutions.emdk.datawedge.label_type=LABEL-TYPE-EAN8, com.motorolasolutions.emdk.datawedge.decode_data=[[B@54b024], com.symbol.datawedge.decode_data=[[B@192278d], com.symbol.datawedge.decoded_mode=single_decode}]
emdkSource = scanner
emdkDataString = 84157065
emdkDataType = LABEL-TYPE-EAN8
emdkdecode_data = [[B@755fd42]
DatawedgeSource = scanner
DatawedgeDataString = 84157065
DatawedgeLabelType = LABEL-TYPE-EAN8
DatawedgeDispatchTime = 1563013925850
Datawedgedecode_data = [[B@5d32153]
Datawedgedecoded_mode = single_decode
 

Attachments

  • ZebraIntentTest.zip
    10.9 KB · Views: 366
Upvote 0

igpf

Member
Licensed User
Longtime User
1. You need to add your app using the Datawedge app to receive the Intents.
2. You need to configure the Datawedge to send Broadcast intents.

Basically you need to setup a Broadcast receiver for the Intents.

Note that i used a TC56 for my tests. But i guess they are similar. maybe ;-)

A thousand thanks. I just starting using the TC25, this code worked out of the box.

My only suggestion is to setup the DataWedge (app) in Android properly.
*- create a new profile
*- enable "intent output"
*- set intent action "com.symbol.datawedge.api.ACTION"
*- intent category, leave blank
*- intent delivery, set to Broadcast intent

thanks again. this was awesome! I have spent about 3 days trying to get this to work. The broadcast library was also key, so that's for that also.
 
Upvote 0
Top