user4071320
user4071320

Reputation:

Use Mono.Android in my PCL Xamarin Forms

I create a little project whitch use a public SDK DLL for a Android Device (RS30 (it's a barcode scanner))

And in this SDK DLL i can change a BeepSound (for example) when i gonna scan the barcode.

But, in my PCL, when i want to create an interface like this:

public interface IScannerService
{
    void StartService();

    void Test(BeepType beep);
}

I can't use BeepType because the SDK DLL use Mono.Android:

enter image description here

And my question is: How can i use/import or whatever to use BeepType with Mono.Android in my PCL Xamarin Forms.

Thank you

Upvotes: 1

Views: 441

Answers (2)

Softlion
Softlion

Reputation: 12625

You can't. You must define a new enum in the PCL (could be a copy of BeepType), and convert from it in your interface implementation.

Upvotes: 0

Jason
Jason

Reputation: 89204

Use DependencyService to call your platform specific code from within your Forms PCL. You will need to define a custom type or enum to map to BeepType.

Upvotes: 1

Related Questions