Skip to content
Tiem Song edited this page Nov 11, 2015 · 1 revision

Let's getting start to use AndroidImageSlider.

The first thing you have to do, is to load this library to your environment.

Adding The Library

Step 1

If you are using Android Studio, just add the following code to your project root build.gradle.

dependencies {
    compile "com.android.support:support-v4:+"
    compile 'com.squareup.picasso:picasso:2.3.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
}

Then click the sync now button in the Android Studio toolbar to make sure that the library will be downloaded to the local storage.

If you are using maven to manage your project, add the following to your pom.xml:

<dependency>
    <groupId>com.squareup.picasso</groupId>
    <artifactId>picasso</artifactId>
    <version>2.3.2</version>
</dependency>
<dependency>
    <groupId>com.nineoldandroids</groupId>
    <artifactId>library</artifactId>
    <version>2.4.0</version>
</dependency>
<dependency>
    <groupId>com.daimajia.slider</groupId>
    <artifactId>library</artifactId>
    <version>1.0.9</version>
    <type>apklib</type>
</dependency>

Step 2

Add permissions (if necessary) to your AndroidManifest.xml

<!-- if you want to load images from the internet -->
<uses-permission android:name="android.permission.INTERNET" /> 

<!-- if you want to load images from a file OR from the internet -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Note: If you want to load images from the internet, you need both the INTERNET and READ_EXTERNAL_STORAGE permissions to allow files from the internet to be cached into local storage.

If you want to load images from drawable, then no additional permissions are necessary.

That's it for configuration, Let's start to using this.

Clone this wiki locally