Reputation: 144
I developed some algorithms to calculate health-related parameters by using heart rates. I want to give it to other developers. But don't want to expose the implementation of functions. Like iOS does with frameworks. Is there any solution to create frameworks in Android like this?
Upvotes: 0
Views: 556
Reputation: 28856
Android's build system (Gradle) allows to define dependencies to other artifacts / libraries.
A library on iOS is the equivalent of a jar
file on Android.
A framework on iOS is the equivalent of an aar
file on Android (aar = Android archive).
https://developer.android.com/studio/projects/android-library explains in detail how libraries are created. There are multiple ways how a library can be linked to a project:
implementation("group:artifact:version")
dependency), there's plenty of articles that explain publication or artifacts of a Maven repository, one of them is my own article here: https://medium.com/nerd-for-tech/the-better-maven-central-90d7e529d606Note: no matter what you do, the consumer of the library can still see the details of the implementation since the IDE can decompile the code. Depending on the reasons why you want to hide the details of the implementation there's different solutions:
Upvotes: 2