I am trying to create a Xamarin Java Binding to the Spotify Android SDK. The SDK is now separated into two parts, one for authentication and one for the player. The former java binding works, however, the seconds gives me an error.
The original question was asked on the Xamarin Forums.
Hi,
I am trying to create a binding project for the Spotify Android SDK.
The SDK is seperated into two .aar files. One for authentication and one for media playback (Player). Firstly I tried having both .aar files in one Binding Project, but the Player.aar was ignored. However, moving it to its own seem to work.
Now, my issue is related to the Java Interface NativePlayerNotificationCallback
which is generated to IPlayerNotificationCallback
(hence the lack og Notification), but in the Player class it tried to implement: global::Com.Spotify.Android.Player.INativePlayerNotificationCallback
.
I can find no other mention of INativePlayerNotificationCallback
in the decompiled files. Only IPlayerNotificationCallback
.
I understand that this is a bit difficult to imagine. Here are the java class files seen in JD-GUI:
The generated files are listed here:
Inside the file Com.Spotify.Sdk.Android.Player.IPlayerNotificationCallback.cs:
And the error message itself
Error CS0234: The type or namespace name INativePlayerNotificationCallback' does not exist in the namespaceCom.Spotify.Sdk.Android.Player'. Are you missing an assembly reference?
I would really appreciate any insight as to how I can get this to work. It looks to me like there are some inconsistencies in the naming of the interface, but I am not sure.
Thank you for helping out, Fredrik
Should be fixed by adding metadata to Player binding project:
and Player class extension (into the Additions directory):
You will probably need to implement these methods correctly by calling generic methods. Also I had to add metadata to Auth library binding project (I found it in your old topics) and referenced Auth project from Player project as it uses some of the classes (maybe that's no necessary).