You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xamarin.Android only provides bindings for Android's base framework android.jar. To use AndroidX API you need to add the relevant NuGet binding package.
I have 1.2.0.1 installed and have my app already working on their heads up display. I now need to add the surface callback. All I see exposed is ISurfaceCallback which does not have anything to override.
Just curious as I have no idea how long it takes to get a nuget with this fix. I can use a nightly build (I think I saw these somewhere) since we are not releasing this for over a month. Any way to do a short term work around?
There are some challenges to work through before packages can be updated to support default interface methods, so I would not expect them in the short term.
You should be able to implement the needed methods in C# with the correct signature and mark them with the [Export] attribute to force the correct Java Callable Wrapper to be generated. (Documentation)
Activity
dellis1972 commentedon Apr 5, 2023
@moljac @jpobst looks like we are missing something in androidx? Should we move this issue over to that repo?
jpobst commentedon Apr 5, 2023
Xamarin.Android only provides bindings for Android's base framework
android.jar. To use AndroidX API you need to add the relevant NuGet binding package.This API appears to be in this package:
https://www.nuget.org/packages/Xamarin.AndroidX.Car.App.App
vautieri2 commentedon Apr 5, 2023
I have 1.2.0.1 installed and have my app already working on their heads up display. I now need to add the surface callback. All I see exposed is ISurfaceCallback which does not have anything to override.
jpobst commentedon Apr 5, 2023
Looks like all the methods on the
SurfaceCallbackinterface aredefaultmethods, which I don't think are currently exposed in AndroidX.Yep, let's move this issue to the AndroidX repository.
vautieri2 commentedon Apr 5, 2023
Just curious as I have no idea how long it takes to get a nuget with this fix. I can use a nightly build (I think I saw these somewhere) since we are not releasing this for over a month. Any way to do a short term work around?
jpobst commentedon Apr 10, 2023
There are some challenges to work through before packages can be updated to support default interface methods, so I would not expect them in the short term.
You should be able to implement the needed methods in C# with the correct signature and mark them with the
[Export]attribute to force the correct Java Callable Wrapper to be generated. (Documentation)This would look something like:
vautieri2 commentedon Apr 14, 2023
"This would look something like:" I'm getting surface callbacks now! So this seems to be a workaround.
Enable DIM for AndroidX packages. (#718)
jpobst commentedon Jun 1, 2023
The referenced
defaultmethods should now be available in the latest version:https://www.fuget.org/packages/Xamarin.AndroidX.Car.App.App/1.2.0.3/lib/net6.0-android31.0/Xamarin.AndroidX.Car.App.App.dll/AndroidX.Car.App/ISurfaceCallback