Hi everyone,
I’m having trouble getting my B4A app to receive intents sent from DataWedge (or via adb broadcast) on Android 13.
Here’s my manifest
Starter service
zebrareceiver.bas
I’ve confirmed that my app’s receiver is correctly listed when I run:
adb shell cmd package dump com.elmac.zebrascan
and it shows:
Receiver Resolver Table:
Action: "com.elmac.DTWEDGE"
Category: "android.intent.category.DEFAULT"
However, when I send this broadcast:
adb shell am broadcast -a com.elmac.DTWEDGE -c android.intent.category.DEFAULT --es com.symbol.datawedge.data_string "TEST123"
nothing happens — my Receiver_Receive sub never fires and no log messages appear.
Any help, sample project, or working manifest would be greatly appreciated
Thanks in advance!
— Fabrizio Toniolo
I’m having trouble getting my B4A app to receive intents sent from DataWedge (or via adb broadcast) on Android 13.
Here’s my manifest
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
' Receiver export (ok anche su Android 11)
SetReceiverAttribute(zebrareceiver, android:exported, "true")
' Filtro per DataWedge: action DEVE combaciare con il profilo
AddReceiverText(zebrareceiver,
<intent-filter>
<action android:name="com.elmac.DTWEDGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
)
Starter service
B4X:
Sub Process_Globals
Public PendingScans As List
End Sub
Sub Service_Create
PendingScans.Initialize
End Sub
Public Sub OnScanFromDW(code As String)
If SubExists(B4XPages.MainPage, "read_item_barcode") Then
CallSubDelayed2(B4XPages.MainPage, "read_item_barcode", code)
Else
PendingScans.Add(code)
End If
End Sub
B4X:
Sub Receiver_Receive (Intent As Intent)
Log("DW action: " & Intent.Action)
Log("DW extras: " & Intent.ExtrasToString)
Dim code As String
If Intent.HasExtra("com.symbol.datawedge.data_string") Then
code = Intent.GetExtra("com.symbol.datawedge.data_string")
Else If Intent.HasExtra("com.motorolasolutions.emdk.datawedge.data_string") Then
code = Intent.GetExtra("com.motorolasolutions.emdk.datawedge.data_string")
Else
Return
End If
CallSubDelayed2(Starter, "OnScanFromDW", code)
End Sub
What happens
I’ve confirmed that my app’s receiver is correctly listed when I run:
adb shell cmd package dump com.elmac.zebrascan
and it shows:
Receiver Resolver Table:
Action: "com.elmac.DTWEDGE"
Category: "android.intent.category.DEFAULT"
However, when I send this broadcast:
adb shell am broadcast -a com.elmac.DTWEDGE -c android.intent.category.DEFAULT --es com.symbol.datawedge.data_string "TEST123"
nothing happens — my Receiver_Receive sub never fires and no log messages appear.
My questions
- Is there something I’m missing in the manifest for implicit broadcasts on Android 13+?
- Do I need to register the receiver dynamically (e.g., via BroadcastReceiver.Initialize in a service) instead of statically in the manifest?
- Has anyone successfully received DataWedge broadcasts with B4A targeting SDK 33+?
Any help, sample project, or working manifest would be greatly appreciated
Thanks in advance!
— Fabrizio Toniolo