Sunday, May 25, 2014

Android Studio - How to add a jar library

I download this demo from the link below and found out when build it, it says missing the android support lib v4, so I started to looking for solution of how to add a jar library. Found video below:

http://www.e-nature.ch/tech/simple-tutorial-for-a-smooth-horizontal-view-slider-with-android/

The link below can get you started, but you need to read through the entire view since he made a mistake then he corrected it.

https://www.youtube.com/watch?v=fHEvI_G6UtI

The above video ia not completely correct according to current Android studio (I am using 0.5.8)

below is how I added jar file for andriod support v4

Find the jar file first then do copy

In Android studio create a new directory "libs" right click on your app (see below)

create the libs folder

Paste the jar file

Confirm


you have to change build.gradle file, add dependencies. NOTE the video on top does not work at this point, I have to changed to use the format below to make it work

dependencies{
    compile files ('libs/android-support-v4.jar')
}

I got help from the link below:




From here to project build and working



No comments:

Post a Comment