diff --git a/datawedge-MAUI-SampleApp/MainPage.xaml b/datawedge-MAUI-SampleApp/MainPage.xaml
index a653e78..c647309 100644
--- a/datawedge-MAUI-SampleApp/MainPage.xaml
+++ b/datawedge-MAUI-SampleApp/MainPage.xaml
@@ -65,6 +65,13 @@
HorizontalOptions="Center" />
+
+
diff --git a/datawedge-MAUI-SampleApp/MainPage.xaml.cs b/datawedge-MAUI-SampleApp/MainPage.xaml.cs
index 74edcc3..8fc9ec7 100644
--- a/datawedge-MAUI-SampleApp/MainPage.xaml.cs
+++ b/datawedge-MAUI-SampleApp/MainPage.xaml.cs
@@ -42,6 +42,12 @@ private void OnDWONClicked(object sender, EventArgs e)
{
WeakReferenceMessenger.Default.Send("22");
WeakReferenceMessenger.Default.Send("SWITCHING ON DW");
+ }
+
+ private void OnDWGetActiveProfile(object sender, EventArgs e)
+ {
+ WeakReferenceMessenger.Default.Send("33");
+ WeakReferenceMessenger.Default.Send("GETTING ACTIVE PROFILE");
}
}
diff --git a/datawedge-MAUI-SampleApp/Platforms/Android/AndroidManifest.xml b/datawedge-MAUI-SampleApp/Platforms/Android/AndroidManifest.xml
index a17a634..295a309 100644
--- a/datawedge-MAUI-SampleApp/Platforms/Android/AndroidManifest.xml
+++ b/datawedge-MAUI-SampleApp/Platforms/Android/AndroidManifest.xml
@@ -1,8 +1,7 @@
-
-
+
-
+
diff --git a/datawedge-MAUI-SampleApp/Platforms/Android/DWIntentReceiver.cs b/datawedge-MAUI-SampleApp/Platforms/Android/DWIntentReceiver.cs
index 68779d9..166bae9 100644
--- a/datawedge-MAUI-SampleApp/Platforms/Android/DWIntentReceiver.cs
+++ b/datawedge-MAUI-SampleApp/Platforms/Android/DWIntentReceiver.cs
@@ -5,29 +5,56 @@
using CommunityToolkit.Mvvm.Messaging;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Diagnostics.Metrics;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;
+using System.Xml.Linq;
namespace datawedge_MAUI_SampleApp.Platforms.Android
{
- [BroadcastReceiver(Enabled = true, Exported =true)]
- [IntentFilter(new[] { "com.ndzl.DW" })]
- public class DWIntentReceiver : BroadcastReceiver
+[BroadcastReceiver(Enabled = true, Exported =true)]
+public class DWIntentReceiver : BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
- //System.Console.WriteLine("Here is DW on MAUI");
- if (intent.Extras != null)
- {
- String bc_type = intent.Extras.GetString("com.symbol.datawedge.label_type");
- String bc_data = intent.Extras.GetString("com.symbol.datawedge.data_string");
-
- WeakReferenceMessenger.Default.Send(bc_type + " "+ bc_data);
- }
+ System.Console.WriteLine("Here is DW on MAUI");
+ if (intent.Extras != null)
+ {
+ if (intent.HasExtra("com.symbol.datawedge.label_type")) {
+ String bc_type = intent.Extras.GetString("com.symbol.datawedge.label_type");
+ String bc_data = intent.Extras.GetString("com.symbol.datawedge.data_string");
+
+ WeakReferenceMessenger.Default.Send(bc_type + " " + bc_data);
+ }
+ else if (intent.HasExtra("com.symbol.datawedge.api.RESULT_GET_ACTIVE_PROFILE"))
+ {
+ String activeProfile = intent.Extras.GetString("com.symbol.datawedge.api.RESULT_GET_ACTIVE_PROFILE");
+
+ try
+ {
+ WeakReferenceMessenger.Default.Send("ACTIVE PROFILE=<" + activeProfile + ">");
+ }
+ catch (Exception e) { }
+ }
+ else if (intent.HasExtra("com.symbol.datawedge.api.RESULT_GET_PROFILES_LIST"))
+ {
+ String[] profilesList = intent.Extras.GetStringArray("com.symbol.datawedge.api.RESULT_GET_PROFILES_LIST");
+
+ try
+ {
+ WeakReferenceMessenger.Default.Send("profilesList size =<" + profilesList.Length + ">");
+ }
+ catch (Exception e) { }
+ }
+
+ }
+
+
+
}
diff --git a/datawedge-MAUI-SampleApp/Platforms/Android/MainActivity.cs b/datawedge-MAUI-SampleApp/Platforms/Android/MainActivity.cs
index 5c89010..a7f525b 100644
--- a/datawedge-MAUI-SampleApp/Platforms/Android/MainActivity.cs
+++ b/datawedge-MAUI-SampleApp/Platforms/Android/MainActivity.cs
@@ -37,7 +37,7 @@ protected override void OnPostCreate(Bundle savedInstanceState)
i.PutExtra("COMMAND_IDENTIFIER", "MY_DISABLE_SCANNER"); //Unique identifier
this.SendBroadcast(i);
}
- else if (li=="22") {
+ else if (li == "22") {
Intent i = new Intent();
i.SetAction("com.symbol.datawedge.api.ACTION");
i.PutExtra("com.symbol.datawedge.api.SCANNER_INPUT_PLUGIN", "ENABLE_PLUGIN");
@@ -45,6 +45,14 @@ protected override void OnPostCreate(Bundle savedInstanceState)
i.PutExtra("COMMAND_IDENTIFIER", "MY_ENABLE_SCANNER"); //Unique identifier
this.SendBroadcast(i);
}
+ else if (li == "33") {
+
+ global::Android.Content.Intent i = new global::Android.Content.Intent();
+ i.SetAction("com.symbol.datawedge.api.ACTION");
+ i.PutExtra("com.symbol.datawedge.api.GET_ACTIVE_PROFILE", "" );
+ //i.PutExtra("com.symbol.datawedge.api.GET_PROFILES_LIST", "" );
+ SendBroadcast(i);
+ }
});
});
@@ -74,8 +82,8 @@ void RegisterReceivers()
IntentFilter filter = new IntentFilter();
filter.AddCategory("android.intent.category.DEFAULT");
filter.AddAction("com.ndzl.DW");
- filter.AddAction("com.zebra.sensors");
-
+ filter.AddAction("com.symbol.datawedge.api.RESULT_ACTION");
+
Intent regres = RegisterReceiver(new DWIntentReceiver(), filter);
}
}