Android Studio Tutorials || Adding a Jar library

TwistedEquations · 114K views · 2014 · 6:44

Open on YouTube

Software practice, open source & careersTesting, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering how to add external JAR files to an Android Studio project, as a visual walkthrough alongside Gradle snippets.

Recommended by 2 people across 2 different months, 2014 to 2016.

What it is

A short 2014 screencast showing how to add a .jar library to an Android Studio project, from the early days of the IDE and its Gradle build setup. It is presented by the TwistedEquations channel as part of an Android Studio tutorial series.

What people said

Recommends AndroidProgrammer · 2015-04 · Stack Overflow · on “Adding Library to project in Android Studio”

You add your library in your libs directory like here: C:\Users\Blabala\Desktop\Project\app\libs and then you write in gradle this: dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') } also you can watch this [this video] tutorial. More information here [LINK] UPDATE: C:\Users\Balbala\Desktop\appname\Library just add the library in project then rebuild the project and you are good to go But you will have to change the manifest of Library like this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" [LINK] " package="com.example.blabala"> <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="21"/> <application/> </manifest>

Recommends Yassine Faradi · 2016-08 · Stack Overflow · on “Yandex API Translator not working on Android Aplication”

I use this code here [LINK] and it works fine for me 1: add json_simple-1.1.jar to your project Tutorial [this video] 2: copy classes code from yandex-translator-java-api/src/com/rmtheis/yandtran/ to your project 3: Put your API key in ApiKeys.java 4: put this lines to translate a text: Translate.setKey(ApiKeys.YANDEX_API_KEY); String translatedText = Translate.execute("Hola, mundo!", Language.SPANISH, Language.ENGLISH); 5: if you get android.os.NetworkOnMainThreadException error that's because this exception is thrown when an application attempts to perform a networking operation on its main thread, Solution : -- Add this lines in your YandexTranslatorApi.java static class RetrieveResponse exten

Cites AnujAroshA · 2014-02 · Stack Overflow · on “Adding a jar library for Android project in Android Studio 0.4.2”

I'm a newbie to Android Studio IDE. I used to implement Android application, using Eclipse IDE. As a beginner in Android Studio, I tried this lesson from YouTube [this video] to include a external jar file to my project and use it. But unfortunately I'm unable to use that library even though the Gradle or Android build doesn't throw any error/exception when compile and run. I've seen related questions from SO too. As an example, I've tried out things that discuss in this question [LINK] . In the build.gradle file, I used compile files('libs/jsoup-1.7.3.jar') and next time used compile fileTree(dir: 'libs', include: '*.jar') Neither work for me. After editing that build.gradle file, I used Sync Pr

Cites Igor Soudakevitch · 2015-03 · Stack Overflow · on “how to import javax.swing in android studio”

I used to have the same problem; here's how to solve it. You see, we were trying to use swing lib in a totally wrong context, that is, within an Android app . As Scott Barta pointed out, Android has its own mechanisms for doing what we wanted to achieve and that's why IntelliJ didn't let us import anything that would interfere with Android API. Hence, do NOT use Android app when, say, simply learning how to code in Java or, on a more advanced level, when testing/debugging your algorithms. Instead, build a standalone Java program (yes, in Android Studio). This very topic is covered here: Can Android Studio be used to run standard Java projects? [LINK] , "Tested on Android Studio 0.8.6 - 1.0.2

Cites thienkhoi tran · 2015-03 · Stack Overflow · on “Cannot import ksoap2 to Android Studio”

At first, You should remove ksoap in Project Structure and do the steps bellow. I have same problem and here is the way which work for me. 1st: Make folder libs in app/libs. 2nd: Copy ksoap.jar to this folder. 3rd: right click to Jar file and chose add as library. From now, you can import ksoap2 to your code normally. You can create an object from ksoap2, the library will be imported automatically. Ex: type SoapObject tempResponse = null import org.ksoap2.SoapObject; import org.ksoap2.serialization.PropertyInfo; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapPrimitive; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.Http