/OSS-DocumentScanner

Android document document scanning app

Primary LanguageC++MIT LicenseMIT

Contributor Covenant GitHub repo stars GitHub License GitHub All Releases GitHub release Small translation badge

Installation

Get it on IzzyOnDroid Get it on PlayStore Get it on GitHub

Download on the App Store

Enjoying OSS Document Scanner?

Please consider making a small donation to help fund the project. Developing an application, especially one that is open source and completely free, takes a lot of time and effort.

❤️ Sponsor

Open Source app to scan your documents.

Screenshots

| | | |

Having issues, suggestions and feedback?

You can,

Contributors

Thanks to our contributors:

Languages: Übersetzungsstatus

Übersetzungsstatus

The Translations are hosted by Weblate.org.

Building Setup

This repo can be used to build 2 different apps: OSS DocumentScanner and OSS CardWallet

Those apps are using Nativescript which is a cross platform framework to build apps for iOS/Android

Setup / Environment

This project uses a few environment variables. While most are for publishing and thus not necessary for most, some are used to decide which app to build:

  • APP_ID: com.akylas.documentscanner or com.akylas.cardwallet
  • APP_BUILD_PATH: build/documentscanner or build/cardwallet
  • APP_RESOURCES: App_Resources/documentscanner or App_Resources/cardwallet

You can either define them yourself. If you are using vscode the vscode/settings.json of this repo defines different custom shells which will try to source .env.documentscanner and .env.cardwallet. To do this it use the plugin dotenv from omzsh here If those variables are not define the project will default to variables for OSS DocumentScanner

Nativescript

First setup Nativescript

This project is optimized to be built with Akylas Fork. Though it would work with main it is best to use this fork. The package.json defines a resolution to ../NativeScript/dist/packages/core so clone the fork and build it using npm run setup:yarn && npm run ui-mobile-base:build && npm run core:build

Another change is that this project uses new features of the Nativescript cli which were not released yet. So for now you need to clone it, build with npm run setup then use it with PATH_TO_CLI_FOLDER/bin/ns

3rd parties

This app also uses opencv and tesseract. I did not include the libraries in git because there are huge and would make the github repo too big. There are 2 ways to install them:

  • download from here and uncompress them at the root
  • build them yourself:

OpenCV

  • Android: You can download Opencv 4.8.0 for android here. Then place the necessary libs/includes in the opencv/android at the root of this repo like shown here: opencv directory structure

  • iOS : You can download Opencv 4.8.0 for iOS here. Then place the opencv2.xcframework in the opencv/ios at the root of this repo

This should be enough. Android and iOS build will use it using symlinks

Tesseract

It is a bit trickier for Tesseract as we need to compile it

  • Android:

    • clone https://github.com/Akylas/Tesseract4Android
    • build with ./gradlew assembleRelease
    • search for the built static libs (search for libtesseract.a) in tesseract4android/build/intermediates/cxx/*/obj
    • copy the static libs and the includes(in tesseract4android/src/main/cpp/tesseract/src/include) in the tesseract/android at the root of this repo like shown here: opencv directory structure
  • iOS:

Yarn

You need to use yarn with this project as it uses the portal: protocol for some dependencies. Note that the project has some yarn link for easy local dev for me. The best is for you to remove the resolutions part of the package.json

Building

Now that all is setup and that you prepared the 3rd party libraries you can actually build and run the app:

  • yarn
  • ns run android --no-hmr --env.devlog (replace by ios for iOS...)

This should run the app on the first discovered device or emulator.