add java android demo (#1454)

This commit is contained in:
JameWade
2024-10-23 11:38:26 +08:00
committed by GitHub
parent bcaa91ed36
commit 3edd8d7cf6
45 changed files with 1268 additions and 0 deletions

View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,43 @@
plugins {
id 'com.android.library'
}
android {
namespace 'com.k2fsa.sherpa'
compileSdk 34
defaultConfig {
minSdk 26
targetSdk 27
versionCode 1
versionName "1.0"
missingDimensionStrategy 'base', 'feature1'
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"
// implementation libs.material
// testImplementation libs.junit
// androidTestImplementation libs.androidx.test.ext.junit
// androidTestImplementation libs.espresso.core
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

View File

@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true" />
</manifest>

View File

@@ -0,0 +1 @@
../../../../../../../sherpa-onnx/sherpa-onnx/java-api/src/com

View File

@@ -0,0 +1,3 @@
<resources>
<string name="app_name">sherpa</string>
</resources>