Updated example to not use native activity anymore
This commit is contained in:
parent
ba70a4c666
commit
a73f82e191
23 changed files with 321 additions and 163 deletions
|
|
@ -1,4 +1,6 @@
|
|||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
Properties properties = new Properties()
|
||||
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
||||
|
|
@ -6,12 +8,13 @@ def ndkDir = properties.getProperty('ndk.dir')
|
|||
def valLayerBinDir = "${ndkDir}/sources/third_party/vulkan/src/build-android/jniLibs"
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
compileSdkVersion 29
|
||||
ndkVersion '21.2.6472646'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.ethicalml.kompute.examples.android"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
versionCode = 1
|
||||
versionName = "0.0.1"
|
||||
externalNativeBuild {
|
||||
|
|
@ -26,29 +29,57 @@ android {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled = false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
||||
'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path 'src/main/jni/CMakeLists.txt'
|
||||
path 'src/main/cpp/CMakeLists.txt'
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
jniLibs {
|
||||
// Must have ndk-r12 or better which including layer binaries
|
||||
srcDirs = ["${valLayerBinDir}"]
|
||||
// Must have ndk-r12 or better which including layer binaries
|
||||
srcDirs = ["${valLayerBinDir}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled = false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
flavorDimensions 'cpuArch'
|
||||
productFlavors {
|
||||
arm8 {
|
||||
dimension 'cpuArch'
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a', 'armeabi-v7a'
|
||||
}
|
||||
}
|
||||
}
|
||||
x86_64 {
|
||||
dimension 'cpuArch'
|
||||
ndk {
|
||||
abiFilters 'x86_64', 'x86'
|
||||
}
|
||||
}
|
||||
universal {
|
||||
dimension 'cpuArch'
|
||||
// include all default ABIs. with NDK-r16, it is:
|
||||
// armeabi-v7a, arm64-v8a, x86, x86_64
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue