-
- All Implemented Interfaces:
-
android.os.Parcelable
public interface Document implements Parcelable
This class is the container for transferring documents between the client application and the Gini Capture SDK and between the Fragments of the Gini Capture SDK.
Due to the size limitations of the android.os.Bundle, the document data byte array has to be stored in a memory cache when parceling and read from the cache when unparceling.
Warning: Always retrieve the Document extras from a Bundle to force unparceling and removing of the reference to the byte array from the memory cache. Failing to do so will lead to memory leaks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumDocument.TypeSupported document types.
public enumDocument.ImportMethodEnum of supported methods for importing documents.
public classDocument.SourceSource of the document (e.g. camera or external).
-
Method Summary
Modifier and Type Method Description abstract StringgetId()Retrieve the document's unique id. abstract Document.TypegetType()Get the concrete document type. abstract StringgetMimeType()Retrieve the document's mime type (media type). abstract Array<byte>getData()The contents of a document, if the document was loaded into memory. abstract IntentgetIntent()The Intent with which the imported document was received. abstract UrigetUri()The Uri of the imported document. abstract booleanisImported()Document is imported if it was picked from another app from the Camera Screen's documentupload button or if a file was passed to the Gini Capture SDK through the clientapplication from another app. abstract Document.ImportMethodgetImportMethod()Retrieve with which method the document has been imported. abstract Document.SourcegetSource()Retrieve from which source the document originates from. abstract booleanisReviewable()Documents like PDFs are not reviewable and can be passed directly to the Analysis Screen.Reviewable documents have to be shown in the Review Screen first before passing it on to theAnalysis Screen. abstract StringgenerateUploadMetadata(Context context)Generate metadata to be sent to backend when creating partial document. -
-
Method Detail
-
getType
abstract Document.Type getType()
Get the concrete document type.
-
getMimeType
abstract String getMimeType()
Retrieve the document's mime type (media type).
-
getData
@Nullable() abstract Array<byte> getData()
The contents of a document, if the document was loaded into memory.
For photos captured with the camera or for QR Codes this is never null.
If isImported is
{@code true}then this might be null. If it's null you can use getIntent and access the contents using the Intent.
-
getIntent
@Nullable() abstract Intent getIntent()
The Intent with which the imported document was received.
-
isImported
abstract boolean isImported()
Document is imported if it was picked from another app from the Camera Screen's documentupload button or if a file was passed to the Gini Capture SDK through the clientapplication from another app.
-
getImportMethod
@NonNull() abstract Document.ImportMethod getImportMethod()
Retrieve with which method the document has been imported.
-
getSource
@NonNull() abstract Document.Source getSource()
Retrieve from which source the document originates from.
-
isReviewable
abstract boolean isReviewable()
Documents like PDFs are not reviewable and can be passed directly to the Analysis Screen.Reviewable documents have to be shown in the Review Screen first before passing it on to theAnalysis Screen.
-
generateUploadMetadata
abstract String generateUploadMetadata(Context context)
Generate metadata to be sent to backend when creating partial document.
-
-
-
-