-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a common class Wrapper and IterWrapper to wrap native resource. #25
base: main
Are you sure you want to change the base?
Conversation
8ce4ed1
to
929ae6d
Compare
Native resource (pointer to shared_ptr) is stored as a long in the `Wrapper.Resource` class. As Wrapper implements AutoCloseable and we register the (java) resource to be cleaned at object destruction, we now properly delete the native resource. This also adding new macro to avoid writting the class name and so reduce potential typos. # Conflicts: # lib/build.gradle # lib/src/main/java/org/kiwix/libkiwix/Library.java
This is ready for review. There is still a open question on the change of min sdk version (https://github.com/kiwix/java-libkiwix/pull/25/files#diff-655a69127303f6948c0b150902436756156ec7f82640e994c1f552cbdec5bbceL29-L33). This is needed to have the |
@mgautierfr , If we change minimum SDK version to 33 then it's only support the android 13 or above devices, we can not use this library below android 13. |
FYI Android 13 is latest stable and has only 12% market share (January 2023) |
Sounds like a nogo to make that move as such. What do we have as alternative? |
Keep the previous version using deprecated (but probably never removed) functions. |
OK, to me it sounds we should keep this PR for a moment and reassess the whole thing after next major release of kiwix-android. For the moment continue with the "old" approach. |
58516a2
to
f4b5d7a
Compare
@mgautierfr Would that be wise to keep this PR open longer without merging/finishing it? |
Native resource (pointer to shared_ptr) is stored as a long in the
Wrapper.Resource
class.As Wrapper implements AutoCloseable and we register the (java) resource to be cleaned at object destruction, we now properly delete the native resource.
This also adding new macro to avoid writting the class name and so reduce potential typos.