79430403

Date: 2025-02-11 15:01:16
Score: 1.5
Natty:
Report link

To close the question, and for anyone it could help, i'll answer what i found.

The reason why I wanted to "disable dollars in name" is that, when Binding with the Android Binding Library, warnings were issued and binds were skipped.

The fact is that, thoses binds were useless. Because even if they were skipped, the android library itself still had access to the components (for example, the composable Greeting). And importants things like the activity were binded anyways, and so, was useable with C#.

So the problem was a non problem.

If you are trying to bind an Android Library and face the same warnings, they probably aren't important, and the best manner is to take care of everything in the metadata.xml of your Android Binding Library.

See https://learn.microsoft.com/en-us/dotnet/android/binding-libs/customizing-bindings/java-bindings-metadata
and most importantly

https://saratsin.medium.com/how-to-bind-a-complex-android-library-for-xamarin-with-sba-9a4a8ec0c65f
basically removing everything in the package, then only adding manually what is important to expose from your android library

That is for the case where all warnings are about non important components. If your important components are skipped, you should understand that binding components from your android library, in java or kotlin, that have java specific things like for example parameters types, is not possible (afaik). You should try to wrap them into less specific and more bindable components.

For example, it's not possible to bind and expose a Composable, because of the auto generated lambda with a dollar in the name. That's why I wrapped it in a ComponentActivity, that is bindable for C#.

Hope that'll help

Reasons:
  • Blacklisted phrase (0.5): medium.com
  • Long answer (-1):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Foxan