OpenCV Android SDK modified to use in Android Studio
1.Copy the opencv-android.jar to app->libs in your project.
2.Open build.gradle and add the following line to the dependencies block.
compile files('libs/opencv-android.jar')
3.Sync the project.
1.Create a local.properties file and define Android SDK path.
sdk.dir=/home/rajamalw/android-sdk-linux
Replace /home/rajamalw/android-sdk-linux with your SDK path.
2.Export Gradle path. For example in Ubuntu.
export PATH="/home/rajamalw/gradle/gradle-3.3/bin:$PATH"
Replace /home/rajamalw/gradle/gradle-3.3/bin with your Gradle path.
3.Use the following Commands to generate JAR.
gradle build
gradle jar
4.The JAR will be generated in build/libs.