如何在Github上创建一个库,并使用它通过在Android中的gradle工作室依赖

如何在Github上创建一个库,并使用它通过在Android中的gradle工作室依赖

问题描述:

我要创建库并通过互联网访问它。
在Android Studio中(通过摇篮)的依赖性可能会以这种方式补充:

I want to create the library and have access to it through the Internet. In Android Studio (via Gradle) dependency may be added in this way:

的build.gradle (模块的应用程序):

In build.gradle (Module app):

dependencies {
    ...
    compile 'com.android.support:design:23.1.0'
    compile 'com.squareup:otto:1.3.8'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.j256.ormlite:ormlite-core:4.48'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    ...
}

如何添加自己的库以这种方式从GitHub?

How can I add my own library in this way from github?

Jitpack 是最好的导入您的项目或从 Github上来gradle这个

Refer Jitpack is best to import your project or libs from Github to gradle

有关详细信息,请参阅加布里埃莱马里奥蒂答案

For more information refer Gabriele Mariotti answer