Add the Oracle Android Client SDK to the Project
Here are details on adding the Oracle Android Native Client SDK to your project.
To add the SDK using the Arctic Fox version of Android Studio or higher:
- Download the ODA Client SDK for Android and extract it to your local system.
- In Android Studio, select your project's
app
directory. - Select the
libs
directory. - Add
com.oracle.bots.client.sdk.android.core-24.12.aar
andcom.oracle.bots.client.sdk.android.ui-24.12.aar
to thelibs
folder. - Add the following to the dependencies to the
build.gradle
(Module: app
) file. These dependencies include:- The SDK library dependency
- Core and UI dependencies - Used by the SDK library for the smooth functioning of
library
features.
// SDK implementation files('libs/com.oracle.bots.client.sdk.android.ui-24.12.aar') implementation files('libs/com.oracle.bots.client.sdk.android.core-24.12.aar') // Core dependencies implementation 'androidx.room:room-runtime:2.6.1' implementation 'io.socket:socket.io-client:0.8.3' implementation 'androidx.core:core:1.15.0' //UI dependencies implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.2.0' implementation 'androidx.webkit:webkit:1.12.1' implementation 'com.google.android.material:material:1.12.0' implementation 'com.intuit.sdp:sdp-android:1.0.6' implementation 'com.squareup.picasso:picasso:2.8' implementation 'com.google.android.gms:play-services-location:21.3.0'
- Update the
AndroidManifest.xml
file with the permissions that will enable the host application to use the features supported by the Android Client SDK. You must declare these permissions in the manifest starting from Version 24.12 and higher of the Android Client SDK.Note
You can omit permissions that don't apply to your application.<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/> <uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"/> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" android:required="false" />
For prior versions for Android Studio:
- Select your project's
app
directory and then click File> New> New Module. - Choose Import JAR/.AAR Package and then click Next.
- Navigate to, and select,
com.oracle.bots.client.sdk.android.core-24.08.aar
. Click Finish. - Repeat these steps to import
com.oracle.bots.client.sdk.android.ui-24.08.aar
. - Ensure that these libraries are listed at the top of project's
settings.gradle
file. For example:include ':app', ':com.oracle.bots.client.sdk.android.core-24.12', ':com.oracle.bots.client.sdk.android.ui-24.12' rootProject.name = 'ODASDKSample'
- Add the following to the dependencies in the
build.gradle (Module: app)
file. These dependencies include:- The SDK library dependency
- Core and UI dependencies which are used by the SDK library for the smooth
functioning of library features.
// SDK implementation files('libs/com.oracle.bots.client.sdk.android.ui-24.08.aar') implementation files('libs/com.oracle.bots.client.sdk.android.core-24.08.aar') // Core dependencies implementation 'androidx.room:room-runtime:2.5.1' implementation 'io.socket:socket.io-client:0.8.3' implementation 'androidx.core:core:1.8.0' //UI dependencies implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.webkit:webkit:1.10.0' implementation 'com.google.android.material:material:1.8.0' implementation 'com.intuit.sdp:sdp-android:1.0.6' implementation 'com.squareup.picasso:picasso:2.8' implementation 'com.google.android.gms:play-services-location:21.2.0'