Skip to content

Commit

Permalink
Modifications for new update.
Browse files Browse the repository at this point in the history
Modifications in test application w.r.t new SDK version.
  • Loading branch information
Amalkarunakaran committed Jun 21, 2023
1 parent c8b0026 commit 425b1d0
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 21 deletions.
15 changes: 15 additions & 0 deletions java_sample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
1 change: 1 addition & 0 deletions java_sample/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
3 changes: 2 additions & 1 deletion java_sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.extrieve.quickcapture:QCv2:2.1.2'
/*DEV_HELP : link the preferred SDK version from maven repo by extrieve.*/
implementation 'com.extrieve.quickcapture:QCv3:3.0.5'
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package com.extrieve.quickcapture.docappjava;

import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import android.app.Activity;
import android.content.ContextWrapper;
import android.content.Intent;
Expand All @@ -17,15 +9,21 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.Settings;
import android.util.Log;
import android.widget.ImageView;
import android.widget.Toast;

/*DEV_HELP : Import SDK from QuickCapture lib with : com.extrieve.quickcapture.sdk.**/
import com.extrieve.quickcapture.sdk.*;
import com.extrieve.quickcapture.sdk.CameraSupport.CamConfigClass;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import com.extrieve.quickcapture.sdk.CameraHelper;
import com.extrieve.quickcapture.sdk.Config;
import com.extrieve.quickcapture.sdk.ImgHelper;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -105,7 +103,7 @@ private void SetConfig() {
ImageHelper.SetDPI(200);//int dpi_val = 100, 150, 200, 300, 500, 600;

//can set output file path
CamConfigClass.OutputPath = BuildStoragePath();
Config.CaptureSupport.OutputPath = BuildStoragePath();
}

/*DEV_HELP : BuildStoragePath*/
Expand All @@ -130,7 +128,7 @@ private void handleCaptureActivityResult(ActivityResult result){
String Description = (String) data.getExtras().get("DESCRIPTION");
if (!Status) {
String imageCaptureLog = "Description : " + Description +
".Exception: " + CameraSupport.CamConfigClass.LastLogInfo;
".Exception: " + Config.CaptureSupport.LastLogInfo;
Log.d("INFO", imageCaptureLog);
Toast.makeText(this, imageCaptureLog, Toast.LENGTH_LONG).show();
finishActivity(REQUEST_CODE_FILE_RETURN);
Expand Down Expand Up @@ -175,7 +173,7 @@ private void OpenCameraActivity() {
try {
/*DEV_HELP :redirecting to camera*/
Intent CameraIntent = new Intent(this, Class.forName("com.extrieve.quickcapture.sdk.CameraHelper"));
Uri photoURI = Uri.parse(CamConfigClass.OutputPath);
Uri photoURI = Uri.parse(Config.CaptureSupport.OutputPath);
this.grantUriPermission(this.getPackageName(), photoURI,
Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
Expand Down
15 changes: 15 additions & 0 deletions kotlin_sample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
1 change: 1 addition & 0 deletions kotlin_sample/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
2 changes: 1 addition & 1 deletion kotlin_sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.extrieve.quickcapture:QCv2:2.1.2'
implementation 'com.extrieve.quickcapture:QCv3:3.0.5'
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class MainActivity : AppCompatActivity() {
imageHelper!!.SetDPI(200) //int dpi_val = 100, 150, 200, 300, 500, 600;

//can set output file path
CameraSupport.CamConfigClass.OutputPath = buildStoragePath()
Config.CaptureSupport.OutputPath = buildStoragePath()
}

/*DEV_HELP : BuildStoragePath*/
Expand All @@ -125,7 +125,7 @@ class MainActivity : AppCompatActivity() {
val description = data!!.extras!!["DESCRIPTION"] as String?
if (!status!!) {
val imageCaptureLog = "Description : " + description +
".Exception: " + CameraSupport.CamConfigClass.LastLogInfo
".Exception: " + Config.CaptureSupport.LastLogInfo
Log.d("INFO", imageCaptureLog)
Toast.makeText(this, imageCaptureLog, Toast.LENGTH_LONG).show()
finishActivity(MainActivity.Companion.REQUEST_CODE_FILE_RETURN)
Expand Down Expand Up @@ -172,7 +172,7 @@ class MainActivity : AppCompatActivity() {
try {
/*DEV_HELP :redirecting to camera*/
val captureIntent = Intent(this, Class.forName("com.extrieve.quickcapture.sdk.CameraHelper"))
val photoURI = Uri.parse(CameraSupport.CamConfigClass.OutputPath)
val photoURI = Uri.parse(Config.CaptureSupport.OutputPath)
grantUriPermission(
this.packageName, photoURI,
Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION
Expand Down

0 comments on commit 425b1d0

Please sign in to comment.