File tree Expand file tree Collapse file tree 8 files changed +27
-24
lines changed
androidTest/java/com/example/nativeopencvandroidtemplate
java/com/example/nativeopencvandroidtemplate
kotlin/com/example/nativeopencvandroidtemplate Expand file tree Collapse file tree 8 files changed +27
-24
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ This sample Android application displays a live camera feed with an OpenCV *adap
1111| Tool | Version |
1212| --- | --- |
1313| [ OpenCV] ( https://opencv.org ) | 4.4.0
14- | [ Android Studio] ( https://developer.android.com/studio ) | 3.6.2
15- | [ Android Build Tool] ( https://developer.android.com/about ) | 29.0.1
16- | [ Android NDK] ( https://developer.android.com/ndk/guides ) | Revision r20
17- | [ Kotlin] ( https://kotlinlang.org/docs/reference/ ) | 1.3.50
18- | [ Gradle] ( https://gradle.org ) | 5.4 .1
19- | Mac OS | 10.15.4
14+ | [ Android Studio] ( https://developer.android.com/studio ) | 4.0.1
15+ | [ Android Build Tool] ( https://developer.android.com/about ) | 29.0.3
16+ | [ Android NDK] ( https://developer.android.com/ndk/guides ) | r21d
17+ | [ Kotlin] ( https://kotlinlang.org/docs/reference/ ) | 1.3.72
18+ | [ Gradle] ( https://gradle.org ) | 6.1 .1
19+ | Mac OS | 10.15.6
2020
2121## How to use this repository
2222
Original file line number Diff line number Diff line change @@ -5,15 +5,15 @@ apply plugin: 'kotlin-android'
55apply plugin : ' kotlin-android-extensions'
66
77android {
8- compileSdkVersion 28
9- buildToolsVersion " 29.0.1 "
8+ compileSdkVersion 30
9+ buildToolsVersion " 29.0.3 "
1010 defaultConfig {
1111 applicationId " com.example.nativeopencvandroidtemplate"
1212 minSdkVersion 28
13- targetSdkVersion 28
13+ targetSdkVersion 30
1414 versionCode 1
1515 versionName " 1.0"
16- testInstrumentationRunner " android.support. test.runner.AndroidJUnitRunner"
16+ testInstrumentationRunner ' androidx. test.runner.AndroidJUnitRunner'
1717 externalNativeBuild {
1818 cmake {
1919 cppFlags " -frtti -fexceptions"
@@ -34,15 +34,16 @@ android {
3434 version " 3.10.2"
3535 }
3636 }
37+ ndkVersion ' 21.3.6528147'
3738}
3839
3940dependencies {
4041 implementation fileTree(dir : ' libs' , include : [' *.jar' ])
4142 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
42- implementation ' com.android.support :appcompat-v7:28.0 .0'
43- implementation ' com.android.support.constraint:constraint-layout :1.1.3'
43+ implementation ' androidx.appcompat :appcompat:1.2 .0'
44+ implementation ' androidx.constraintlayout:constraintlayout :1.1.3'
4445 testImplementation ' junit:junit:4.12'
45- androidTestImplementation ' com.android.support. test:runner :1.0.2 '
46- androidTestImplementation ' com.android.support. test.espresso:espresso-core:3.0.2 '
46+ androidTestImplementation ' androidx. test.ext:junit :1.1.1 '
47+ androidTestImplementation ' androidx. test.espresso:espresso-core:3.2.0 '
4748 implementation project(path : ' :opencv' )
4849}
Original file line number Diff line number Diff line change 11package com.example.nativeopencvandroidtemplate
22
3- import android.support. test.InstrumentationRegistry
4- import android.support. test.runner .AndroidJUnit4
3+ import androidx. test.platform.app .InstrumentationRegistry
4+ import androidx. test.ext.junit.runners .AndroidJUnit4
55
66import org.junit.Test
77import org.junit.runner.RunWith
@@ -18,7 +18,7 @@ class ExampleInstrumentedTest {
1818 @Test
1919 fun useAppContext () {
2020 // Context of the app under test.
21- val appContext = InstrumentationRegistry .getTargetContext()
21+ val appContext = InstrumentationRegistry .getInstrumentation().targetContext
2222 assertEquals(" com.example.nativeopencvandroidtemplate" , appContext.packageName)
2323 }
2424}
Original file line number Diff line number Diff line change 44//import android.app.Activity;
55//import android.content.pm.PackageManager;
66//import android.os.Bundle;
7- //import android.support.v4 .app.ActivityCompat;
7+ //import androidx.core .app.ActivityCompat;
88//import android.util.Log;
99//import android.view.SurfaceView;
1010//import android.view.WindowManager;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import android.Manifest
44import android.app.Activity
55import android.content.pm.PackageManager
66import android.os.Bundle
7- import android.support.v4 .app.ActivityCompat
7+ import androidx.core .app.ActivityCompat
88import android.util.Log
99import android.view.SurfaceView
1010import android.view.WindowManager
Original file line number Diff line number Diff line change 11// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
33buildscript {
4- ext. kotlin_version = ' 1.3.50 '
4+ ext. kotlin_version = ' 1.3.72 '
55 repositories {
66 google()
77 jcenter()
88
99 }
1010 dependencies {
11- classpath ' com.android.tools.build:gradle:3.5 .1'
11+ classpath ' com.android.tools.build:gradle:4.0 .1'
1212 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
1313 // NOTE: Do not place your application dependencies here; they belong
1414 // in the individual module build.gradle files
Original file line number Diff line number Diff line change @@ -13,5 +13,7 @@ org.gradle.jvmargs=-Xmx1536m
1313# org.gradle.parallel=true
1414# Kotlin code style for this project: "official" or "obsolete":
1515kotlin.code.style =official
16+ android.useAndroidX =true
17+ android.enableJetifier =true
1618
17- opencvsdk =/Users/Example/Downloads/OpenCV-android-sdk
19+ opencvsdk =/Users/Example/Downloads/OpenCV-android-sdk
Original file line number Diff line number Diff line change 1- # Mon Sep 09 21:23:30 CEST 2019
1+ # Mon Aug 17 14:18:33 CEST 2020
22distributionBase =GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-5.4 .1-all.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-6.1 .1-all.zip
You can’t perform that action at this time.
0 commit comments