kiwix / java-libkiwix

Libkiwix binding for Java & Kotlin
https://central.sonatype.com/artifact/org.kiwix/libkiwix
GNU General Public License v3.0
3 stars 4 forks source link

Added .so file while initlizing JNIKiwix class which we have missed #40

Closed MohitMaliFtechiz closed 1 year ago

MohitMaliFtechiz commented 1 year ago

Fixes #39

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (ab7bbc1) 92.65% compared to head (eaa957f) 92.65%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #40 +/- ## ========================================= Coverage 92.65% 92.65% Complexity 212 212 ========================================= Files 43 43 Lines 286 286 Branches 3 3 ========================================= Hits 265 265 Misses 18 18 Partials 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

mgautierfr commented 1 year ago

I wonder if we could have a static block to initialize this. This way you wouldn't have to call JNIKiwix() at all.

MohitMaliFtechiz commented 1 year ago

I wonder if we could have a static block to initialize this. This way you wouldn't have to call JNIKiwix() at all.

We can directly load these .so files into Android code as mentioned below Screenshot from 2023-07-13 18-55-32

For making the static block:

Relinker needs the Android context to load the .so files, so we need to provide the context to it, for this reason, it has done this way.

As we can do this on the Android side, we can manage the loading of the bindings on the Android side.

mgautierfr commented 1 year ago

Relinker needs the Android context to load the .so files, so we need to provide the context to it, for this reason, it has done this way.

Indeed.

As we can do this on the Android side, we can manage the loading of the bindings on the Android side.

Are you saying that we should remove JNIKiwix function from the wrapper ? You will doing it on caller (android, test) side ?

MohitMaliFtechiz commented 1 year ago

Are you saying that we should remove JNIKiwix function from the wrapper ? You will doing it on caller (android, test) side ?

@mgautierfr, Yes we can directly load the .so files of libkiwix in Android code with relinker as mentioned in the above screenshot.

kelson42 commented 1 year ago

Sorry for jumping here, but this is the role of the library to handle all these .so details. Library should just work when imported in kiwix-android.