zebradevs / datawedge-flutter-demo Goto Github PK
View Code? Open in Web Editor NEWDemo application to show basic barcode capture in Flutter apps using DataWedge on Zebra devices
License: MIT License
Demo application to show basic barcode capture in Flutter apps using DataWedge on Zebra devices
License: MIT License
Hello,
I have this problem :
Restarted application in 2.991ms.
[38;5;248m════════ Exception caught by services library ══════════════════════════════════�[39;49m
[38;5;244mThe following MissingPluginException was thrown while activating platform stream on channel com.example.bacode_scanner_zebra/scan:�[39;49m
MissingPluginException(No implementation found for method listen on channel com.example.bacode_scanner_zebra/scan)
[38;5;244mWhen the exception was thrown, this was the stack�[39;49m
�[38;5;244m#0 MethodChannel._invokeMethod�[39;49m
package:flutter/…/services/platform_channel.dart
�[38;5;244m�[39;49m
�[38;5;244m#1 EventChannel.receiveBroadcastStream.�[39;49m
package:flutter/…/services/platform_channel.dart
[38;5;244m�[39;49m
[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
E/flutter ( 8996): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method createDataWedgeProfile on channel com.example.bacode_scanner_zebra/command)
[38;5;244mE/flutter ( 8996): #0 MethodChannel._invokeMethod�[39;49m
package:flutter/…/services/platform_channel.dart
E/flutter ( 8996):
[38;5;248mE/flutter ( 8996): #1 _MyHomePageState._createProfile�[39;49m
package:bacode_scanner_zebra/main.dart
E/flutter ( 8996):
E/flutter ( 8996):
I/flutter ( 8996): TAP
I/flutter ( 8996): UNTAP
E/flutter ( 8996): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method sendDataWedgeCommandStringParameter on channel com.example.bacode_scanner_zebra/command)
�[38;5;244mE/flutter ( 8996): #0 MethodChannel._invokeMethod�[39;49m
package:flutter/…/services/platform_channel.dart
E/flutter ( 8996):
�[38;5;248mE/flutter ( 8996): #1 _MyHomePageState._sendDataWedgeCommand�[39;49m
package:bacode_scanner_zebra/main.dart
E/flutter ( 8996):
E/flutter ( 8996):
E/flutter ( 8996): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method sendDataWedgeCommandStringParameter on channel com.example.bacode_scanner_zebra/command)
[38;5;244mE/flutter ( 8996): #0 MethodChannel._invokeMethod�[39;49m
package:flutter/…/services/platform_channel.dart
E/flutter ( 8996):
[38;5;248mE/flutter ( 8996): #1 _MyHomePageState._sendDataWedgeCommand�[39;49m
package:bacode_scanner_zebra/main.dart
E/flutter ( 8996):
E/flutter ( 8996):
Hello, when I quit your demo application so this error exception is showed:
E/ActivityThread( 5050): Activity com.darryncampbell.datawedgeflutter.MainActivity has leaked IntentReceiver com.darryncampbell.datawedgeflutter.MainActivity$createDataWedgeBroadcastReceiver$1@547c660 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread( 5050): android.app.IntentReceiverLeaked: Activity com.darryncampbell.datawedgeflutter.MainActivity has leaked IntentReceiver com.darryncampbell.datawedgeflutter.MainActivity$createDataWedgeBroadcastReceiver$1@547c660 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread( 5050): at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1351)
E/ActivityThread( 5050): at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1132)
E/ActivityThread( 5050): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1421)
E/ActivityThread( 5050): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1394)
E/ActivityThread( 5050): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1382)
E/ActivityThread( 5050): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:609)
E/ActivityThread( 5050): at com.darryncampbell.datawedgeflutter.MainActivity$configureFlutterEngine$1.onListen(MainActivity.kt:38)
E/ActivityThread( 5050): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:188)
E/ActivityThread( 5050): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167)
E/ActivityThread( 5050): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/ActivityThread( 5050): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/ActivityThread( 5050): at android.os.MessageQueue.nativePollOnce(Native Method)
E/ActivityThread( 5050): at android.os.MessageQueue.next(MessageQueue.java:325)
E/ActivityThread( 5050): at android.os.Looper.loop(Looper.java:142)
E/ActivityThread( 5050): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/ActivityThread( 5050): at java.lang.reflect.Method.invoke(Native Method)
E/ActivityThread( 5050): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/ActivityThread( 5050): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I understand that there is somewhere missing unregisterReceiver()
function which is called for unregister dataWedge.
How can I prevent this error?
Hi guys, I had to work on this kind of stuff so since looks like this repository is not mantained anymore I've fixed this project by myself for any current conflict issue with latest flutter.
Hope this fork helps who is looking for a working example.
I need to develop an Android application that should receive barcode and RFID scans from the Zebra RFD8500 reader. I don't have an Android Zebra device, just a regular Android.
Can i use DataWedge with this setup?
If not, should i use the Zebra Scanner SDK to get the barcodes and the Zebra RFID SDK to get the RFID reads? Does the Zebra RFID SDK works on non-Zebra Android devices?
It's not possilbe to test this DataWedge app.. Any newer ones?
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at
Hi!
We are experiencing major problems on the SymbolZebra MC18 in combination with Flutter. We've built apps using DataWedge on MC18 and PS20 devices, but performance on MC18 is terrible, making the device unusable. User presses a button and the app freezes for 2 seconds... We know this is a rather old device with a limited CPU/GPU, but performance is ok, when these lag spikes are gone. We have already filed a issue for it for the Flutter Team (flutter/flutter#71315), but we're wondering...
We haven't encountered this bug with native Android development or Xamarin development.
Best regards,
Mark
Hi, I am using this on MC3300. Is there a way for me to switch between the RFID mode and barcode mode?
I'm developing a flutter project that has a feature to scan and capture the barcode with TC21, but I can not find any api to get a picture of the barcode when it is in 2D Barcode Imager mode. Is there any way for me to get a barcode image with TC21 when it is in 2D Barcode imager mode?
I need get the RSSI value, on my flutter app, but i only receive scanData and symbology for each scanned tag.
Hello,
I followed the instructions building and loading the app, but it appears the DataWedge profile was not being created.
The app began functioning properly when i manually created the profile using the provided screenshots.
I am vetting using this over react native and doing some hacks with keyboard and input.
Would want auto profile creation for mass deployments.
The device i am testing on is a TC20 DataWedge 6.6.49
Is possible change the Default value, for the RFID Hardware Key on Datawedge profile?
Hi,
I have a new MC9300 that comes with Datawedge 8.2.4 and for some reason is acting different than the previous 7.3 version.
I'll try to explain: When my TextField has the focus and I hit the scan trigger, it gets the value on the onEvent function, but right after DataWedge inject the scanned code again, duplicating the code.
Manually I disable the "Keystroke Output" and it seems to help. I'm trying to disable keystroke output at the moment of the profile creating but is not working. Here is my code. Can you help me?
private fun createDataWedgeProfile(profileName: String) {
// Create and configure the DataWedge profile associated with this application
// For readability's sake, I have not defined each of the keys in the DWInterface file
dwInterface.sendCommandString(this, DWInterface.DATAWEDGE_SEND_CREATE_PROFILE, profileName)
val profileConfig = Bundle()
profileConfig.putString("PROFILE_NAME", profileName)
profileConfig.putString("PROFILE_ENABLED", "true") // These are all strings
profileConfig.putString("CONFIG_MODE", "UPDATE")
val barcodeConfig = Bundle()
barcodeConfig.putString("PLUGIN_NAME", "BARCODE")
barcodeConfig.putString("RESET_CONFIG", "true") // This is the default but never hurts to specify
val barcodeProps = Bundle()
barcodeConfig.putBundle("PARAM_LIST", barcodeProps)
profileConfig.putBundle("PLUGIN_CONFIG", barcodeConfig)
val appConfig = Bundle()
appConfig.putString("PACKAGE_NAME", packageName) // Associate the profile with this app
appConfig.putStringArray("ACTIVITY_LIST", arrayOf("*"))
profileConfig.putParcelableArray("APP_LIST", arrayOf(appConfig))
dwInterface.sendCommandBundle(this, DWInterface.DATAWEDGE_SEND_SET_CONFIG, profileConfig)
// You can only configure one plugin at a time in some versions of DW, now do the intent output
profileConfig.remove("PLUGIN_CONFIG")
val intentConfig = Bundle()
intentConfig.putString("PLUGIN_NAME", "INTENT")
intentConfig.putString("RESET_CONFIG", "true")
val intentProps = Bundle()
intentProps.putString("intent_output_enabled", "true")
intentProps.putString("intent_action", PROFILE_INTENT_ACTION)
intentProps.putString("intent_delivery", PROFILE_INTENT_BROADCAST) // "2"
intentConfig.putBundle("PARAM_LIST", intentProps)
profileConfig.putBundle("PLUGIN_CONFIG", intentConfig)
val keystrokeConfig = Bundle()
keystrokeConfig.putString("PLUGIN_NAME", "KEYSTROKE")
keystrokeConfig.putString("RESET_CONFIG", "true")
val keystrokeProps = Bundle()
keystrokeProps.putString("keystroke_output_enabled", "false")
keystrokeConfig.putBundle("PARAM_LIST", keystrokeProps)
profileConfig.putBundle("PLUGIN_CONFIG", keystrokeConfig)
dwInterface.sendCommandBundle(this, DWInterface.DATAWEDGE_SEND_SET_CONFIG, profileConfig)
}
I am trying to send emulated scan event to the app running under Android Emulator. I am following this guide. What should be the service name in place of com.zebra.dwapiexerciser.ACTION?
I'd need a quick way to check whether the device is running on has got zebra enabled scanners attached. The ENUMERATE_SCANNERS should do the trick, but I wasn't able to implement it correctly yet.
I tweaked the example code as follows:
private val ENUMERATE_SCANNERS_ACTION = "com.dancam.wings.ENUMERATE_SCANNERS"
...
EventChannel(flutterEngine.dartExecutor, SCAN_CHANNEL).setStreamHandler(
object : EventChannel.StreamHandler {
private var dataWedgeBroadcastReceiver: BroadcastReceiver? = null
override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
dataWedgeBroadcastReceiver = createDataWedgeBroadcastReceiver(events)
val intentFilter = IntentFilter()
intentFilter.addAction(PROFILE_INTENT_ACTION)
intentFilter.addAction(ENUMERATE_SCANNERS_ACTION)
intentFilter.addAction(DWInterface.DATAWEDGE_RETURN_ACTION)
intentFilter.addCategory(DWInterface.DATAWEDGE_RETURN_CATEGORY)
registerReceiver(
dataWedgeBroadcastReceiver, intentFilter)
}
override fun onCancel(arguments: Any?) {
unregisterReceiver(dataWedgeBroadcastReceiver)
dataWedgeBroadcastReceiver = null
}
}
)
private fun createDataWedgeBroadcastReceiver(events: EventChannel.EventSink?): BroadcastReceiver? {
return object : BroadcastReceiver() {
@SuppressLint("SimpleDateFormat")
override fun onReceive(context: Context, intent: Intent) {
if (intent.action.equals(PROFILE_INTENT_ACTION)) {
// A barcode has been scanned
val scanData = intent.getStringExtra(DWInterface.DATAWEDGE_SCAN_EXTRA_DATA_STRING)
val symbology = intent.getStringExtra(DWInterface.DATAWEDGE_SCAN_EXTRA_LABEL_TYPE)
val dateInMillis = System.currentTimeMillis()
val df = SimpleDateFormat("dd/MM/yyyy HH:mm:ss")
df.timeZone = TimeZone.getTimeZone("UTC")
val dateTimeString = df.format(Date(dateInMillis))
val currentScan = Scan(scanData!!, symbology!!, dateTimeString)
events?.success(currentScan.toJson())
}
if (intent.action.equals(ENUMERATE_SCANNERS_ACTION)) {
val scannerList = intent.getSerializableExtra("com.symbol.datawedge.api.RESULT_ENUMERATE_SCANNERS") as ArrayList<*>
events?.success(scannerList.size)
}
}
}
}
I was expecting to be able to call
sendDataWedgeCommand("com.symbol.datawedge.api.ENUMERATE_SCANNERS", "");
from the dart/flutter app and get the result.
Has anyone implemented this already, who can lend me a hand? Once I get it to work, it'd be great to create a PR for future reference too!
hello there, is there any way i can get printer history records?
Custom code in MainActivity.kt results in plugin errors. Like barcode_scan, sqflite plugin or path_provider. When I delete the code inside MainActivity(), it works. Any idea how to solve it?
Error messages be like:
MissingPluginException(No implementation found for method requestCameraPermission on channel de.mintware.barcode_scan)
Hi,
my problem when i install a plugin (example Cloud Firestore) the plugin is not working/found in the flutter part.
Thanks,
Thomas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.