This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mTextRecognizer.setProcessor(new Detector.Processor() { | |
@Override | |
public void release() { | |
} | |
@Override | |
public void receiveDetections(Detector.Detections detections) { | |
SparseArray items = detections.getDetectedItems(); | |
StringBuilder stringBuilder = new StringBuilder(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mCameraSource = new CameraSource.Builder(getApplicationContext(), mTextRecognizer) | |
.setFacing(CameraSource.CAMERA_FACING_BACK) | |
.setRequestedPreviewSize(1280, 1024) | |
.setRequestedFps(15.0f) | |
.setAutoFocusEnabled(true) | |
.build(); | |
mSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() { | |
@Override | |
public void surfaceCreated(SurfaceHolder holder) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { | |
startTextRecognizer(); | |
} else { | |
askCameraPermission(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.example.textdetectionsample.MainActivity"> | |
<SurfaceView | |
android:id="@+id/surfaceView" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'com.google.android.gms:play-services-vision:11.8.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.CAMERA"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
apply plugin: 'com.jfrog.bintray' | |
apply plugin: 'com.github.dcendents.android-maven' | |
version = "2.0.6" | |
group = "com.example.mylibrary" | |
android { | |
compileSdkVersion 25 | |
buildToolsVersion "25.0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Build configuration for Circle CI | |
# | |
# See this thread for speeding up and caching directories: https://discuss.circleci.com/t/installing-android-build-tools-23-0-2/924 | |
# | |
general: | |
artifacts: | |
- /home/ubuntu/AndroidCI/app/build/outputs/apk/ |