I have a Xamarin Forms Application, which I would like to integrate with TC700H scanner.In my app, I listened to an Intent via BroadcastReceiver. I tried configuring my intentfilter action as per document and changed profile Intent delivery to broadcast, but no success. Am i missing something here ?
Scanner data using BroadcastReceiver (Xamarin Application)// Expert user has replied. |
1 Replies
Hi Soumya,
take a look at this sample application:
pfmaggi/Xam_BarcodeForms - GitHub
Is a Xamarin Forms application, using the Profile API to setup DataWedge to send a broadcast intent.
In the application there's a ScanReceiver class that implement the broadcast receiver and that is registered using the code:
// Register the broadcast receiverIntentFilter filter = new IntentFilter(ScanReceiver.IntentAction);filter.AddCategory(ScanReceiver.IntentCategory);Android.App.Application.Context.RegisterReceiver(_broadcastReceiver, filter);
The event handler uses the MessagingCenter to send the data to the Form so that it can display the data.
In addition this app, uses a DependencyService to send a DataWedge intent (the interface is in the Portable library, I've implemented only the Android side).
Ciao
~Pietro