Merge pull request #401 from tink2123/add_android_doc
polish android readme
This commit is contained in:
commit
f7b5edcc72
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 105 KiB |
Binary file not shown.
After Width: | Height: | Size: 185 KiB |
|
@ -0,0 +1,57 @@
|
|||
# Android Demo 快速测试
|
||||
|
||||
|
||||
### 1. 安装最新版本的Android Studio
|
||||
|
||||
可以从 https://developer.android.com/studio 下载。本Demo使用是4.0版本Android Studio编写。
|
||||
|
||||
### 2. 创建新项目
|
||||
|
||||
Demo测试的时候使用的是NDK 20b版本,20版本以上均可以支持编译成功。
|
||||
|
||||
如果您是初学者,可以用以下方式安装和测试NDK编译环境。
|
||||
点击 File -> New ->New Project, 新建 "Native C++" project
|
||||
|
||||
|
||||
1. Start a new Android Studio project
|
||||
在项目模版中选择 Native C++ 选择PaddleOCR/depoly/android_demo 路径
|
||||
进入项目后会自动编译,第一次编译会花费较长的时间,建议添加代理加速下载。
|
||||
|
||||
**代理添加:**
|
||||
|
||||
选择 Android Studio -> Perferences -> Appearance & Behavior -> System Settings -> HTTP Proxy -> Manual proxy configuration
|
||||
|
||||
![](../demo/proxy.png)
|
||||
|
||||
2. 开始编译
|
||||
|
||||
点击编译按钮,连接手机,跟着Android Studio的引导完成操作。
|
||||
|
||||
在 Android Studio 里看到下图,表示编译完成:
|
||||
|
||||
![](../demo/build.png)
|
||||
|
||||
**提示:** 此时如果出现下列找不到OpenCV的报错信息,请重新点击编译,编译完成后退出项目,再次进入。
|
||||
|
||||
![](../demo/error.png)
|
||||
|
||||
### 3. 发送到手机端
|
||||
|
||||
完成编译,点击运行,在手机端查看效果。
|
||||
|
||||
### 4. 如何自定义demo图片
|
||||
|
||||
1. 图片存放路径:android_demo/app/src/main/assets/images
|
||||
|
||||
将自定义图片放置在该路径下
|
||||
|
||||
2. 配置文件: android_demo/app/src/main/res/values/strings.xml
|
||||
|
||||
修改 IMAGE_PATH_DEFAULT 为自定义图片名即可
|
||||
|
||||
|
||||
# 获得更多支持
|
||||
前往[端计算模型生成平台EasyEdge](https://ai.baidu.com/easyedge/app/open_source_demo?referrerUrl=paddlelite),获得更多开发支持:
|
||||
|
||||
- Demo APP:可使用手机扫码安装,方便手机端快速体验文字识别
|
||||
- SDK:模型被封装为适配不同芯片硬件和操作系统SDK,包括完善的接口,方便进行二次开发
|
|
@ -0,0 +1,60 @@
|
|||
# Android Demo quick start
|
||||
|
||||
### 1. Install the latest version of Android Studio
|
||||
|
||||
It can be downloaded from https://developer.android.com/studio . This Demo is written by Android Studio version 4.0.
|
||||
|
||||
### 2. Create a new project
|
||||
|
||||
The NDK version 20b is used in the demo test, and the compilation can be successfully supported for version 20 and above.
|
||||
|
||||
If you are a beginner, you can install and test the NDK compilation environment in the following ways.
|
||||
|
||||
File -> New ->New Project to create "Native C++" project
|
||||
|
||||
1. Start a new Android Studio project
|
||||
|
||||
Select Native C++ in the project template, select Paddle OCR/deploy/android_demo path
|
||||
After entering the project, it will be automatically compiled. The first compilation
|
||||
will take a long time. It is recommended to add an agent to speed up the download.
|
||||
|
||||
**Agent add:**
|
||||
|
||||
Android Studio -> Perferences -> Appearance & Behavior -> System Settings -> HTTP Proxy -> Manual proxy configuration
|
||||
|
||||
![](../demo/proxy.png)
|
||||
|
||||
2. Start compilation
|
||||
|
||||
Click the compile button, connect the phone, and follow the instructions of Android Studio to complete the operation.
|
||||
|
||||
When you see the following picture in Android Studio, the compilation is complete:
|
||||
|
||||
![](../demo/build.png)
|
||||
|
||||
**Tip:** At this time, if the following error message that OpenCV cannot be found appears, please re-click compile,
|
||||
exit the project after compiling, and enter again.
|
||||
|
||||
![](../demo/error.png)
|
||||
|
||||
### 3. Send to mobile
|
||||
|
||||
Complete the compilation, click Run, and check the effect on the mobile phone.
|
||||
|
||||
### 4. How to customize the demo picture
|
||||
|
||||
1. Image storage path: android_demo/app/src/main/assets/images
|
||||
|
||||
Place the custom picture under this path
|
||||
|
||||
2. Configuration file: android_demo/app/src/main/res/values/strings.xml
|
||||
|
||||
Modify IMAGE_PATH_DEFAULT to a custom picture name
|
||||
|
||||
# Get more support
|
||||
|
||||
Go to [EasyEdge](https://ai.baidu.com/easyedge/app/open_source_demo?referrerUrl=paddlelite) to get more development support:
|
||||
|
||||
- Demo APP: You can use your mobile phone to scan the code to install, which is convenient for the mobile terminal to quickly experience text recognition
|
||||
|
||||
- SDK: The model is packaged to adapt to different chip hardware and operating system SDKs, including a complete interface to facilitate secondary development
|
Loading…
Reference in New Issue