CommunityToolkit / Maui.NativeLibraryInterop

Maui.NativeLibraryInterop is a community-created library of binding samples to help .NET MAUI developers interop with native libraries more easily
MIT License
168 stars 26 forks source link

I don't know how to use it? #52

Open honeyhead opened 1 week ago

honeyhead commented 1 week ago

Description

I opened the project in Android Studio, navigated to the Native folder, built the Gradle project, and confirmed that the .aar file was generated with the latest timestamp. I then opened the Sample project, which refers to the NewBinding.Android.Binding project.

`

false false

` The issue is with the following line:

`#if ANDROID using NewBinding = NewBindingAndroid.DotnetNewBinding;

endif

`

I can't find NewBindingAndroid.DotnetNewBinding.

It would be great if you could provide a "step-by-step" explanation, as I'm having a hard time understanding anything outside of MAUI.

How can I use this correctly?

Also, I have another question:

Assuming you are able to get this working, would it be possible to use this method to switch activities from pop-ups or other windows when implementing SDKs used for marketing tools?

Steps to Reproduce

I wrote it in the description

Link to public reproduction project repository

No response

Environment

rachelkang commented 4 days ago

Hi, @honeyhead - Thank you for checking out Native Library Interop! If you haven't already, I highly recommend checking out the documentation at https://learn.microsoft.com/dotnet/communitytoolkit/maui/native-library-interop/get-started which may include some of the explanations you are looking for. If there is anything additional you wish the documentation would cover, please let us know.

As per the docs, NewBindingAndroid.DotnetNewBinding is located at https://github.com/CommunityToolkit/Maui.NativeLibraryInterop/blob/main/template/android/native/newbinding/src/main/java/com/example/newbinding/DotnetNewBinding.java