Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import remote library in Android Studio using gradle?

I am trying to import android-swipelistview (https://github.com/47deg/android-swipelistview) into my Android Studio module using gradle. Shouldn't this be possible with build.gradle config alone? Does anyone have a config file(s) that does the job?

like image 917
Roar Skullestad Avatar asked Sep 02 '13 11:09

Roar Skullestad


People also ask

How do I import library to Android?

To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.

How do I import a module into gradle?

In Android Studio, Right-clicking on the folder to add as library. Editing the dependencies in the build. gradle file, adding: compile fileTree(dir: 'libs', include: '*. jar')}

How do I add a repository to gradle?

We can add a Maven repository to our project by using its url address or its location by adding that particular code snippet in our Gradle build script. To add a Maven repository by using its url, add the following code snippet to the 'build. gradle' file: repositories {


1 Answers

You can use:

compile 'com.nineoldandroids:library:2.4.0'

or if you have the library copied to your project libs directory, you can use:

compile files ('libs/ nineoldandroids-2.4.0.jar')

However, you can check out my post on getting started with swipelistview: http://modewagon.wordpress.com/2013/09/16/getting-started-with-swipelistview/

like image 182
Victor Odiah Avatar answered Oct 08 '22 04:10

Victor Odiah