In this section, we've included some examples of SDK usage below and configurations available.

1. Open Camera Scanner and Scan ID Documents

1.1. Start Scanner for Driver Licence or ID Card

This section offers code samples for Driver's License or ID card scanners.

1.1.1. Create an OrbitSDK instance

📘

Note:

Please initialize the OrbitSDK first before creating an OrbitSDK instance to activate the OrbitSDK.

To create an OrbitSDK instance, simply follow the code sample below:
Code Sample:

/** Create an instance of OrbitSDK.
*
* @param activity The current activity
* @return An initialized OrbitSDK instance 
*/
public OrbitSDK(Activity activity) //OrbitSDK Function
OrbitSDK scanner = new OrbitSDK(this); //Create an instance

1.1.2. Start OrbitSDK with doctype

📘

Note:

Please call the card scanning function first to start the OrbitSDK with doctype.

To start the OrbitSDK with doctype, simply follow the code below:

Code Sample:

/** Start camera control.
*
* @param requestParam The doc type
* @param requestCode The operation type
* @return The status code 
*/
public boolean start(String requestParam, int requestCode) //Card Scanning Function
scanner.start("AUS_AUTO_DRIVERLICENCE", OrbitSDK.REQUEST_CODE_SCAN); //Start OrbitSDK with doctype using an instance

These are some document types available that can be used when starting OrbitSDK:

"AUS_AUTO_DRIVERLICENCE"
"AUS_ACT_DRIVERLICENCE"
"AUS_NSW_DRIVERLICENCE"
"AUS_NT_DRIVERLICENCE"
"AUS_QLD_DRIVERLICENCE"
"AUS_SA_DRIVERLICENCE"
"AUS_TAS_DRIVERLICENCE"
"AUS_VIC_DRIVERLICENCE"
"AUS_WA_DRIVERLICENCE"
"AUS_IMMICARD"
"AUS_NSW_PROOFOFAGE"
"CAN_AB_DRIVERLICENCE"
"CAN_BC_DRIVERLICENCE"
"CAN_ON_DRIVERLICENCE"
"CAN_XX_PDF417"
"NZL_DRIVERLICENCE"

1.1.3. Enable/Disable Back Card Scan

📘

Note:

If back scanning is enabled, a dialog box will appear asking whether to continue scanning the back card or not when the front card scan is complete.

The code below is the general setting of the Back Card Scan:

Code Sample:

public boolean scanBackSide = false; //General SDK setting

You can set the value to True to enable the Back Card Scan or False to disable the Back Card Scan.

To set up the Back Card Scan, simply follow the code sample below:

Code Sample:

scanner.uiSetting.scanBackSide = value; // The value is True or False

1.2. Start Scanner for Passport

This section offers code samples for the passport scanner:

1.2.1. Create an OrbitMrzSDK instance

📘

Note:

Please initialize the OrbitMrzSDK first before creating the OrbitMrzSDK to activate the OrbitMrzSDK.

To create the OrbitMrzSDK instance, simply the code sample below:

Code Sample:

/** Create an instance of OrbitMrzSDK.
*
* @param activity The current activity
* @return An initialized OrbitMrzSDK instance 
*/
public OrbitMrzSDK(Activity activity) //OrbitMrzSDK function
OrbitMrzSDK scanner = new OrbitMrzSDK(this);//Create an Instance

1.2.2. Start OrbitMrzSDK instance

📘

Note:

Please call the OrbitMrzSDK scanning function first, to start the OrbitMrzSDK instance.

To start the OrbitMrzSDK, simply follow the code below:

Code Sample:

/** Start camera control.
*
* @param requestCode The operation type
* @return The status code 
*/
public boolean start(int requestCode)//OrbitMrzSDK Scanning Function
scanner.start(OrbitMrzSDK.SCAN_REQUEST_CODE);//Start OrbitmRZSDK using an instance

1.2.3. Scan Mode Available:

There are 2 scan modes to scan automatically and manually:

OrbitMrzSDK.SCANMODE_CAMERA //automatically
OrbitMrzSDK.SCANMODE_PHOTO //manually

Here is a sample code that presents the Passport Scanner with automatically scan mode:

OrbitMrzSDK scanner = new OrbitMrzSDK(this); //Create an Instance
scanner.scanMode = OrbitMrzSDK.SCANMODE_CAMERA; //automatically
scanner.start(OrbitMrzSDK.SCAN_REQUEST_CODE); //Start OrbitMrzSDK using an instance

1.3. Start Scanner for Medicare

This section offers a code sample for the Medicare scanner:

1.3.1. Create an OrbitMedicareSDK instance

📘

Note:

Please initialize the OrbitMedicareSDK first before creating the OrbitMedicareSDK instance to activate the OrbitMedicareSDK.

To create the OrbitMedicareSDK instance, simply follow the code sample below:
Code Sample:

/** Create an instance of OrbitMedicareSDK.
*
* @param activity The current activity
* @return An initialized OrbitMedicareSDK instance 
*/
public OrbitMedicareSDK(Activity activity) //OrbitMedicareSDK function
OrbitMedicareSDK scanner = new OrbitMedicareSDK(this); // Create an Instance

1.3.2. Start OrbitMedicareSDK instance

📘

Note:

Please call the OrbitMedicareSDK card scanning function first to start the OrbitMedicareSDK.

To start the OrbitMedicareSDK, simply follow the code sample below:
Code Sample:

/** Start camera control.
*
* @param requestCode The operation type
* @return The status code 
*/
public boolean start(int requestCode) // OrbitMedicareSDK scan function
scanner.start(OrbitMedicareSDK.REQUEST_CODE_SCAN); //Start OrbitMedicareSDK using an instance

2. Camera UI Customisation

The Camera UI may be customized in a variety of ways. The following is an example of some of the customization:

2.1. Add a Header Title and Subtitle Message

The attributes exists for all 3 frameworks (MRZ, 4ScanID and Medicare). The main attributes to look for are:

  • overlayHeaderLabelColor
  • overlayHeaderLabelTextSize
  • overlayHeaderLabelText
  • overlaySubLabelColor
  • overlaySubLabelTextSize
  • overlaySubLabelText

📘

Note:

4ScanID is the same as the ANZBinding.

Please find the following code below for an example of the code above.

Code Sample:

scanner.showOverlayText = true;

scanner.overlayHeaderLabelText = "Australia Driver License";
scanner.overlayHeaderLabelColor = Color.WHITE;
scanner.overlayHeaderLabelTextSize = 20;

scanner.overlaySubLabelText  = "Put your driver licence in this frame";
scanner.overlaySubLabelColor = Color.WHITE;
scanner.overlaySubLabelTextSize = 12;

The graphic below illustrates how the overlay's code above is implemented in your project application's Camera UI.

10801080

The following are the descriptions from number one to two:

  1. The Overlay Text Box. This text box is located in the middle of the screen.
  2. The Overlay Header Label. This is the heading of the overlay text.
  3. The Overlay Header Label Color. This is the font color of the overlay header.
  4. The Overlay Header Label Color Text Size. This is the font size of the overlay header.
  5. The Overlay Sub Label Text. This is the subheading of the overlay text.
  6. The Overlay Sub Label Text Color. This is the font color of the subheading text.
  7. The Overlay Sub Label Text Size. This is the font size of the subheading text.

2.2. Hiding of branding and buttons on the Camera UI

To set the hiding of the branding and buttons on the Camera UI, please refer to the code sample below:

scanner.uiSetting.closeButton.buttonVisible = true
scanner.uiSetting.settingButton.buttonVisible = true
scanner.uiSetting.imageGalleryButton.buttonVisible = false
scanner.uiSetting.cameraSwitchButton.buttonVisible = true
scanner.uiSetting.manualEntryButton.buttonVisible = true
scanner.uiSetting.flashButton.buttonVisible = false

The graphic below illustrates how the hiding of the branding and buttons on the Camera UI's code above is implemented in your project application's Camera UI.

10801080

The following are the descriptions from number one to four:

  1. The Close Button. This functions to close the scanning process.
  2. The Setting Button. This functions to open the scanning process's settings.
  3. The Camera Switch Button. This functions to toggle between the front and rear cameras.
  4. The Manual Entry Button. This button has no action value, it closed the camera control.

2.3. Set Date Format

To set the date format, please refer to the code sample below:

public java.lang.String dateFormat = "dd/MM/yyyy";

The supported date formats are the following:

Date Format

Display Name

DD/MM/YYYY

31/12/2015

DD/MM/YY

31/12/15

MM/DD/YYYY

12/31/2015

MM/DD/YY

12/31/15

DD MMM YYYY

31 Dec 2015

DD MMMM YYYY

31 December 2015

The graphic below illustrates how the date format code above is implemented in your project application's Camera UI. The Date format appears on the setting section after clicking the Setting button.

10801080

2.4. Set Camera Orientation

To set the camera view orientation, please refer to the code sample below:

public int cameraViewOrientation = 0;

The graphic below illustrates how the camera orientation code above is implemented in your project application's Camera UI. The camera orientation appears on the setting section after clicking the Setting button.

10801080

2.5. Show Capture Preview

Show Capture Preview is a feature where you can preview the document prior to taking a picture of that document. To show capture preview put true value and false value not to show capture preview. Please refer to the code sample below:

public boolean showCapturePreview = true;

The graphic below illustrates how the show capture preview code above is implemented in your project application's Camera UI. The show capture preview appears in the setting section after clicking the Setting button.

10801080

3. Understanding the Result

Once data has been captured and processed, they will be returned onActivityResult() function.

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data)

The data contains a JSON representation of the scanned ID. Below is a sample code to override onActivityResult:

3.1. Driver Licence and ID Card Result

To star result on the Driver's License and ID card, simply follow the code below:
Code Sample:

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if(requestCode == OrbitSDK.REQUEST_CODE_SCAN && resultCode == OrbitSDK.RESPONSE_OK)
        {
            ScanIDOCRResult result = data.getParcelableExtra(KEY_RESULT_JSON);
            String jsonString = result.resultString;
            String status = result.statusCode;

            Bitmap bmp_front = scanner.getCropedImageFront();
            Bitmap bmp_back  = scanner.getCropedImageBack();
            Bitmap bmp_face  = scanner.getCropedImageFace();
        }
    }

Inside ScanIDOCRResult, you can access data such as the card type, license type, and user's personal information. Result details are shown in the following header:

public ResultField cardType;
public ResultField countryOfIssue;
public ResultField issuer;
public ResultField lastName;
public ResultField firstName;
public ResultField middleName;
public ResultField dOB;
public ResultField expiryDate;
public ResultField licenceNumber;
public ResultField address;
public ResultField street;
public ResultField city;
public ResultField state;
public ResultField zipCode;
public ResultField licenceClass;
public ResultField licenceCondition;
public ResultField licenceType;
public ResultField expired;
public ResultField over18;

public ResultField cardStyle;
public ResultField cardNumber;
public ResultField sex;
public ResultField nationality;
public ResultField donor;
public ResultField issueDate;
public ResultField entitlements;
public ResultField licenceVersion;

public String statusCode;
public String statusMessage;
public String resultString;
public String overall_asf;
public String cardCorner;
public String photoCover;
public String resolution;
public String cardColor;
public String photoMatch;
public String textModification;
public String flag;
public String alignment;
public String font;

3.2. Passport Result

To start the Passport result, simply follow the code below:
Code Sample:

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if(requestCode == OrbitMrzSDK.REQUEST_CODE_SCAN && resultCode == OrbitMrzSDK.RESPONSE_OK)
        {
            MRZOCRResult result = data.getParcelableExtra(KEY_RESULT_JSON);
            String jsonString = result.resultString;
            String status = result.statusCode;

            Bitmap bmp_front = scanner.getImageFront();
            Bitmap bmp_face  = scanner.getImageFace();
        }
    }

Inside MRZOCRResult you can access data such as the card type, document type, and some of the user's personal information. Result details are shown in the following header:

public ResultField cardType;
public ResultField validation;
public ResultField documentType;
public ResultField countryOfIssue;
public ResultField lastName;
public ResultField firstName;
public ResultField middleName;
public ResultField documentNumber;
public ResultField nationality;
public ResultField dateOfBirth;
public ResultField sex;
public ResultField dateOfExpiry;
public ResultField personalNumber;

public String statusCode;
public String statusMessage;
public String resultString;

3.3. Medicare Result

To start the Medicare result, simply follow the code below:
Code Sample:

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if(requestCode == OrbitMedicareSDK.REQUEST_CODE_SCAN && resultCode == OrbitMedicareSDK.RESPONSE_OK)
        {
            MedicareOCRResult result = data.getParcelableExtra(OrbitMedicareSDK.KEY_RESULT_JSON);
            String jsonString = result.resultString;
            String status = result.statusCode;

            Bitmap bmp_front = scanner.getCropedImageFront();
        }
    }

Inside MedicareOCRResult, you can access data such as the card type, medicare data, and some of the user's information. Result details are shown in the following header:

public ResultField cardType;
public ResultField countryOfIssue;
public ResultField issuer;
public ResultField medicareId;
public ResultField identifierNo;
public ResultField issueNo;
public ResultField checksum;
public ResultField user1;
public ResultField user2;
public ResultField user3;
public ResultField user4;
public ResultField user5;
public ResultField validTo;
public ResultField mark;
public ResultField hologram;
public ResultField cardColour;

public String statusCode;
public String statusMessage;public String resultString;

💬 We're here to help!

If you encounter an issue, a bug, or require assistance, please contact our support page here to find the solution. Don't forget to provide any important information on the issue.