How to Publish Library to Jitpack.io with Android Studio
Published in
2 min readMay 25, 2018
When we develop Android application, there are many third parties or libraries we can use, including Android support itself. Many repositories provide that library, for example Maven Central, Bintray, Jitpack.io, etc. In this article, we will explain the step-by-step process of publishing a library to Jitpack.io with Android studio.
- Create new project, and fill the name.
- After project is ready, create new module in File -> New -> New Module. Choose Android Library.
- Fill the name with the library we want (ex: Temperature Converter).
- Add classpath dependencies in parent gradle.
classpath 'com.github.dcendents:android-maven-gradle-plugin:$latest_version'
- Apply plugin and set group id based on your github in gradle module.
apply plugin: 'com.github.dcendents.android-maven'...group = 'com.github.adef145'
Now start code
Formula for temperature conversion is like this:
- R = (4/5) C
- F = (9/5) C + 32
- K = C + 273
We will create an Enum that have 4 properties.
After your code is complete, you just put your project into Github and create Release.
Wait a moment and your library is ready to use.
https://jitpack.io/#adef145/TemperatureConverterAndroid/1.0
Hope this article is useful. Clap if you like it :)