android image slider with indicator updated

Adding android image slider with indicator in your application is best way to boost your user experience .

In this blog we will see how to add android image slider with indicator in your application.

android image slider with indicator updated
http://techtibet.com/blog
Project Structure

Content

  1. Add Glide library for loading image(you can use Picasso as well)
  2. Add Internet permission in manifest.
  3. Design activity_main.xml
  4. Design layout_slider.xml (new layout for viewpager)
  5. Create new Adapter for viewpager( SliderPagerAdapter )
  6. Code in MainActivity.java

1.

Add glide library in your project buid.gradle

2.

Add internet permission in AndroidManifest.xml

3.

Add ViewPager to load image and LinearLayout to add indicator in activity_main.xml

In activity_main.xml

4.

Create Layout for single Image design

Create new Layout from res ,

In layout_slider.xml

5.

Create New Adapter called SliderPagerAdapter.java to get all the image from MainActivity.java and display in ViewPager.

In SliderPagerAdapter.java

6.

Now In MainActivitty.java

That all, If you get any error while copy make sure you import all the package.

Now wen you run the project you should able too see image slider.

Also read How to add ads in your app

Made with ❤

1 thought on “android image slider with indicator updated

  1. […] If you want slider in single activty please read Adding slider image in android. […]

Leave a Comment

Your email address will not be published. Required fields are marked *