GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DevLucem/Android-Text-Scanner: Read text and numbers with android camera OCR

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
characterscanner
characterscanner
 
 
gradle/wrapper
gradle/wrapper
 
 
scanexample
scanexample
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Text and Numbers Recognizer Lucem

This library is an easy to implement and use for scanning text and numbers using the camera (Optical Character Recognition) on android devices.

You can view my my app here where i use this library Scan Credo I appreciate your download and rating of this app.

Scan Sample

Implementation

Add jitpack to repositories in the root build.gradle file

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add this dependency line in your build.gradle app level

dependencies {
	implementation 'com.github.Lucem-Anb:android-text-scanner:@Version'
}

😃😃😃😃😃😃😃😃

Usage

This library uses the SurfaceView to display the camera. Detected values are accessed using a listener. There are two ways of using this library, let's start with the simple one

Option 1

Create the ScannerView in your Activity or fragment

<com.lucem.anb.characterscanner.ScannerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/scanner"/>

Start the scan whenever you want

ScannerView scanner = findViewById(R.id.scanner);
scanner.setOnDetectedListener(this, new ScannerListener() {
            @Override
            public void onDetected(String detections) {
                Toast.makeText(MainActivity.this, detections, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onStateChanged(String state, int i) {
                Log.d("state", state);
            }
        });

Option 2

Create a surface view in your activity or fragment

<SurfaceView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/surface"/>

Initialize your Scanner and pass your activity and surface view

SurfaceView surfaceView = findViewById(R.id.surface);
Scanner scanner = new Scanner(this, surfaceView, new ScannerListener() {
        @Override
        public void onDetected(String detections) {
            Toast.makeText(MainActivity.this, detections, Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onStateChanged(String state, int i) {
            Log.d("state", state);
        }
    });
    

More Customization

showToasts(boolean); Enable or disable recognition engine alert

getState(); return a String of the current state

onStateChanged(); Called when the scanning state is changed

setScanning(boolean) Start or Stop scanning state

Latest Version: 0.1.0

About

Read text and numbers with android camera OCR

Topics

cameraocrocr-androidocr-recognitiontextrecognition

Resources

Readme
GPL-3.0 license
Activity

Stars

31 stars

Watchers

2 watching

Forks

10 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.