Skip to content

Using already generated bindings when generating new bindings #621

Closed as not planned

Description

@pdegand

Hi,

I generated bindings for the androidx.security-crypto library based on the example for Health Connect and everything went smoothly.

As the builder of the EncryptedSharedPreference needs a Context, I added android.content.Context to the list of classes in the JNIGen config file.

And I packaged my generated bindings in a reusable package.

Now let's say I would like to generate binding for HealthConnect, or any other Jetpack library.
Those library will almost certainly use the Context class so I will have to also add the Context class in the config file for my new binding.
If I package these new bindings in a reusable package as well and I use both my package of security-crypto & heathConnect, I will have twice the binding for the Context class.

Is there a way to generate the binding for Context once, package it into a reusable library and use this library for both the bindings of security-crypto & HealthConnect so that in the end, I will have only 1 implementation for the bindings for android.content.Context ?

Side question : is this even a good "practice" to generate binding of such a big class as Context or should I rather just use the context as JObject and calling its method with callMethodByName ?

Thank you :)

Activity

  1. dcharkes commented on May 31, 2023

    @dcharkes
    Collaborator

    Hi @pdegand!

    This is being tracked in:

    And @HosseinYousefi landed some initial work today to support this! 🎉

    Please follow the mentioned issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions