GiniVision

Single entry point for the Gini Vision Library 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 before creating a new instance. Failing to do so will throw an exception.

After you are done using the Gini Vision Library use the cleanup method. This will free up resources used by the library.

public class GiniVision

Types

Builder
Link copied to clipboard

Builder for GiniVision . To get an instance call newInstance .

public class Builder
Internal
Link copied to clipboard

Internal use only.

public class Internal

Functions

areBackButtonsEnabled
Link copied to clipboard

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.

boolean areBackButtonsEnabled()
cleanup
Link copied to clipboard

Destroys the GiniVision instance and frees up used resources.

static synchronized void cleanup(Context context)
createDocumentForImportedFile
Link copied to clipboard

Component API

When your application receives a file from another application you can use this method to create a Document for launching one of the Gini Vision Library's Review Fragments or Analysis Fragments.

If the Document can be reviewed ( isReviewable ) launch one of the Review Fragments ( net.gini.android.vision.review.ReviewFragmentCompat or ).

If the Document cannot be reviewed you must launch one of the Analysis Fragments ( or ).

static Document createDocumentForImportedFile(Intent intent, Context context)
createDocumentForImportedFiles
Link copied to clipboard

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 Vision Library's MultiPageReviewFragment or one of the Analysis Fragments.

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 one of the Analysis Fragments ( or ).

createIntentForImportedFile
Link copied to clipboard

Screen API

When your application receives a file from another application you can use this method to create an Intent for launching the Gini Vision Library.

Start the Intent with startActivityForResult to receive the extractions or a GiniVisionError in case there was an error.

createIntentForImportedFiles
Link copied to clipboard

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 Vision Library.

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 {@code onSuccess(Intent)} method start the Intent with to receive the extractions or a GiniVisionError in case there was an error.

getCustomOnboardingPages
Link copied to clipboard

The custom Onboarding Screen pages, if configured.

ArrayList<OnboardingPagegetCustomOnboardingPages()
getDocumentDataMemoryCache
Link copied to clipboard
DocumentDataMemoryCache getDocumentDataMemoryCache()
getDocumentImportEnabledFileTypes
Link copied to clipboard

Retrieve the file types enabled for document import.

Disabled by default.

getEventTracker
Link copied to clipboard
EventTracker getEventTracker()
getGiniVisionNetworkApi
Link copied to clipboard

Retrieve the GiniVisionNetworkApi instance, if available.

GiniVisionNetworkApi getGiniVisionNetworkApi()
getGiniVisionNetworkService
Link copied to clipboard
getImageDiskStore
Link copied to clipboard
ImageDiskStore getImageDiskStore()
getImageMultiPageDocumentMemoryStore
Link copied to clipboard
ImageMultiPageDocumentMemoryStore getImageMultiPageDocumentMemoryStore()
getInstance
Link copied to clipboard

Retrieve the current instance.

static synchronized GiniVision getInstance()
getNetworkRequestsManager
Link copied to clipboard
NetworkRequestsManager getNetworkRequestsManager()
getPhotoMemoryCache
Link copied to clipboard
PhotoMemoryCache getPhotoMemoryCache()
hasInstance
Link copied to clipboard

Check whether an instance exists.

static synchronized boolean hasInstance()
internal
Link copied to clipboard

Internal use only.

GiniVision.Internal internal()
isFileImportEnabled
Link copied to clipboard

Find out whether file import has been enabled.

Disabled by default.

boolean isFileImportEnabled()
isFlashButtonEnabled
Link copied to clipboard

Find out whether the flash button on the Camera Screen has been enabled.

Disabled by default.

boolean isFlashButtonEnabled()
isFlashOnByDefault
Link copied to clipboard

Find out whether the camera flash is on or off by default.

If not changed, then flash is on by default.

boolean isFlashOnByDefault()
isMultiPageEnabled
Link copied to clipboard

Find out whether scanning multi-page documents has been enabled.

Disabled by default

boolean isMultiPageEnabled()
isQRCodeScanningEnabled
Link copied to clipboard

Find out whether QRCode scanning has been enabled.

Disabled by default.

boolean isQRCodeScanningEnabled()
isSupportedFormatsHelpScreenEnabled
Link copied to clipboard

Find out whether the Supported Formats help screen has been enabled.

Enabled by default.

boolean isSupportedFormatsHelpScreenEnabled()
newInstance
Link copied to clipboard

Configure and create a new instance using the returned Builder .

static synchronized GiniVision.Builder newInstance()
setInstance
Link copied to clipboard
static synchronized void setInstance(GiniVision giniVision)
setShouldShowOnboarding
Link copied to clipboard

Screen API only

Set to {@code true} to show the Onboarding Screen every time the CameraActivity starts.

Default value is {@code false} .

void setShouldShowOnboarding(boolean shouldShowOnboarding)
shouldShowOnboarding
Link copied to clipboard

Screen API only

If set to {@code true} , the Onboarding Screen will be shown every every time the CameraActivity starts.

Default value is {@code false} .

You can change it on the existing GiniVision instance with .

boolean shouldShowOnboarding()
shouldShowOnboardingAtFirstRun
Link copied to clipboard

Screen API only

If set to {@code false} , the Onboarding Screen won't be shown on the first run.

boolean shouldShowOnboardingAtFirstRun()