Skip to content

Commit

Permalink
OcrLiteAndroidNcnn项目升级1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminwan committed Oct 28, 2021
1 parent 3c9d720 commit a95c936
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 32 deletions.
40 changes: 24 additions & 16 deletions android_projects/OcrLiteAndroidNcnn/OcrLibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-parcelize'
}

android {
compileSdkVersion 31
compileSdkVersion compile_sdk_version

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
versionCode 8
versionName "1.6"
minSdkVersion min_sdk_version
targetSdk target_sdk_version
versionCode project_version_code
versionName project_version_name

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -21,19 +23,25 @@ android {
}
}

externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
}
}

flavorDimensions 'ocr_library_types'
productFlavors {
Expand All @@ -58,7 +66,7 @@ android {
libraryVariants.all {
variant ->
variant.outputs.all {
outputFileName = "${project.name}-${variant.flavorName}-${defaultConfig.versionName}.aar"
outputFileName = "${project.name}-${defaultConfig.versionName}-${variant.flavorName}-${variant.buildType.name}.aar"
}
}
}
Expand Down
12 changes: 9 additions & 3 deletions android_projects/OcrLiteAndroidNcnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

* QQ①群:994929053
* QQ②群:820132154
* QQ③群:904091319

## 项目完整源码

Expand All @@ -42,7 +43,6 @@
## APK下载

* 编译好的demo apk,可以在release中下载,或者Q群共享内下载,文件名例:OcrLiteAndroidNcnn-版本号-cpu-release.apk
* 或者[Gitee下载](https://gitee.com/benjaminwan/ocr-lite-android-ncnn/releases)
* 或者[Github下载](https://github.com/benjaminwan/OcrLiteAndroidNcnn/releases)

## 简介
Expand All @@ -67,7 +67,7 @@ Chineseocr Lite Android Ncnn Demo,超轻量级中文OCR Android Demo,支持n

## 更新说明

#### 2021-09-28 update
#### 2021-09-28 update 1.6.0

* opencv 3.4.15(特别说明:4.5.3也可以支持,如果换成cv4,minSdkVersion必须改为24)
* ncnn 20210720
Expand All @@ -76,6 +76,11 @@ Chineseocr Lite Android Ncnn Demo,超轻量级中文OCR Android Demo,支持n
* 升级各dependencies
* 使用kotlin coroutines代替rxjava

#### 2021-10-28 update 1.6.1

* 编辑build.gradle,把版本定义放到root build.gradle
* 编辑github workflow config,上传aar文件到release

## 编译说明

1. AndroidStudio 2020.3.1或以上;
Expand All @@ -95,7 +100,8 @@ Chineseocr Lite Android Ncnn Demo,超轻量级中文OCR Android Demo,支持n
└── keys.txt
```

5. 下载opencv-mobile-3.4.15-android.7z,[下载地址](https://gitee.com/benjaminwan/ocr-lite-android-ncnn/attach_files/843219/download/opencv-mobile-3.4.15-android.7z)
5.
下载opencv-mobile-3.4.15-android.7z,[下载地址](https://gitee.com/benjaminwan/ocr-lite-android-ncnn/attach_files/843219/download/opencv-mobile-3.4.15-android.7z)
解压后目录结构为

```
Expand Down
26 changes: 14 additions & 12 deletions android_projects/OcrLiteAndroidNcnn/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
}

android {
signingConfigs {
Expand All @@ -13,14 +15,14 @@ android {
}
}

compileSdkVersion 31
compileSdkVersion compile_sdk_version

defaultConfig {
applicationId "com.benjaminwan.ocr.ncnn"
minSdkVersion 21
targetSdkVersion 31
versionCode 21
versionName "1.6.0.20210928"
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode project_version_code
versionName project_version_name
signingConfig signingConfigs.ocr
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -89,10 +91,10 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.1'

//lifecycle
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-beta01'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-rc01'

//glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation project(":OcrLibrary")

implementation 'com.github.chrisbanes:PhotoView:2.3.0'
Expand All @@ -109,7 +111,7 @@ dependencies {
// CameraX Lifecycle library
implementation "androidx.camera:camera-lifecycle:$camerax_version"
// CameraX View class
implementation 'androidx.camera:camera-view:1.0.0-alpha29'
implementation 'androidx.camera:camera-view:1.0.0-alpha30'

//cameraMask 相机遮罩
implementation 'jsc.kit.cameramask:camera-mask:0.3.0'
Expand Down
7 changes: 6 additions & 1 deletion android_projects/OcrLiteAndroidNcnn/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.31"
ext.compile_sdk_version = 31
ext.min_sdk_version = 21
ext.target_sdk_version = 31
ext.project_version_code = 22
ext.project_version_name = "1.6.1"
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down

0 comments on commit a95c936

Please sign in to comment.