Skip to content
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

Android distribution #54

Closed
luben opened this issue Feb 5, 2018 · 15 comments
Closed

Android distribution #54

luben opened this issue Feb 5, 2018 · 15 comments

Comments

@luben
Copy link
Owner

luben commented Feb 5, 2018

I have recently added Android support. Zstd-jni sources can be imported in Adroid Studio and used from Android apps. I am not familiar with the dependency management on Android and best practices for distributing libraries containing native shared objects. Any suggestions how improve over using zstd-jni as git sub-module will be highly appreciated.

@ItsShadowCone
Copy link

You should add these to the gitignore as they are produced at least by android studio. (not sure if the zstd-jni.iml is a generic one)

.externalNativeBuild/
zstd-jni.iml

@luben
Copy link
Owner Author

luben commented Feb 5, 2018

Good call! I missed them

@luben
Copy link
Owner Author

luben commented Apr 9, 2018

Any feedback from using it on Android is always welcome, even if you don't have suggestions how to improve it.

@yrom
Copy link

yrom commented May 29, 2018

I think you can publish the android library outputs, which named AAR, to maven central.

Run gradle assembleRelease, you'll see it in path like build/outputs/aar/zstd-jni-release.aar'. Rename this file to zstd-jni-VERSION.aar and upload it as a part of artifacts.

Android users can add it as an android library dependency, after uploaded:

dependencies {
    implementation "com.github.luben:zstd-jni:$VERSION@aar"
}

Sorry for my bad english, hope this helps 😄

@luben
Copy link
Owner Author

luben commented May 29, 2018

I will try this. One question, is it going to handle multiple platforms with it? Like arm32 vs aarch64?

@ItsShadowCone
Copy link

If I understood it correctly it would (like any android app), compile it for every Abi and include them in the aar file. Unless you have some specific magic running to make it work on android of course

@yrom
Copy link

yrom commented May 30, 2018

capture1
As you can see in this pic, android build tool would bundle all ABIs that android supported into aar. https://developer.android.com/ndk/guides/abis

@luben
Copy link
Owner Author

luben commented May 30, 2018

That's great, I will make a new release this week with it

@ghost
Copy link

ghost commented May 30, 2018

hi

how can I compress string data between android java and node js?

@luben
Copy link
Owner Author

luben commented Jun 1, 2018

I just pushed 1.3.4-9 with an aar included. It should arrive soon at maven central. Can you test if it works as expected?

@luben
Copy link
Owner Author

luben commented Jun 1, 2018

Hmm, for some reason, didn't shows on MavenCentral. Pushed a no-change release 1.3.4-10, hopefully it will show up.

@re-thc
Copy link

re-thc commented Jun 14, 2018

Might be a good idea to publish to jcenter? That's what Android uses as default.

@luben
Copy link
Owner Author

luben commented Jun 15, 2018

Good idea, I will investigate

@luben
Copy link
Owner Author

luben commented Jun 22, 2018

I have added a section in the README explaining how to add MavenCentral to the gradle/android repositories. For now will continue publishing just to MavenCentral - the release process is quite complicated and I don't want to add more overhead.

@luben
Copy link
Owner Author

luben commented Jun 22, 2018

Thanks a lot for all the help and suggestions. I am closing the issue as I think we have stable Android distribution channel now.

If you find any issue with the Android support, please open a new issue.

@luben luben closed this as completed Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants