search

Home  >  Q&A  >  body text

android studio 里面 怎么使用别人的项目呢

从 github上面下载的代码,比如ui控件,是不是要把 这个项目 打包jar .然后 放到自己项目的libs才能用?

黄舟黄舟2773 days ago657

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-17 14:40:22

    How Gradle uses other people’s projects. . The words go in two directions. .

    1. Publishing projects in Maven or jcenter is very simple, just add it directly to build.gradle in the app directory, like below

      dependencies {

         ...
         compile 'com.squareup.retrofit:retrofit:1.9.0'
         ...
         }
         

      Here I am using version 1.9.0 of retrofit.

    2. Add an Android Studio project and call its libraries. In fact, it is very simple. Copy the entire project and a name will be generated in Android Studio, such as your_project

    It’s ok to write like this at this time

    dependencies {
        ...
        compile project(':your_project')
        ...
        }

    reply
    0
  • Cancelreply