Adding external library in Android studio

前端 未结 19 1093
面向向阳花
面向向阳花 2020-11-22 05:51

I want to add external library https://github.com/foursquare/foursquare-android-oauth to my Android application (I use Android Studio, the instructions provided by lib autho

19条回答
  •  终归单人心
    2020-11-22 06:38

    Three ways in android studio for adding a external library.

    1. if you want to add libarary project dependency in your project :

      A. In file menu click new and choose import module choose your library project path and click ok, library project automatically add in your android studio project .

      B. Now open your main module(like app) gradle file and add project dependency in dependency section dependencies {

      compile project(':library project name')

    2. if you want to add jar file : A. add jar file in libs folder. B. And Add dependency

      compile fileTree(dir: 'libs', include: '*.jar') // add all jar file from libs folder, if you want to add particular jar from libs add below dependency.

      compile files('libs/abc.jar')

    3. Add Dependency from url (recommended). like

      compile 'com.mcxiaoke.volley:library-aar:1.0.0'

提交回复
热议问题