Click here to Skip to main content
14,698,734 members
Articles » Mobile Development » Android » General
Tip/Trick
Posted 17 Jun 2013

Tagged as

Stats

89.8K views
11 bookmarked

How to add external library file in Android Studio

Rate me:
Please Sign up or sign in to vote.
5.00/5 (7 votes)
17 Jun 2013CPOL
This article will give you a good idea about adding external jar files in Android Studio.

Introduction

Here I am going to give a sample example of how to add the ksoap2 jar library in Android Studio. Adding external library in Eclipse is different with Android Studio. You can download the ksoap2.jar file from:

Using the code 

For adding the ksoap2 file we have put that file in the libs folder, project->libs.Open the libs folder in Explorer and paste the ksoap2 jar file in it. Come to studio and refresh the project. We will see the ksoap file in the libs folder. Now right click the ksoap file and select the Add as library option. Then a new create library window will open. Click on OK. Now we can use this jar file for our application. Also add  the below code in the build.gradle file and rebuild the application.

dependencies{ compile files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar') }

Image 1

History 

For more information check this link: 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

josh-jw
India India
No Biography provided

Comments and Discussions

 
GeneralMy vote of 5 Pin
_Vitor Garcia_18-Jun-13 7:19
Member_Vitor Garcia_18-Jun-13 7:19 
GeneralRe: My vote of 5 Pin
josh-jw19-Jun-13 18:47
Memberjosh-jw19-Jun-13 18:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.