QuickCapture Mobile Scanning SDK Specially designed for native ANDROID from Extrieve.
It's not "just" a scanning SDK. It's a "document" scanning/capture SDK evolved with Best Quality, Highest Possible Compression, Image Optimisation, of output document in mind.
Developer-friendly & Easy to integration SDK.
Choose the right version that suits your need :
- QuickCapture v4: Advanced Ai functionalities, with all latest features , seccurity enhancement & support. [~ 30 MB]
- QuickCapture v3: Comprehensive functionalities, but comparatively bit larger size. [~ 20 MB]
- QuickCapture v2: With Optimized Capture functionality, designed to be as compact as possible. [~ 2 MB]
End of support Notice : QuickCapture SDK Android V2 deprecated by May. 2024.For any further updates and support, can upgrade or use V4 & bugfixes on V3
You can download a .aar library file from GitHub's releases page.
Or use Gradle:
repositories {
google()
mavenCentral()
maven {url 'https://expack.extrieve.in/maven/'}
}
dependencies {
implementation 'com.extrieve.quickcapture:QCv2:2.1.3'
}Or Maven:
<dependency>
<groupId>com.extrieve.quickcapture</groupId>
<artifactId>QCv2</artifactId>
<version>2.1.2</version>
</dependency>- JAVA 7 Support: QuickCapture v2 requires JAVA version 7 support for the application.
- Minimum Android SDK: QuickCapture v2 requires a minimum API level of 21.
- Compile Android SDK: QuickCapture v2 compiled against API 33.
QuickCapture android SDK v 2.1.3
Mainly the SDK will expose two classes and two supporting classes :
- CameraHelper - Handle the camera related operations. Basically, an activity.
- ImgHelper - Purpose of this class is to handle all imaging related operations.
- CameraSupport - Holds various configurations for camera.
- ImgException - Handle all exceptions on Image related operations on ImgHelper.
Based on the requirement any one or all classes can be used. And need to import those from the SDK.
import com.extrieve.quickcapture.sdk.*;
//OR : can import only required classes as per use cases.
import com.extrieve.quickcapture.sdk.ImgHelper;
import com.extrieve.quickcapture.sdk.CameraHelper;
import com.extrieve.quickcapture.sdk.CameraSupport;
import com.extrieve.quickcapture.sdk.ImgException;This class will be implemented as an activity. This class can be initialized as intent.
CameraHelper CameraHelper = new CameraHelper();Intent CameraIntent = new Intent(this,Class.forName("com.extrieve.quickcapture.sdk.CameraHelper")); UriphotoURI = Uri.parse(CameraSupport.CamConfigClass.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) {
CameraIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
}
startActivityForResult(CameraIntent,REQUEST_CODE_FILE_RETURN);
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity.RESULT_OK)
{
Boolean Status = (Boolean) data.getExtras().get("STATUS");
String Description = (String) data.getExtras().get("DESCRIPTION");
if(Status == false){ //Failed to capture
finishActivity(REQUEST_CODE_FILE_RETURN); return;
}
FileCollection = (ArrayList<String>) data.getExtras().get("fileCollection");
//FileCollection //: will contains all capture images path as string
finishActivity(REQUEST_CODE_FILE_RETURN);
}Camera Helper having a supporting class with static configuration
CameraSupport.CamConfigClass.CamConfigClass : contains various configurations as follows:
-
OutputPath - To set the output directory in which the captured images will be saved. Base app should have rights to write to the provided path.
CameraSupport.CamConfigClass.OutputPath = “pass output path as string”;
-
MaxPage - To set the number of captures to do on each camera session. And this can also control whether the capture mode is single or multi i.e
if MaxPage <= 0 / not set: means unlimited.If MaxPage >= 1: means limited.
// MaxPage <= 0 : Unlimited Capture Mode // MaxPage = 1 : Limited Single Capture // MaxPage > 1 : Limited Multi Capture Mode public static int MaxPage = 0;
-
ColorMode - To Set the capture color mode - supporting color and grayscale.
CameraSupport.CamConfigClass.ColorMode = 1; //RBG (1) - Use capture flow in color mode. //GREY (2) - Use capture flow in grey scale mode.
-
EnableFlash - Enable Document capture specific flash control for SDK camera.
CameraSupport.CamConfigClass.EnableFlash = true;
-
CaptureSound - To Enable camera capture sound.
CameraSupport.CamConfigClass.CaptureSound = true;
-
DeviceInfo - Will share all general information about the device.
CameraSupport.CamConfigClass.DeviceInfo;
-
SDKInfo - Contains all version related information on SDK.
CameraSupport.CamConfigClass.SDKInfo;
-
CameraToggle - Toggle camera between front and back.
CameraSupport.CamConfigClass.CameraToggle = 2; //0-Disable camera toggle option. //1-Enable camera toggle option with Front camera by default. //2-Enable camera toggle option with Back camera by default.
-
GetTiffForLastCapture - Build Tiff file output file from last captured set of images.
CameraHelper.GetTiffForLastCapture(outPutFileWithpath); //on success, will respond with string : "SUCCESS:::TiffFilePath"; //use ":::" char. key to split the response. //on failure,will respond with string : "FAILED:::Reason for failure"; //use ":::" char. key to split the response. //on failure, error details can collect from CameraSupport.CamConfigClass.LastLogInfo
-
GetPDFForLastCapture - Build PDF file output file from last captured set of images.
CameraHelper.GetPDFForLastCapture(outPutFileWithpath); //on success, will respond with string : "SUCCESS:::PdfFilePath"; //use ":::" char. key to split the response. //on failure,will respond with string : "FAILED:::Reason for failure"; //use ":::" char. key to split the response. //on failure, error details can collect from CameraSupport.CamConfigClass.LastLogInfo
-
BuildTiff - Build .tiff file output from the list of images shared.
CameraHelper.BuildTiff(ArrayList<String> ImageCol, String OutputTiffFilePath) *@param "Image File path collection as ArrayList<String>" *@return on failure = "FAILED:::REASON" || on success = "SUCCESS:::TIFF file path".
-
BuildPDF - Build PDF file output file from last captured set of images.
CameraHelper.BuildPDF(outPutFileWithpath); *@param "Image File path collection as ArrayList<String>" *@return on failure = "FAILED:::REASON" || on success = "SUCCESS:::PDF file path".
Following are the options/methods available from class ImgHelper :
ImgHelper ImageHelper = new ImgHelper(this);-
SetImageQuality - Set the Quality of the image, Document_Qualityisused.If documents are used further for any automations and OCR, use Document_Quality.
Available Image Qualities : 1. Photo_Quality. 2. Document_Quality. 3. Compressed_Document.
ImageHelper.SetImageQuality(ImgHelper.ImageQuality.Photo_Quality.ordinal()); //OR ImageHelper.SetImageQuality(1);//0,1,2 - Photo_Quality, Document_Quality, Compressed_Document
-
SetPageLayout - Set the Layout for the images generated/processed by the system.
ImageHelper.SetPageLayout(ImgHelper.LayoutType.A4.ordinal()); //OR ImageHelper.SetPageLayout(4);//A1-A7(1-7),PHOTO,CUSTOM,ID(8,9,10)
Available layouts : A1, A2, A3, A4, A5, A6, A7,PHOTO & CUSTOM
A4 is the most recommended layout for document capture scenarios.
-
SetDPI - Set DPI (depth per inch) for the image.
ImageHelper.SetDPI(ImgHelper.DPI.DPI_200.ordinal()); //OR ImageHelper.SetDPI(200);//int dpi_val = 150, 200, 300, 500, 600;
Available DPI : DPI_150, DPI_200, DPI_300, DPI_500, DPI_600
150 & 200 DPI is most used.And 200 DPI recommended for OCR and other image extraction prior to capture.
-
GetThumbnail - This method Will build thumbnail for the given image in custom width,height & AspectRatio.
Bitmap thumb = ImageHelper.GetThumbnail(ImageBitmap, 600, 600, true); /* Bitmap GetThumbnail( @NonNull Bitmap bm, int reqHeight, int reqWidth, Boolean AspectRatio )throws ImgException. */
-
CompressToJPEG - This method will Compress the provided bitmap image and will save to given path..
Boolean Iscompressed = CompressToJPEG(bitmap,outputFilePath); /* Boolean CompressToJPEG(Bitmap bm,String outputFilePath) throws ImgException */
-
rotateBitmap - This method will rotate the image to preferred orientation.
Bitmap rotatedBm = rotateBitmapDegree(nBm, RotationDegree); /* Bitmap rotateBitmapDegree(Bitmap bitmap,int Degree) throws ImgException */
As a part of exceptional error handling ImgException class is available.
- Following are the possible errors and corresponding codes:
- CREATE_FILE_ERROR= -100;
- IMAGE_ROTATION_ERROR= -101;
- LOAD_TO_BUFFER_ERROR= -102;
- DELETE_FILE_ERROR= -103;
- GET_ROTATION_ERROR= -104;
- ROTATE_BITMAP_ERROR= -105;
- BITMAP_RESIZE_ERROR= -106;
- CAMERA_HELPER_ERROR= -107;
- LOG_CREATION_ERROR= -108;
License file provided that should keep inside assets folder of main application and call UnlockImagingLibrary from ImgHelper class to unlock the SDK.
QuickCapture SDK is absolutely free to use.But for image operations on enterprise use cases, license required. Click for license details
String licData = readAssetFile("com.extrieve.lic", this);
Boolean IsUnlocked = ImageHelper.UnlockImagingLibrary(licData)
/*
boolean UnlockImagingLibrary(String licenseFileData)
throws Exception
*/
