Skip to content

Java DataBinding support #7714

Open
Open

Description

@DouglasGiovanella

Android application type

Classic Xamarin.Android (MonoAndroid12.0, etc.), Android for .NET (net6.0-android, etc.)

Affected platform version

All

Description

I had opened a feature request on the visual studio feedback site, but in 3 months i didn't receive any feedback :( (https://developercommunity.visualstudio.com/t/Support-for-binding-a-library-that-uses-/10214966)

But to be able to discuss this topic with the community, i'm opening this issue.

We use a paid security third party library that only has Android/iOS native support, but we maintain a Binding for both versions, so was not a problem so far. The problem started some time a go, because they start using DataBinding in their Android SDK, blocking us to receive any update for some time now.

Since i didn't find any workarounds for this, its a big problem for us for a security point of view.
Also, it looks like google will not drop this any time soon and more libraries will use this since there is already in stable version, blocking the use of this libraries in any xamarin project.

Relates to: #3853

Steps to Reproduce

Just try binding a android library that has databinding enabled in his build.gradle:

android {
    ...
    buildFeatures {
        dataBinding true
    }
}

Did you find any workaround?

no

Relevant log output

No response

Activity

  1. added
    enhancementProposed change to current functionality.
    Area: BindingsIssues in Java Library Binding projects.
    and removed
    needs-triageIssues that need to be assigned.
    on Jan 23, 2023
  2. added this to the Under Consideration milestone on Jan 23, 2023
  3. jpobst commented on Jan 23, 2023

    @jpobst
    Contributor

    Supporting Java DataBinding is not currently on our roadmap.

    It is rather complex to integrate into our build system, as we do not currently invoke gradle during builds. I think what would need to happen is the step that compiles the generated Java callable wrappers would need to be changed to invoke gradle instead of javac. Additionally there would need to be a mechanism to add arbitrary gradle commands to this invocation. I think there are also Java annotations that we would need to add to the JCWs.

    We will continue to monitor the need for this (and other enhancements that require adding gradle to the build, potentially AndroidX.Room(?)) for future prioritization.

  4. changed the title [-]Support for binding a library that uses DataBinding[/-] [+]Java DataBinding support[/+] on Jan 24, 2023
  5. GalaxiaGuy commented on Jan 27, 2023

    @GalaxiaGuy

    For reference, here is another thing that would benefit from gradle support:

    xamarin/GooglePlayServicesComponents#172

  6. ziomek64 commented on Aug 13, 2024

    @ziomek64

    Supporting Java DataBinding is not currently on our roadmap.

    It is rather complex to integrate into our build system, as we do not currently invoke gradle during builds. I think what would need to happen is the step that compiles the generated Java callable wrappers would need to be changed to invoke gradle instead of javac. Additionally there would need to be a mechanism to add arbitrary gradle commands to this invocation. I think there are also Java annotations that we would need to add to the JCWs.

    We will continue to monitor the need for this (and other enhancements that require adding gradle to the build, potentially AndroidX.Room(?)) for future prioritization.

    What are the current options to have UI binded to properties in code in native Android .NET then? And I don't want to explicitly set texts, images through code each time. MVVMCross seems like an overkill for me and completely overwhelming to start using. Bindings are so much easier in MAUI using XAML and INotifyPropertyChanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: BindingsIssues in Java Library Binding projects.enhancementProposed change to current functionality.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions