Skip to content

Instantly share code, notes, and snippets.

View nandantal's full-sized avatar
🎯
Focusing

Nandan Dutta nandantal

🎯
Focusing
  • Talentica Software
View GitHub Profile
mTextRecognizer.setProcessor(new Detector.Processor() {
@Override
public void release() {
}
@Override
public void receiveDetections(Detector.Detections detections) {
SparseArray items = detections.getDetectedItems();
StringBuilder stringBuilder = new StringBuilder();
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) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
startTextRecognizer();
} else {
askCameraPermission();
}
<?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"
compile 'com.google.android.gms:play-services-vision:11.8.0'
<uses-permission android:name="android.permission.CAMERA"/>
@nandantal
nandantal / build.gradle
Created February 21, 2017 02:33
//build.gradle for bintray upload
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"
@nandantal
nandantal / circle.yml
Created December 7, 2016 10:27 — forked from donnfelker/circle.yml
Updated circle.yml file
#
# 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/