Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 8 MAUI #1

Closed
FrantisekPregis opened this issue Feb 2, 2024 · 5 comments
Closed

.NET 8 MAUI #1

FrantisekPregis opened this issue Feb 2, 2024 · 5 comments

Comments

@FrantisekPregis
Copy link

Hi,

I can´t get this running in .NET 8 MAUI, there is some problem with Android framework targeting. My Zebra MC3300 (API 30) device does not show up in Visual Studio 2022 and an Android target is not listed in the project properties. I tried to copy the relevant files to a new project (MainPage, DWIntentReceiver and MainActivity) but the app didn´t do anything when scanning, I probably missed something.

What am I doing wrong?

Frantisek

@NDZL
Copy link
Collaborator

NDZL commented Feb 2, 2024 via email

@NDZL
Copy link
Collaborator

NDZL commented Feb 2, 2024

Frantisek, my reply via email dropped the pictures, see the PDF attached.
br
NDZL

MAUI DW Issue.pdf

@NDZL NDZL closed this as completed Feb 2, 2024
@FrantisekPregis
Copy link
Author

Thanks for the quick response, I got it working! Just another quick question: do you have a similar simple example of sending intents to the device? If I e.g. want to turn off the scanner. I experimentally added three lines of code in your receiving class, just to quickly test turning the scanner off but it didn´t work. This should be a part of some "BroadcastSender" class - but how should it be done? Sorry for mixing another question with this issue, but many people would like to know I guess... Or is there any .NET documention which could be used? I searched, but found only Java / Android examples.

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);

            **intent.SetAction("com.symbol.datawedge.api.ACTION");
            intent.PutExtra("com.symbol.datawedge.api.SCANNER_INPUT_PLUGIN", "DISABLE_PLUGIN");
            context.SendBroadcast(intent);**
        }
	}
}

@NDZL
Copy link
Collaborator

NDZL commented Feb 2, 2024

A new commit is now available with a DW off/on feature added.
FYI DW Intent APIs reference is found here https://techdocs.zebra.com/datawedge/latest/guide/api/

@FrantisekPregis
Copy link
Author

Thanks, I will try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants