bdswiss erfahrung

Welcome, Guest
Username: Password: Remember me

TOPIC: ONYX Enroll Wizard Setup Guide

ONYX Enroll Wizard Setup Guide 04 Dec 2014 18:56 #22

  • cwheatley
  • cwheatley's Avatar
  • Offline
  • Administrator
  • Posts: 9
  • Thank you received: 1
  • Karma: 0
Project Setup

Unzip the onyx-enroll-wizard-x.y.z-android-sdk.zip file to somewhere other than your existing Eclipse workspace.


First, create an Android Library Project in Eclipse using the onyx-enroll-wizard folder, using the following steps:
  • In Eclipse, select File -> Import.
  • From the Import dialog, select Android -> Existing Android Code Into Workspace. Then click Next.
  • Select the checkbox to “Copy projects into workspace.”
  • Next to Root Directory, type in the path to the onyx-enroll-wizard folder or select Browse and navigate to the folder. (C:\path\to\onyx-enroll-wizard-x.y.z-android-sdk\onyx-enroll-wizard).
  • Confirm the project is a library project.
  • * Right-click on the project, select Properties.
    * Select Android in the navigation window.
    * Under Library, the checkbox for “Is Library” should be selected.


Once added as a library project, add onyx-enroll-wizard to your Android Application Project:
  • Under Properties->Android->Library, hit the Add button.
  • Select the onyx-enroll-wizard project and hit OK.
Using the Enrollment Wizard

Add the following permissions to the manifest tag in your AndroidManifest.xml file:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus"
    android:required="true" />
<uses-feature android:name="android.hardware.flash" 
    android:required="false" />

Add the following activities to the application tag in your AndroidManifest.xml:
        <activity
            android:name="com.dft.onyx.wizardroid.enrollwizard.SelfEnrollWizardActivity"
            android:screenOrientation="portrait" >
        </activity>        
        <activity
            android:name="com.dft.onyx.guide.OnyxGuideActivity"
            android:screenOrientation="portrait" >
        </activity>        
        <activity
            android:name="com.dft.onyx.verify.SelfVerifyActivity"
            android:screenOrientation="portrait"
            android:label="@string/app_name" >
        </activity>
        <activity android:name="com.dft.onyx.enroll.ui.TipsActivity"
            android:screenOrientation="portrait" >
        </activity>

To start the Enroll Wizard, generate an intent to launch the Self Enroll Wizard, and pass it your application’s context (usually the current activity’s Context), your ONYX license key. This will start the Enroll Wizard with the self enrollment layout. By default it will show the ONYX Guide, but this can be customized using your own EnrollWizardBuilder object, if desired.
private final int REQUEST_CODE = 1; // Your custom request code here
...
// First generate an intent using the SelfEnrollIntentHelper
Intent onyxSelfEnrollIntent = new SelfEnrollIntentHelper().getSelfEnrollIntent(this, onyxLicenseKey);

// Finally, start the onyxSelfEnrollIntent  using your REQUEST_CODE
startActivityForResult(onyxSelfEnrollIntent, REQUEST_CODE);

This will return back to your activity in the method onActivityResult(), where you can proceed with your application. See below:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (REQUEST_CODE == requestCode) {
        if (Activity.RESULT_OK == resultCode) {
            // Enrollment was a success
        } else {
            // Enrollment failed
        }
    }
}
Last Edit: 11 Feb 2015 21:06 by cwheatley.
The administrator has disabled public write access.
Time to create page: 0.099 seconds