-
- All Implemented Interfaces:
public class GiniCaptureSingle entry point for the Gini Capture SDK for configuration and interaction.
This singleton class is preferred over the previous methods of configuration and interaction. It is only mandatory for new features. You can continue using features from previous releases without any modification.
To create and configure a singleton instance use the newInstance method and the returned Builder. If an instance is already available you need to call cleanup before creating a new instance. Failing to do so will throw an exception.
After you are done using the Gini Capture SDK use the cleanup method. This will free up resources used by the library.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGiniCapture.BuilderBuilder for GiniCapture. To get an instance call newInstance.
public classGiniCapture.InternalInternal use only.
-
Method Summary
Modifier and Type Method Description static synchronized GiniCapturegetInstance()Retrieve the current instance. static synchronized booleanhasInstance()Check whether an instance exists. static synchronized GiniCapture.BuildernewInstance()Configure and create a new instance using the returned Builder. static synchronized voidcleanup(@NonNull() Context context)Destroys the GiniCapture instance and frees up used resources. GiniCapture.Internalinternal()Internal use only. GiniCaptureNetworkApigetGiniCaptureNetworkApi()Retrieve the GiniCaptureNetworkApi instance, if available. DocumentImportEnabledFileTypesgetDocumentImportEnabledFileTypes()Retrieve the file types enabled for document import. booleanisFileImportEnabled()Find out whether file import has been enabled. booleanisQRCodeScanningEnabled()Find out whether QRCode scanning has been enabled. booleanisMultiPageEnabled()Find out whether scanning multi-page documents has been enabled. ArrayList<OnboardingPage>getCustomOnboardingPages()The custom Onboarding Screen pages, if configured. booleanshouldShowOnboardingAtFirstRun()Screen API only If set to false, the Onboarding Screen won't be shown on the first run.booleanshouldShowOnboarding()Screen API only If set to true, the Onboarding Screen will be shown every every time the CameraActivity starts.voidsetShouldShowOnboarding(boolean shouldShowOnboarding)Screen API only Set to trueto show the Onboarding Screen every time the CameraActivity starts.booleanisSupportedFormatsHelpScreenEnabled()Find out whether the Supported Formats help screen has been enabled. booleanisFlashButtonEnabled()Find out whether the flash button on the Camera Screen has been enabled. booleanareBackButtonsEnabled()Screen API only Find out whether back buttons in all Activities have been enabled. booleanisFlashOnByDefault()Find out whether the camera flash is on or off by default. CancellationTokencreateIntentForImportedFiles(@NonNull() Intent intent, @NonNull() Context context, @NonNull() AsyncCallback<Intent, ImportedFileValidationException> callback)Screen API If you have enabled the multi-page feature and your application receives one or multiple files from another application you can use this method to create an Intent for launching the Gini Capture SDK. CancellationTokencreateDocumentForImportedFiles(@NonNull() Intent intent, @NonNull() Context context, @NonNull() AsyncCallback<Document, ImportedFileValidationException> callback)Component API If you have enabled the multi-page feature and your application receives one or multiple files from another application you can use this method to create a Document for launching the Gini Capture SDK's MultiPageReviewFragment or the Analysis Fragment. static IntentcreateIntentForImportedFile(@NonNull() Intent intent, @NonNull() Context context, @Nullable() Class<out ReviewActivity> reviewActivityClass, @Nullable() Class<out AnalysisActivity> analysisActivityClass)Screen API When your application receives a file from another application you can use this method to create an Intent for launching the Gini Capture SDK. static DocumentcreateDocumentForImportedFile(@NonNull() Intent intent, @NonNull() Context context)Component API When your application receives a file from another application you can use this method to create a Document for launching the Gini Capture SDK's Review Fragment or Analysis Fragment. List<HelpItem.Custom>getCustomHelpItems()The custom help items, if configured. intgetImportedFileSizeBytesLimit()The size limit in bytes for imported files. -
-
Method Detail
-
getInstance
@NonNull() static synchronized GiniCapture getInstance()
Retrieve the current instance.
-
hasInstance
static synchronized boolean hasInstance()
Check whether an instance exists.
-
newInstance
@NonNull() static synchronized GiniCapture.Builder newInstance()
Configure and create a new instance using the returned Builder.
-
cleanup
static synchronized void cleanup(@NonNull() Context context)
Destroys the GiniCapture instance and frees up used resources.
- Parameters:
context- Android context
-
internal
@NonNull() GiniCapture.Internal internal()
Internal use only.
-
getGiniCaptureNetworkApi
@Nullable() GiniCaptureNetworkApi getGiniCaptureNetworkApi()
Retrieve the GiniCaptureNetworkApi instance, if available.
-
getDocumentImportEnabledFileTypes
@NonNull() DocumentImportEnabledFileTypes getDocumentImportEnabledFileTypes()
Retrieve the file types enabled for document import.
Disabled by default.
-
isFileImportEnabled
boolean isFileImportEnabled()
Find out whether file import has been enabled.
Disabled by default.
-
isQRCodeScanningEnabled
boolean isQRCodeScanningEnabled()
Find out whether QRCode scanning has been enabled.
Disabled by default.
-
isMultiPageEnabled
boolean isMultiPageEnabled()
Find out whether scanning multi-page documents has been enabled.
Disabled by default
-
getCustomOnboardingPages
@Nullable() ArrayList<OnboardingPage> getCustomOnboardingPages()
The custom Onboarding Screen pages, if configured.
-
shouldShowOnboardingAtFirstRun
boolean shouldShowOnboardingAtFirstRun()
Screen API only
If set to
false, the Onboarding Screen won't be shown on the first run.
-
shouldShowOnboarding
boolean shouldShowOnboarding()
Screen API only
If set to
true, the Onboarding Screen will be shown every every time the CameraActivity starts.Default value is
false.You can change it on the existing GiniCapture instance with setShouldShowOnboarding.
-
setShouldShowOnboarding
void setShouldShowOnboarding(boolean shouldShowOnboarding)
Screen API only
Set to
trueto show the Onboarding Screen every time the CameraActivity starts.Default value is
false.- Parameters:
shouldShowOnboarding- whether to show the onboarding on every launch
-
isSupportedFormatsHelpScreenEnabled
boolean isSupportedFormatsHelpScreenEnabled()
Find out whether the Supported Formats help screen has been enabled.
Enabled by default.
-
isFlashButtonEnabled
boolean isFlashButtonEnabled()
Find out whether the flash button on the Camera Screen has been enabled.
Disabled by default.
-
areBackButtonsEnabled
boolean areBackButtonsEnabled()
Screen API only
Find out whether back buttons in all Activities have been enabled. ReviewActivity and AnalysisActivity are not affected and always show back buttons.
Enabled by default.
-
isFlashOnByDefault
boolean isFlashOnByDefault()
Find out whether the camera flash is on or off by default.
If not changed, then flash is on by default.
-
createIntentForImportedFiles
@NonNull() CancellationToken createIntentForImportedFiles(@NonNull() Intent intent, @NonNull() Context context, @NonNull() AsyncCallback<Intent, ImportedFileValidationException> callback)
Screen API
If you have enabled the multi-page feature and your application receives one or multiple files from another application you can use this method to create an Intent for launching the Gini Capture SDK.
Importing the files is executed on a secondary thread as it can take several seconds for the process to complete. The callback methods are invoked on the main thread.
In your callback's
onSuccess(Intent)method start the Intent with startActivityForResult to receive the extractions or a GiniCaptureError in case there was an error.- Parameters:
intent- the Intent your app receivedcontext- Android contextcallback- A AsyncCallback implementation
-
createDocumentForImportedFiles
@NonNull() CancellationToken createDocumentForImportedFiles(@NonNull() Intent intent, @NonNull() Context context, @NonNull() AsyncCallback<Document, ImportedFileValidationException> callback)
Component API
If you have enabled the multi-page feature and your application receives one or multiple files from another application you can use this method to create a Document for launching the Gini Capture SDK's MultiPageReviewFragment or the Analysis Fragment.
Importing the files is executed on a secondary thread as it can take several seconds for the process to complete. The callback methods are invoked on the main thread.
If the Document can be reviewed (isReviewable) launch the .
If the Document cannot be reviewed you must launch the Analysis Fragment ().
- Parameters:
intent- the Intent your app receivedcontext- Android contextcallback- A AsyncCallback implementation
-
createIntentForImportedFile
@NonNull() static Intent createIntentForImportedFile(@NonNull() Intent intent, @NonNull() Context context, @Nullable() Class<out ReviewActivity> reviewActivityClass, @Nullable() Class<out AnalysisActivity> analysisActivityClass)
Screen API
When your application receives a file from another application you can use this method to create an Intent for launching the Gini Capture SDK.
Start the Intent with startActivityForResult to receive the extractions or a GiniCaptureError in case there was an error.
- Parameters:
intent- the Intent your app receivedcontext- Android contextreviewActivityClass- (optional) the class of your application's subclassanalysisActivityClass- (optional) the class of your application's subclass
-
createDocumentForImportedFile
@NonNull() static Document createDocumentForImportedFile(@NonNull() Intent intent, @NonNull() Context context)
Component API
When your application receives a file from another application you can use this method to create a Document for launching the Gini Capture SDK's Review Fragment or Analysis Fragment.
If the Document can be reviewed (isReviewable) launch the Review Fragment (net.gini.android.capture.review.ReviewFragmentCompat).
If the Document cannot be reviewed you must launch the Analysis Fragment ().
- Parameters:
intent- the Intent your app receivedcontext- Android context
-
getCustomHelpItems
@NonNull() List<HelpItem.Custom> getCustomHelpItems()
The custom help items, if configured.
-
getImportedFileSizeBytesLimit
int getImportedFileSizeBytesLimit()
The size limit in bytes for imported files.
-
-
-
-