CameraActivity

public class CameraActivity extends AppCompatActivity implements CameraFragmentListener, CameraFragmentInterface
Screen API

CameraActivity is the main entry point to the Gini Vision Library when using the Screen API.

It shows a camera preview with tap-to-focus functionality, a trigger button and an optional flash on/off button. The camera preview also shows document corner guides to which the user should align the document.

On tablets in landscape orientation the camera trigger button is shown on the right side of the screen for easier access.

If you enabled document import with setDocumentImportEnabledFileTypes then a button for importing documents is shown next to the trigger button. A hint popup is displayed the first time the Gini Vision Library is used to inform the user about document importing.

For importing documents READ_EXTERNAL_STORAGE permission is required and if the permission is not granted the Gini Vision Library will prompt the user to grant the permission. See Customizing the Camera Screen on how to override the message and button titles for the rationale and on permission denial alerts.

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

These formerly mandatory extras have been deprecated. Still required if GiniVision is not used:

These optional extras have been deprecated. Should be set only if GiniVision is not used:

The following result codes need to be handled:

  • RESULT_OK - image of a document was taken, reviewed and analyzed
  • RESULT_CANCELED - image of document was not taken, user canceled the Gini Vision Library
  • RESULT_ERROR - an error occured

Result extra returned by the CameraActivity:

Note: For returning the extractions from the Gini API you can add your own extras in onAddDataToResult or onAddDataToResult.

If the camera could not be opened due to missing permissions, the content of the Camera Screen is replaced with a no-camera icon, a short message and an optional button. The button is shown only on Android 6.0+ and tapping the button leads the user to the Application Details page in the Settings. If these are shown on Android 5.0 and earlier means that the camera permission was not declared in your manifest.

Customizing the Camera Screen

Customizing the look of the Camera Screen is done via overriding of app resources.

The following items are customizable:

  • Document corner guides: via the color resource named gv_camera_preview_corners
  • Camera trigger button: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gv_camera_trigger_default.png and gv_camera_trigger_pressed.png
  • Document import button: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gv_document_import_icon.png
  • Document import button subtitle text: via the string resource named gv_camera_document_import_subtitle
  • Document import button subtitle text style: via overriding the style named GiniVisionTheme.Camera.DocumentImportSubtitle.TextStyle
  • Document import button subtitle font: via overriding the style named GiniVisionTheme.Camera.DocumentImportSubtitle.TextStyle and setting an item named gvCustomFont with the path to the font file in your assets folder
  • Document import hint background: via the color resource named gv_document_import_hint_background
  • Document import hint close icon color: via the color resource name gv_hint_close
  • Document import hint text: via the string resource named gv_document_import_hint_text
  • Document import hint text size: via overriding the style named GiniVisionTheme.Camera.DocumentImportHint.TextStyle and setting an item named android:textSize with the desired sp size
  • Document import hint text color: via the color resource name gv_document_import_hint_text
  • Document import hint font: via overriding the style named GiniVisionTheme.Camera.DocumentImportHint.TextStyle and setting an item named gvCustomFont with the path to the font file in your assets folder
  • Images stack badge text style: via overriding the style named GiniVisionTheme.Camera.ImageStackBadge.TextStyle
  • Images stack badge font: via overriding the style named GiniVisionTheme.Camera.ImageStackBadge.TextStyle and setting an item named gvCustomFont with the path to the font file in your assets folder
  • Images stack badge background colors: via the color resources named gv_camera_image_stack_badge_background and gv_camera_image_stack_badge_background_border
  • Images stack badge background size: via the dimension resource named gv_camera_image_stack_badge_size
  • Images stack subtitle text: via the string resource named gv_camera_image_stack_subtitle
  • Images stack subtitle text style: via overriding the style named GiniVisionTheme.Camera.ImageStackSubtitle.TextStyle
  • Images stack subtitle font: via overriding the style named GiniVisionTheme.Camera.ImageStackSubtitle.TextStyle and setting an item named gvCustomFont with the path to the font file in your assets folder
  • Multi-page document page limit exceeded alert message: via the string resource named gv_document_error_too_many_pages
  • Multi-page document page limit exceeded alert positive button text: via the string resource named gv_document_error_multi_page_limit_review_pages_button
  • Multi-page document page limit exceeded alert cancel button text: via the string resource named gv_document_error_multi_page_limit_cancel_button
  • Read storage permission denied button color: via the color resource named gv_accent
  • QRCode detected popup background: via the color resource named gv_qrcode_detected_popup_background
  • QRCode detected popup texts: via the string resources named gv_qrcode_detected_popup_message_1 and gv_qrcode_detected_popup_message_2
  • QRCode detected popup text sizes: via overriding the styles named GiniVisionTheme.Camera.QRCodeDetectedPopup.Message1.TextStyle and GiniVisionTheme.Camera.QRCodeDetectedPopup.Message2.TextStyle and setting an item named android:textSize with the desired sp size
  • QRCode detected popup text colors: via the color resource name gv_qrcode_detected_popup_message_1 and gv_qrcode_detected_popup_message_2
  • QRCode detected popup fonts: via overriding the styles named GiniVisionTheme.Camera.QRCodeDetectedPopup.Message1.TextStyle and GiniVisionTheme.Camera.QRCodeDetectedPopup.Message2.TextStyle and setting an item named gvCustomFont with the path to the font file in your assets folder
  • Read storage permission rationale text: via the string resource named gv_storage_permission_rationale
  • Read storage permission rationale positive button text: via the string resource named gv_storage_permission_rationale_positive_button
  • Read storage permission rationale negative button text: via the string resource named gv_storage_permission_rationale_negative_button
  • Read storage permission rationale button color: via the color resource named gv_accent
  • Read storage permission denied text: via the string resource named gv_storage_permission_denied
  • Read storage permission denied positive button text: via the string resource named gv_storage_permission_denied_positive_button
  • Read storage permission denied negative button text: via the string resource named gv_storage_permission_denied_negative_button
  • Read storage permission denied button color: via the color resource named gv_accent
  • Tap-to-focus indicator: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gv_camera_focus_indicator.png
  • Help menu item icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gv_help_icon.png
  • Onboarding menu item title: via the string resource named gv_show_onboarding
  • Background color: via the color resource named gv_background. Note: this color resource is global to all Activities (CameraActivity, , ReviewActivity, AnalysisActivity)
  • No-camera icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gv_no_camera.png
  • No camera permission text: via the string resource named gv_camera_error_no_permission
  • No camera permission text color: via the color resource named gv_camera_error_no_permission
  • No camera permission font: via overriding the style named GiniVisionTheme.Camera.Error.NoPermission.TextStyle and setting an item named gvCustomFont with the path to the font file in your assets folder
  • No camera permission text style: via overriding the style named GiniVisionTheme.Camera.Error.NoPermission.TextStyle and setting an item named android:textStyle to normal, bold or italic
  • No camera permission text size: via overriding the style named GiniVisionTheme.Camera.Error.NoPermission.TextStyle and setting an item named android:textSize to the desired sp size
  • No camera permission button title: via the string resource named gv_camera_error_no_permission_button_title
  • No camera permission button title color: via the color resources named gv_camera_error_no_permission_button_title and gv_camera_error_no_permission_button_title_pressed
  • No camera permission button font: via overriding the style named GiniVisionTheme.Camera.Error.NoPermission.Button.TextStyle and setting an item named gvCustomFont with the path to the font file in your assets folder
  • No camera permission button text style: via overriding the style named GiniVisionTheme.Camera.Error.NoPermission.Button.TextStyle and setting an item named android:textStyle to normal, bold or italic
  • No camera permission button text size: via overriding the style named GiniVisionTheme.Camera.Error.NoPermission.Button.TextStyle and setting an item named android:textSize to the desired sp size

