How to import external Jar files as libraries in Android Studio Environment?

In this video it shows the steps to include the external Jar files in your Android Studio as libraries.

It shows how the gradle file gets updated by adding the Jar files in the Android Studio environment.

I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: programmerworld1990@gmail.com

Complete source code:

package com.programmerworld.importjarfiles;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import java.sql.SQLException;

import oracle.jdbc.datasource.impl.OracleDataSource;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

try {
OracleDataSource oracleDataSource = new OracleDataSource();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
}
}
plugins {
id 'com.android.application'
}

android {
compileSdk 31

defaultConfig {
applicationId "com.programmerworld.importjarfiles"
minSdk 29
targetSdk 31
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation files('libs\\ojdbc11.jar')
implementation files('libs\\ons.jar')
implementation files('libs\\oraclepki.jar')
implementation files('libs\\orai18n.jar')
implementation files('libs\\osdt_cert.jar')
implementation files('libs\\osdt_core.jar')
implementation files('libs\\rsi.jar')
implementation files('libs\\simplefan.jar')
implementation files('libs\\ucp11.jar')
implementation files('libs\\xdb.jar')
implementation files('libs\\xmlparserv2.jar')
implementation files('libs\\xmlparserv2_sans_jaxp_services.jar')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

Leave a Reply

%d bloggers like this:
Available for Amazon Prime