Important: All overriden styles must have their respective Root. prefixed style as their parent. Ex.: the parent of GiniVisionTheme.Camera.Error.NoPermission.TextStyle must be Root.GiniVisionTheme.Camera.Error.NoPermission.TextStyle.

Customizing the Action Bar

Customizing the Action Bar is also done via overriding of app resources and each one - except the title string resource - is global to all Activities (CameraActivity, , ReviewActivity, MultiPageReviewActivity, ).

The following items are customizable:

  • Background color: via the color resource named gv_action_bar (highly recommended for Android 5+: customize the status bar color via gv_status_bar)
  • Title: via the string resource name gv_title_camera
  • Title color: via the color resource named gv_action_bar_title
  • Back button: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gv_action_bar_back

Functions

addContentView
Link copied to clipboard
void addContentView(View view, ViewGroup.LayoutParams params)
addOnContextAvailableListener
Link copied to clipboard
final void addOnContextAvailableListener(OnContextAvailableListener listener)
applyOverrideConfiguration
Link copied to clipboard
void applyOverrideConfiguration(Configuration overrideConfiguration)
bindIsolatedService
Link copied to clipboard
boolean bindIsolatedService(Intent service, int flags, String instanceName, Executor executor, ServiceConnection conn)
bindService
Link copied to clipboard
boolean bindService(Intent service, ServiceConnection conn, int flags)
bindServiceAsUser
Link copied to clipboard
boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags, UserHandle user)
checkCallingOrSelfPermission
Link copied to clipboard
int checkCallingOrSelfPermission(String permission)
checkCallingOrSelfUriPermission
Link copied to clipboard
int checkCallingOrSelfUriPermission(Uri uri, int modeFlags)
checkCallingPermission
Link copied to clipboard
int checkCallingPermission(String permission)
checkCallingUriPermission
Link copied to clipboard
int checkCallingUriPermission(Uri uri, int modeFlags)
checkPermission
Link copied to clipboard
int checkPermission(String permission, int pid, int uid)
checkSelfPermission
Link copied to clipboard
int checkSelfPermission(String permission)
checkUriPermission
Link copied to clipboard
int checkUriPermission(Uri uri, int pid, int uid, int modeFlags)
clearWallpaper
Link copied to clipboard
void clearWallpaper()
closeContextMenu
Link copied to clipboard
void closeContextMenu()
closeOptionsMenu
Link copied to clipboard
void closeOptionsMenu()
createAttributionContext
Link copied to clipboard
Context createAttributionContext(String attributionTag)
createConfigurationContext
Link copied to clipboard
Context createConfigurationContext(Configuration overrideConfiguration)
createContextForSplit
Link copied to clipboard
Context createContextForSplit(String splitName)
createDeviceProtectedStorageContext
Link copied to clipboard
Context createDeviceProtectedStorageContext()
createDisplayContext
Link copied to clipboard
Context createDisplayContext(Display display)
createPackageContext
Link copied to clipboard
Context createPackageContext(String packageName, int flags)
createPendingResult
Link copied to clipboard
PendingIntent createPendingResult(int requestCode, Intent data, int flags)
createWindowContext
Link copied to clipboard
Context createWindowContext(int type, Bundle options)
databaseList
Link copied to clipboard
Array<StringdatabaseList()
deleteDatabase
Link copied to clipboard
boolean deleteDatabase(String name)
deleteFile
Link copied to clipboard
boolean deleteFile(String name)
deleteSharedPreferences
Link copied to clipboard
boolean deleteSharedPreferences(String name)
dismissDialog
Link copied to clipboard
final void dismissDialog(int id)
dismissKeyboardShortcutsHelper
Link copied to clipboard
final void dismissKeyboardShortcutsHelper()
dispatchGenericMotionEvent
Link copied to clipboard
boolean dispatchGenericMotionEvent(MotionEvent ev)
dispatchKeyEvent
Link copied to clipboard
boolean dispatchKeyEvent(KeyEvent event)
dispatchKeyShortcutEvent
Link copied to clipboard
boolean dispatchKeyShortcutEvent(KeyEvent event)
dispatchPopulateAccessibilityEvent
Link copied to clipboard
boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
dispatchTouchEvent
Link copied to clipboard
boolean dispatchTouchEvent(MotionEvent ev)
dispatchTrackballEvent
Link copied to clipboard
boolean dispatchTrackballEvent(MotionEvent ev)
dump
Link copied to clipboard
void dump(String prefix, FileDescriptor fd, PrintWriter writer, Array<String> args)
enforceCallingOrSelfPermission
Link copied to clipboard
void enforceCallingOrSelfPermission(String permission, String message)
enforceCallingOrSelfUriPermission
Link copied to clipboard
void enforceCallingOrSelfUriPermission(Uri uri, int modeFlags, String message)
enforceCallingPermission
Link copied to clipboard
void enforceCallingPermission(String permission, String message)
enforceCallingUriPermission
Link copied to clipboard
void enforceCallingUriPermission(Uri uri, int modeFlags, String message)
enforcePermission
Link copied to clipboard
void enforcePermission(String permission, int pid, int uid, String message)
enforceUriPermission
Link copied to clipboard
void enforceUriPermission(Uri uri, int pid, int uid, int modeFlags, String message)
enterPictureInPictureMode
Link copied to clipboard
void enterPictureInPictureMode()
boolean enterPictureInPictureMode(PictureInPictureParams params)
fileList
Link copied to clipboard
Array<StringfileList()
findViewById
Link copied to clipboard
T findViewById<T extends View>(int id)
finish
Link copied to clipboard
void finish()
finishActivity
Link copied to clipboard
void finishActivity(int requestCode)
finishActivityFromChild
Link copied to clipboard
void finishActivityFromChild(Activity child, int requestCode)
finishAffinity
Link copied to clipboard
void finishAffinity()
finishAfterTransition
Link copied to clipboard
void finishAfterTransition()
finishAndRemoveTask
Link copied to clipboard
void finishAndRemoveTask()
finishFromChild
Link copied to clipboard
void finishFromChild(Activity child)
getActionBar
Link copied to clipboard
ActionBar getActionBar()
getActivityResultRegistry
Link copied to clipboard
final ActivityResultRegistry getActivityResultRegistry()
getApplication
Link copied to clipboard
final Application getApplication()
getApplicationContext
Link copied to clipboard
Context getApplicationContext()
getApplicationInfo
Link copied to clipboard
ApplicationInfo getApplicationInfo()
getAssets
Link copied to clipboard
AssetManager getAssets()
getAttributionTag
Link copied to clipboard
String getAttributionTag()
getBaseContext
Link copied to clipboard
Context getBaseContext()
getCacheDir
Link copied to clipboard
File getCacheDir()
getCallingActivity
Link copied to clipboard
ComponentName getCallingActivity()
getCallingPackage
Link copied to clipboard
String getCallingPackage()
getChangingConfigurations
Link copied to clipboard
int getChangingConfigurations()
getClassLoader
Link copied to clipboard
ClassLoader getClassLoader()
getCodeCacheDir
Link copied to clipboard
File getCodeCacheDir()
getColor
Link copied to clipboard
final int getColor(int id)
getColorStateList
Link copied to clipboard
final ColorStateList getColorStateList(int id)
getComponentName
Link copied to clipboard
ComponentName getComponentName()
getContentResolver
Link copied to clipboard
ContentResolver getContentResolver()
getContentScene
Link copied to clipboard
Scene getContentScene()
getContentTransitionManager
Link copied to clipboard
TransitionManager getContentTransitionManager()
getCurrentFocus
Link copied to clipboard
View getCurrentFocus()
getDatabasePath
Link copied to clipboard
File getDatabasePath(String name)
getDataDir
Link copied to clipboard
File getDataDir()
getDelegate
Link copied to clipboard
AppCompatDelegate getDelegate()
getDir
Link copied to clipboard
File getDir(String name, int mode)
getDisplay
Link copied to clipboard
Display getDisplay()
getDrawable
Link copied to clipboard
final Drawable getDrawable(int id)
getDrawerToggleDelegate
Link copied to clipboard
getExternalCacheDir
Link copied to clipboard
File getExternalCacheDir()
getExternalCacheDirs
Link copied to clipboard
Array<FilegetExternalCacheDirs()
getExternalFilesDir
Link copied to clipboard
File getExternalFilesDir(String type)
getExternalFilesDirs
Link copied to clipboard
Array<FilegetExternalFilesDirs(String type)
getExternalMediaDirs
Link copied to clipboard
Array<FilegetExternalMediaDirs()
getExtraData
Link copied to clipboard
T getExtraData<T extends ComponentActivity.ExtraData>(Class<T> extraDataClass)
getFilesDir
Link copied to clipboard
File getFilesDir()
getFileStreamPath
Link copied to clipboard
File getFileStreamPath(String name)
getFragmentManager
Link copied to clipboard
FragmentManager getFragmentManager()
getIntent
Link copied to clipboard
Intent getIntent()
getLastCustomNonConfigurationInstance
Link copied to clipboard
Object getLastCustomNonConfigurationInstance()
getLastNonConfigurationInstance
Link copied to clipboard
Object getLastNonConfigurationInstance()
getLayoutInflater
Link copied to clipboard
LayoutInflater getLayoutInflater()
getLifecycle
Link copied to clipboard
Lifecycle getLifecycle()
getLoaderManager
Link copied to clipboard
LoaderManager getLoaderManager()
getLocalClassName
Link copied to clipboard
String getLocalClassName()
getMainExecutor
Link copied to clipboard
Executor getMainExecutor()
getMainLooper
Link copied to clipboard
Looper getMainLooper()
getMaxNumPictureInPictureActions
Link copied to clipboard
int getMaxNumPictureInPictureActions()
getMediaController
Link copied to clipboard
final MediaController getMediaController()
getMenuInflater
Link copied to clipboard
MenuInflater getMenuInflater()
getNoBackupFilesDir
Link copied to clipboard
File getNoBackupFilesDir()
getObbDir
Link copied to clipboard
File getObbDir()
getObbDirs
Link copied to clipboard
Array<FilegetObbDirs()
getOnBackPressedDispatcher
Link copied to clipboard
final OnBackPressedDispatcher getOnBackPressedDispatcher()
getOpPackageName
Link copied to clipboard
String getOpPackageName()
getPackageCodePath
Link copied to clipboard
String getPackageCodePath()
getPackageManager
Link copied to clipboard
PackageManager getPackageManager()
getPackageName
Link copied to clipboard
String getPackageName()
getPackageResourcePath
Link copied to clipboard
String getPackageResourcePath()
getParent
Link copied to clipboard
final Activity getParent()
getParentActivityIntent
Link copied to clipboard
Intent getParentActivityIntent()
getPreferences
Link copied to clipboard
SharedPreferences getPreferences(int mode)
getReferrer
Link copied to clipboard
Uri getReferrer()
getRequestedOrientation
Link copied to clipboard
int getRequestedOrientation()
getResources
Link copied to clipboard
Resources getResources()
getSavedStateRegistry
Link copied to clipboard
final SavedStateRegistry getSavedStateRegistry()
getSearchEvent
Link copied to clipboard
final SearchEvent getSearchEvent()
getSharedPreferences
Link copied to clipboard
SharedPreferences getSharedPreferences(String name, int mode)
getString
Link copied to clipboard
final String getString(int resId)
getSupportActionBar
Link copied to clipboard
ActionBar getSupportActionBar()
getSupportFragmentManager
Link copied to clipboard
FragmentManager getSupportFragmentManager()
getSupportLoaderManager
Link copied to clipboard
LoaderManager getSupportLoaderManager()
getSupportParentActivityIntent
Link copied to clipboard
Intent getSupportParentActivityIntent()
getSystemService
Link copied to clipboard
Object getSystemService(String name)
final T getSystemService<T>(Class<T> serviceClass)
getSystemServiceName
Link copied to clipboard
String getSystemServiceName(Class<? extends Object> serviceClass)
getTaskId
Link copied to clipboard
int getTaskId()
getText
Link copied to clipboard
final CharSequence getText(int resId)
getTheme
Link copied to clipboard
Resources.Theme getTheme()
getTitle
Link copied to clipboard
final CharSequence getTitle()
getTitleColor
Link copied to clipboard
final int getTitleColor()
getViewModelStore
Link copied to clipboard
ViewModelStore getViewModelStore()
getVoiceInteractor
Link copied to clipboard
VoiceInteractor getVoiceInteractor()
getVolumeControlStream
Link copied to clipboard
final int getVolumeControlStream()
getWallpaper
Link copied to clipboard
Drawable getWallpaper()
getWallpaperDesiredMinimumHeight
Link copied to clipboard
int getWallpaperDesiredMinimumHeight()
getWallpaperDesiredMinimumWidth
Link copied to clipboard
int getWallpaperDesiredMinimumWidth()
getWindow
Link copied to clipboard
Window getWindow()
getWindowManager
Link copied to clipboard
WindowManager getWindowManager()
grantUriPermission
Link copied to clipboard
void grantUriPermission(String toPackage, Uri uri, int modeFlags)
hasWindowFocus
Link copied to clipboard
boolean hasWindowFocus()
void hideActivityIndicatorAndEnableInteraction()
Call this method to hide the activity indicator and enable user interaction.
hideCameraTriggerButton
Link copied to clipboard
void hideCameraTriggerButton()
Call this method to hide the camera trigger button.
hideDocumentCornerGuides
Link copied to clipboard
void hideDocumentCornerGuides()
Call this method to hide the document corner guides.
hideInterface
Link copied to clipboard
void hideInterface()
Call this method to hide the interface elements.
invalidateOptionsMenu
Link copied to clipboard
void invalidateOptionsMenu()
isActivityTransitionRunning
Link copied to clipboard
boolean isActivityTransitionRunning()
isChangingConfigurations
Link copied to clipboard
boolean isChangingConfigurations()
isChild
Link copied to clipboard
final boolean isChild()
isDestroyed
Link copied to clipboard
boolean isDestroyed()
isDeviceProtectedStorage
Link copied to clipboard
boolean isDeviceProtectedStorage()
isFinishing
Link copied to clipboard
boolean isFinishing()
isImmersive
Link copied to clipboard
boolean isImmersive()
isInMultiWindowMode
Link copied to clipboard
boolean isInMultiWindowMode()
isInPictureInPictureMode
Link copied to clipboard
boolean isInPictureInPictureMode()
isLocalVoiceInteractionSupported
Link copied to clipboard
boolean isLocalVoiceInteractionSupported()
isRestricted
Link copied to clipboard
boolean isRestricted()
isTaskRoot
Link copied to clipboard
boolean isTaskRoot()
isVoiceInteraction
Link copied to clipboard
boolean isVoiceInteraction()
isVoiceInteractionRoot
Link copied to clipboard
boolean isVoiceInteractionRoot()
managedQuery
Link copied to clipboard
final Cursor managedQuery(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder)
moveDatabaseFrom
Link copied to clipboard
boolean moveDatabaseFrom(Context sourceContext, String name)
moveSharedPreferencesFrom
Link copied to clipboard
boolean moveSharedPreferencesFrom(Context sourceContext, String name)
moveTaskToBack
Link copied to clipboard
boolean moveTaskToBack(boolean nonRoot)
navigateUpTo
Link copied to clipboard
boolean navigateUpTo(Intent upIntent)
navigateUpToFromChild
Link copied to clipboard
boolean navigateUpToFromChild(Activity child, Intent upIntent)
obtainStyledAttributes
Link copied to clipboard
final TypedArray obtainStyledAttributes(Array<int> attrs)
onActionModeFinished
Link copied to clipboard
void onActionModeFinished(ActionMode mode)
onActionModeStarted
Link copied to clipboard
void onActionModeStarted(ActionMode mode)
onActivityReenter
Link copied to clipboard
void onActivityReenter(int resultCode, Intent data)
onAttachedToWindow
Link copied to clipboard
void onAttachedToWindow()
onAttachFragment
Link copied to clipboard
void onAttachFragment(Fragment fragment)
onBackPressed
Link copied to clipboard
void onBackPressed()
onCheckImportedDocument
Link copied to clipboard
void onCheckImportedDocument(@NonNull() Document document, @NonNull() CameraFragmentListener.DocumentCheckResultCallback callback)
This method is invoked for imported documents to allow custom validations.
onConfigurationChanged
Link copied to clipboard
void onConfigurationChanged(Configuration newConfig)
onContentChanged
Link copied to clipboard
void onContentChanged()
onContextItemSelected
Link copied to clipboard
boolean onContextItemSelected(MenuItem item)
onContextMenuClosed
Link copied to clipboard
void onContextMenuClosed(Menu menu)
onCreateContextMenu
Link copied to clipboard
void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)
onCreateDescription
Link copied to clipboard
CharSequence onCreateDescription()
onCreateNavigateUpTaskStack
Link copied to clipboard
void onCreateNavigateUpTaskStack(TaskStackBuilder builder)
onCreateOptionsMenu
Link copied to clipboard
boolean onCreateOptionsMenu(Menu menu)
Internal use only.
onCreatePanelMenu
Link copied to clipboard
boolean onCreatePanelMenu(int featureId, Menu menu)
onCreatePanelView
Link copied to clipboard
View onCreatePanelView(int featureId)
onCreateSupportNavigateUpTaskStack
Link copied to clipboard
void onCreateSupportNavigateUpTaskStack(TaskStackBuilder builder)
onCreateThumbnail
Link copied to clipboard
boolean onCreateThumbnail(Bitmap outBitmap, Canvas canvas)
onCreateView
Link copied to clipboard
View onCreateView(View parent, String name, Context context, AttributeSet attrs)
onDetachedFromWindow
Link copied to clipboard
void onDetachedFromWindow()
onDocumentAvailable
Link copied to clipboard
void onDocumentAvailable(@NonNull() Document document)
Called when the user has taken an image with the camera or has imported a document that passed the Gini Vision Library's validation and any custom checks that were implemented.
onEnterAnimationComplete
Link copied to clipboard
void onEnterAnimationComplete()
onError
Link copied to clipboard
void onError(@NonNull() GiniVisionError error)
Called when an error occurred.
onExtractionsAvailable
Link copied to clipboard
void onExtractionsAvailable(@NonNull() Map<String, GiniVisionSpecificExtraction> extractions)
Called after a QRCode was successfully analyzed.
onGenericMotionEvent
Link copied to clipboard
boolean onGenericMotionEvent(MotionEvent event)
onGetDirectActions
Link copied to clipboard
void onGetDirectActions(CancellationSignal cancellationSignal, Consumer<List<DirectAction>> callback)
onKeyDown
Link copied to clipboard
boolean onKeyDown(int keyCode, KeyEvent event)
onKeyLongPress
Link copied to clipboard
boolean onKeyLongPress(int keyCode, KeyEvent event)
onKeyMultiple
Link copied to clipboard
boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event)
onKeyShortcut
Link copied to clipboard
boolean onKeyShortcut(int keyCode, KeyEvent event)
onKeyUp
Link copied to clipboard
boolean onKeyUp(int keyCode, KeyEvent event)
onLocalVoiceInteractionStarted
Link copied to clipboard
void onLocalVoiceInteractionStarted()
onLocalVoiceInteractionStopped
Link copied to clipboard
void onLocalVoiceInteractionStopped()
onLowMemory
Link copied to clipboard
void onLowMemory()
onMenuItemSelected
Link copied to clipboard
final boolean onMenuItemSelected(int featureId, MenuItem item)
onMenuOpened
Link copied to clipboard
boolean onMenuOpened(int featureId, Menu menu)
onMultiWindowModeChanged
Link copied to clipboard
void onMultiWindowModeChanged(boolean isInMultiWindowMode)
onNavigateUp
Link copied to clipboard
boolean onNavigateUp()
onNavigateUpFromChild
Link copied to clipboard
boolean onNavigateUpFromChild(Activity child)
onOptionsItemSelected
Link copied to clipboard
boolean onOptionsItemSelected(MenuItem item)
Internal use only.
onOptionsMenuClosed
Link copied to clipboard
void onOptionsMenuClosed(Menu menu)
onPanelClosed
Link copied to clipboard
void onPanelClosed(int featureId, Menu menu)
onPerformDirectAction
Link copied to clipboard
void onPerformDirectAction(String actionId, Bundle arguments, CancellationSignal cancellationSignal, Consumer<Bundle> resultListener)
onPictureInPictureModeChanged
Link copied to clipboard
void onPictureInPictureModeChanged(boolean isInPictureInPictureMode)
onPictureInPictureRequested
Link copied to clipboard
boolean onPictureInPictureRequested()
onPointerCaptureChanged
Link copied to clipboard
void onPointerCaptureChanged(boolean hasCapture)
onPrepareNavigateUpTaskStack
Link copied to clipboard
void onPrepareNavigateUpTaskStack(TaskStackBuilder builder)
onPrepareOptionsMenu
Link copied to clipboard
boolean onPrepareOptionsMenu(Menu menu)
onPreparePanel
Link copied to clipboard
boolean onPreparePanel(int featureId, View view, Menu menu)
onPrepareSupportNavigateUpTaskStack
Link copied to clipboard
void onPrepareSupportNavigateUpTaskStack(TaskStackBuilder builder)
onProceedToMultiPageReviewScreen
Link copied to clipboard
void onProceedToMultiPageReviewScreen(@NonNull() GiniVisionMultiPageDocument multiPageDocument)
onProvideAssistContent
Link copied to clipboard
void onProvideAssistContent(AssistContent outContent)
onProvideAssistData
Link copied to clipboard
void onProvideAssistData(Bundle data)
onProvideKeyboardShortcuts
Link copied to clipboard
void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data, Menu menu, int deviceId)
onProvideReferrer
Link copied to clipboard
Uri onProvideReferrer()
onQRCodeAvailable
Link copied to clipboard
void onQRCodeAvailable(@NonNull() QRCodeDocument qrCodeDocument)
Called when the user clicked the QR Code detected popup.
onRequestPermissionsResult
Link copied to clipboard
void onRequestPermissionsResult(int requestCode, Array<String> permissions, Array<int> grantResults)
onRetainCustomNonConfigurationInstance
Link copied to clipboard
Object onRetainCustomNonConfigurationInstance()
onRetainNonConfigurationInstance
Link copied to clipboard
final Object onRetainNonConfigurationInstance()
onSearchRequested
Link copied to clipboard
boolean onSearchRequested(SearchEvent searchEvent)
onStateNotSaved
Link copied to clipboard
void onStateNotSaved()
onSupportActionModeFinished
Link copied to clipboard
void onSupportActionModeFinished(ActionMode mode)
onSupportActionModeStarted
Link copied to clipboard
void onSupportActionModeStarted(ActionMode mode)
onSupportContentChanged
Link copied to clipboard
void onSupportContentChanged()
onSupportNavigateUp
Link copied to clipboard
boolean onSupportNavigateUp()
onTopResumedActivityChanged
Link copied to clipboard
void onTopResumedActivityChanged(boolean isTopResumedActivity)
onTouchEvent
Link copied to clipboard
boolean onTouchEvent(MotionEvent event)
onTrackballEvent
Link copied to clipboard
boolean onTrackballEvent(MotionEvent event)
onTrimMemory
Link copied to clipboard
void onTrimMemory(int level)
onUserInteraction
Link copied to clipboard
void onUserInteraction()
onVisibleBehindCanceled
Link copied to clipboard
void onVisibleBehindCanceled()
onWindowAttributesChanged
Link copied to clipboard
void onWindowAttributesChanged(WindowManager.LayoutParams params)
onWindowFocusChanged
Link copied to clipboard
void onWindowFocusChanged(boolean hasFocus)
onWindowStartingActionMode
Link copied to clipboard
ActionMode onWindowStartingActionMode(ActionMode.Callback callback)
onWindowStartingSupportActionMode
Link copied to clipboard
openContextMenu
Link copied to clipboard
void openContextMenu(View view)
openFileInput
Link copied to clipboard
FileInputStream openFileInput(String name)
openFileOutput
Link copied to clipboard
FileOutputStream openFileOutput(String name, int mode)
openOptionsMenu
Link copied to clipboard
void openOptionsMenu()
openOrCreateDatabase
Link copied to clipboard
SQLiteDatabase openOrCreateDatabase(String name, int mode, SQLiteDatabase.CursorFactory factory)
overridePendingTransition
Link copied to clipboard
void overridePendingTransition(int enterAnim, int exitAnim)
peekAvailableContext
Link copied to clipboard
Context peekAvailableContext()
peekWallpaper
Link copied to clipboard
Drawable peekWallpaper()
postponeEnterTransition
Link copied to clipboard
void postponeEnterTransition()
putExtraData
Link copied to clipboard
void putExtraData(ComponentActivity.ExtraData extraData)
recreate
Link copied to clipboard
void recreate()
registerActivityLifecycleCallbacks
Link copied to clipboard
registerComponentCallbacks
Link copied to clipboard
void registerComponentCallbacks(ComponentCallbacks callback)
registerForActivityResult
Link copied to clipboard
final ActivityResultLauncher<IregisterForActivityResult<I, O>(ActivityResultContract<I, O> contract, ActivityResultRegistry registry, ActivityResultCallback<O> callback)
registerForContextMenu
Link copied to clipboard
void registerForContextMenu(View view)
registerReceiver
Link copied to clipboard
Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter)
releaseInstance
Link copied to clipboard
boolean releaseInstance()
removeDialog
Link copied to clipboard
final void removeDialog(int id)
removeOnContextAvailableListener
Link copied to clipboard
final void removeOnContextAvailableListener(OnContextAvailableListener listener)
removeStickyBroadcast
Link copied to clipboard
void removeStickyBroadcast(Intent intent)
removeStickyBroadcastAsUser
Link copied to clipboard
void removeStickyBroadcastAsUser(Intent intent, UserHandle user)
reportFullyDrawn
Link copied to clipboard
void reportFullyDrawn()
requestDragAndDropPermissions
Link copied to clipboard
requestPermissions
Link copied to clipboard
final void requestPermissions(Array<String> permissions, int requestCode)
requestShowKeyboardShortcuts
Link copied to clipboard
final void requestShowKeyboardShortcuts()
requestVisibleBehind
Link copied to clipboard
boolean requestVisibleBehind(boolean visible)
requestWindowFeature
Link copied to clipboard
final boolean requestWindowFeature(int featureId)
requireViewById
Link copied to clipboard
final T requireViewById<T extends View>(int id)
revokeUriPermission
Link copied to clipboard
void revokeUriPermission(Uri uri, int modeFlags)
runOnUiThread
Link copied to clipboard
final void runOnUiThread(Runnable action)
sendBroadcast
Link copied to clipboard
void sendBroadcast(Intent intent)
sendBroadcastAsUser
Link copied to clipboard
void sendBroadcastAsUser(Intent intent, UserHandle user)
sendBroadcastWithMultiplePermissions
Link copied to clipboard
void sendBroadcastWithMultiplePermissions(Intent intent, Array<String> receiverPermissions)
sendOrderedBroadcast
Link copied to clipboard
void sendOrderedBroadcast(Intent intent, String receiverPermission)
sendOrderedBroadcastAsUser
Link copied to clipboard
void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras)
sendStickyBroadcast
Link copied to clipboard
void sendStickyBroadcast(Intent intent)
sendStickyBroadcastAsUser
Link copied to clipboard
void sendStickyBroadcastAsUser(Intent intent, UserHandle user)
sendStickyOrderedBroadcast
Link copied to clipboard
void sendStickyOrderedBroadcast(Intent intent, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras)
sendStickyOrderedBroadcastAsUser
Link copied to clipboard
void sendStickyOrderedBroadcastAsUser(Intent intent, UserHandle user, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras)
setActionBar
Link copied to clipboard
void setActionBar(Toolbar toolbar)
setAnalysisActivityExtra
Link copied to clipboard
static void setAnalysisActivityExtra<T extends AnalysisActivity>(Intent target, Context context, Class<T> analysisActivityClass)
Helper for setting the EXTRA_IN_ANALYSIS_ACTIVITY.
setContentTransitionManager
Link copied to clipboard
void setContentTransitionManager(TransitionManager tm)
setContentView
Link copied to clipboard
void setContentView(int layoutResID)
setDefaultKeyMode
Link copied to clipboard
final void setDefaultKeyMode(int mode)
setEnterSharedElementCallback
Link copied to clipboard
void setEnterSharedElementCallback(SharedElementCallback callback)
setExitSharedElementCallback
Link copied to clipboard
void setExitSharedElementCallback(SharedElementCallback listener)
setFeatureDrawable
Link copied to clipboard
final void setFeatureDrawable(int featureId, Drawable drawable)
setFeatureDrawableAlpha
Link copied to clipboard
final void setFeatureDrawableAlpha(int featureId, int alpha)
setFeatureDrawableResource
Link copied to clipboard
final void setFeatureDrawableResource(int featureId, int resId)
setFeatureDrawableUri
Link copied to clipboard
final void setFeatureDrawableUri(int featureId, Uri uri)
setFinishOnTouchOutside
Link copied to clipboard
void setFinishOnTouchOutside(boolean finish)
setImmersive
Link copied to clipboard
void setImmersive(boolean i)
setInheritShowWhenLocked
Link copied to clipboard
void setInheritShowWhenLocked(boolean inheritShowWhenLocked)
setIntent
Link copied to clipboard
void setIntent(Intent newIntent)
setListener
Link copied to clipboard
void setListener(@NonNull() CameraFragmentListener listener)
Set a listener for camera events.
setLocusContext
Link copied to clipboard
void setLocusContext(LocusId locusId, Bundle bundle)
setMediaController
Link copied to clipboard
final void setMediaController(MediaController controller)
setPictureInPictureParams
Link copied to clipboard
void setPictureInPictureParams(PictureInPictureParams params)
setProgress
Link copied to clipboard
final void setProgress(int progress)
setProgressBarIndeterminate
Link copied to clipboard
final void setProgressBarIndeterminate(boolean indeterminate)
setProgressBarIndeterminateVisibility
Link copied to clipboard
final void setProgressBarIndeterminateVisibility(boolean visible)
setProgressBarVisibility
Link copied to clipboard
final void setProgressBarVisibility(boolean visible)
setRequestedOrientation
Link copied to clipboard
void setRequestedOrientation(int requestedOrientation)
setResult
Link copied to clipboard
final void setResult(int resultCode)
setReviewActivityExtra
Link copied to clipboard
static void setReviewActivityExtra<T extends ReviewActivity>(Intent target, Context context, Class<T> reviewActivityClass)
Helper for setting the EXTRA_IN_REVIEW_ACTIVITY.
setSecondaryProgress
Link copied to clipboard
final void setSecondaryProgress(int secondaryProgress)
setShowWhenLocked
Link copied to clipboard
void setShowWhenLocked(boolean showWhenLocked)
setSupportActionBar
Link copied to clipboard
void setSupportActionBar(Toolbar toolbar)
setSupportProgress
Link copied to clipboard
void setSupportProgress(int progress)
setSupportProgressBarIndeterminate
Link copied to clipboard
void setSupportProgressBarIndeterminate(boolean indeterminate)
void setSupportProgressBarIndeterminateVisibility(boolean visible)
setSupportProgressBarVisibility
Link copied to clipboard
void setSupportProgressBarVisibility(boolean visible)
setTaskDescription
Link copied to clipboard
void setTaskDescription(ActivityManager.TaskDescription taskDescription)
setTheme
Link copied to clipboard
void setTheme(int resId)
setTitle
Link copied to clipboard
void setTitle(CharSequence title)
setTitleColor
Link copied to clipboard
void setTitleColor(int textColor)
setTranslucent
Link copied to clipboard
boolean setTranslucent(boolean translucent)
setTurnScreenOn
Link copied to clipboard
void setTurnScreenOn(boolean turnScreenOn)
setVisible
Link copied to clipboard
void setVisible(boolean visible)
setVolumeControlStream
Link copied to clipboard
final void setVolumeControlStream(int streamType)
setVrModeEnabled
Link copied to clipboard
void setVrModeEnabled(boolean enabled, ComponentName requestedComponent)
setWallpaper
Link copied to clipboard
void setWallpaper(Bitmap bitmap)
shouldShowRequestPermissionRationale
Link copied to clipboard
boolean shouldShowRequestPermissionRationale(String permission)
shouldUpRecreateTask
Link copied to clipboard
boolean shouldUpRecreateTask(Intent targetIntent)
void showActivityIndicatorAndDisableInteraction()
Call this method to show an activity indicator and disable user interaction.
showAssist
Link copied to clipboard
boolean showAssist(Bundle args)
showCameraTriggerButton
Link copied to clipboard
void showCameraTriggerButton()
Call this method to show the camera trigger button.
showDialog
Link copied to clipboard
final void showDialog(int id)
final boolean showDialog(int id, Bundle args)
showDocumentCornerGuides
Link copied to clipboard
void showDocumentCornerGuides()
Call this method to show the document corner guides.
showError
Link copied to clipboard
void showError(@NonNull() String message, int duration)
Call this method to show an error message to the user in the Camera Screen.
showInterface
Link copied to clipboard
void showInterface()
Call this method to show the interface elements.
showLockTaskEscapeMessage
Link copied to clipboard
void showLockTaskEscapeMessage()
startActionMode
Link copied to clipboard
ActionMode startActionMode(ActionMode.Callback callback)
startActivities
Link copied to clipboard
void startActivities(Array<Intent> intents)
startActivity
Link copied to clipboard
void startActivity(Intent intent)
startActivityForResult
Link copied to clipboard
void startActivityForResult(Intent intent, int requestCode)
startActivityFromChild
Link copied to clipboard
void startActivityFromChild(Activity child, Intent intent, int requestCode)
startActivityFromFragment
Link copied to clipboard
void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode)
startActivityIfNeeded
Link copied to clipboard
boolean startActivityIfNeeded(Intent intent, int requestCode)
startForegroundService
Link copied to clipboard
ComponentName startForegroundService(Intent service)
startInstrumentation
Link copied to clipboard
boolean startInstrumentation(ComponentName className, String profileFile, Bundle arguments)
startIntentSender
Link copied to clipboard
void startIntentSender(IntentSender intent, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
startIntentSenderForResult
Link copied to clipboard
void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
startIntentSenderFromChild
Link copied to clipboard
void startIntentSenderFromChild(Activity child, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
startIntentSenderFromFragment
Link copied to clipboard
void startIntentSenderFromFragment(Fragment fragment, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)
startLocalVoiceInteraction
Link copied to clipboard
void startLocalVoiceInteraction(Bundle privateOptions)
startLockTask
Link copied to clipboard
void startLockTask()
startManagingCursor
Link copied to clipboard
void startManagingCursor(Cursor c)
startNextMatchingActivity
Link copied to clipboard
boolean startNextMatchingActivity(Intent intent)
startPostponedEnterTransition
Link copied to clipboard
void startPostponedEnterTransition()
startSearch
Link copied to clipboard
void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData, boolean globalSearch)
startService
Link copied to clipboard
ComponentName startService(Intent service)
startSupportActionMode
Link copied to clipboard
ActionMode startSupportActionMode(ActionMode.Callback callback)
stopLocalVoiceInteraction
Link copied to clipboard
void stopLocalVoiceInteraction()
stopLockTask
Link copied to clipboard
void stopLockTask()
stopManagingCursor
Link copied to clipboard
void stopManagingCursor(Cursor c)
stopService
Link copied to clipboard
boolean stopService(Intent name)
superDispatchKeyEvent
Link copied to clipboard
boolean superDispatchKeyEvent(KeyEvent event)
supportFinishAfterTransition
Link copied to clipboard
void supportFinishAfterTransition()
supportInvalidateOptionsMenu
Link copied to clipboard
void supportInvalidateOptionsMenu()
supportNavigateUpTo
Link copied to clipboard
void supportNavigateUpTo(Intent upIntent)
supportPostponeEnterTransition
Link copied to clipboard
void supportPostponeEnterTransition()
supportRequestWindowFeature
Link copied to clipboard
boolean supportRequestWindowFeature(int featureId)
supportShouldUpRecreateTask
Link copied to clipboard
boolean supportShouldUpRecreateTask(Intent targetIntent)
supportStartPostponedEnterTransition
Link copied to clipboard
void supportStartPostponedEnterTransition()
takeKeyEvents
Link copied to clipboard
void takeKeyEvents(boolean get)
triggerSearch
Link copied to clipboard
void triggerSearch(String query, Bundle appSearchData)
unbindService
Link copied to clipboard
void unbindService(ServiceConnection conn)
unregisterComponentCallbacks
Link copied to clipboard
void unregisterComponentCallbacks(ComponentCallbacks callback)
unregisterForContextMenu
Link copied to clipboard
void unregisterForContextMenu(View view)
unregisterReceiver
Link copied to clipboard
void unregisterReceiver(BroadcastReceiver receiver)
updateServiceGroup
Link copied to clipboard
void updateServiceGroup(ServiceConnection conn, int group, int importance)
validateRequestPermissionsRequestCode
Link copied to clipboard
final void validateRequestPermissionsRequestCode(int requestCode)

Properties

EXTRA_IN_ANALYSIS_ACTIVITY
Link copied to clipboard
public final static String EXTRA_IN_ANALYSIS_ACTIVITY
Mandatory extra which must contain an explicit Intent to the AnalysisActivity subclass from your application.
public final static String EXTRA_IN_BACK_BUTTON_SHOULD_CLOSE_LIBRARY
Optional extra wich must contain a boolean and indicates whether the back button should close the Gini Vision Library.
public final static String EXTRA_IN_GINI_VISION_FEATURE_CONFIGURATION
Optional extra which must contain a GiniVisionFeatureConfiguration instance.
EXTRA_IN_ONBOARDING_PAGES
Link copied to clipboard
public final static String EXTRA_IN_ONBOARDING_PAGES
Optional extra which must contain an ArrayList with OnboardingPage objects.
EXTRA_IN_REVIEW_ACTIVITY
Link copied to clipboard
public final static String EXTRA_IN_REVIEW_ACTIVITY
Mandatory extra which must contain an explicit Intent to the ReviewActivity subclass from your application.
EXTRA_IN_SHOW_ONBOARDING
Link copied to clipboard
public final static String EXTRA_IN_SHOW_ONBOARDING
Optional extra which must contain a boolean and indicates whether the Onboarding Screen should be shown when the Gini Vision Library is started.
EXTRA_IN_SHOW_ONBOARDING_AT_FIRST_RUN
Link copied to clipboard
public final static String EXTRA_IN_SHOW_ONBOARDING_AT_FIRST_RUN
Optional extra which must contain a boolean and indicates whether the Onboarding Screen should be shown when the Gini Vision Library is started for the first time.
EXTRA_OUT_ERROR
Link copied to clipboard
public final static String EXTRA_OUT_ERROR
Returned when the result code is RESULT_ERROR and contains a GiniVisionError object detailing what went wrong.
EXTRA_OUT_EXTRACTIONS
Link copied to clipboard
public final static String EXTRA_OUT_EXTRACTIONS
Returned when extractions are available.
RESULT_ERROR
Link copied to clipboard
public final static int RESULT_ERROR
Returned result code in case something went wrong.