Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
arminbauer committed Mar 26, 2015
0 parents commit 24d52d8
Show file tree
Hide file tree
Showing 261 changed files with 2,699 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
bin
gen
proguard

#built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# Office temp files
.~lock.*
.DS_Store

# Crashlytics
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

#Eclipse
.settings
.classpath
.project
148 changes: 148 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.idnow.sdk"
android:versionCode="4"
android:versionName="0.5.0-beta1" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_SMS" />

<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.flash"
android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppTheme" >
<activity
android:name="de.idnow.sdk.Activities_StartActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="idnow" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
<activity
android:name="de.idnow.sdk.Activities_VideoLiveStreamActivity"
android:exported="true"
android:label="@string/title_live_stream_screen"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_ResultActivity"
android:label="@string/title_activity_result"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_VideoOverviewCheckActivity"
android:label="@string/title_activity_second"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_HelpDataActivity"
android:label="@string/title_activity_help_data"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_HelpIDActivity"
android:label="@string/title_activity_id_help"
android:screenOrientation="portrait" >
</activity>

<meta-data
android:name="com.crashlytics.ApiKey"
android:value="1157567b13dd1b98570a0fa32841bc765920e6c5" />

<activity
android:name="de.idnow.sdk.Activities_BaseActivity"
android:label="@string/title_activity_base" >
</activity>

<service android:name="de.idnow.sdk.Util_KillNotificationService" >
</service>

<activity
android:name="de.idnow.sdk.Activities_PhotoCountrySelectionActivity"
android:label="@string/title_activity_photo_country_selection"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_PhotoDocumentSelectionActivity"
android:label="@string/title_activity_photo_document_selection"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_PhotoProcessOverviewActivity"
android:label="@string/title_activity_photo_process_overview"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_PhotoLiveActivity"
android:configChanges="keyboardHidden|orientation"
android:label="@string/title_activity_photo_live"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_PhotoCheckActivity"
android:label="@string/title_activity_photo_check"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_PhotoUploadActivity"
android:label="@string/title_activity_photo_upload"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="de.idnow.sdk.Activities_LegalNoticesActivity"
android:label="@string/title_activity_legal_notices"
android:screenOrientation="portrait" >
</activity>
<activity android:name="de.idnow.sdk.Activities_ZeroActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity android:name="de.idnow.sdk.Activities_EntryActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
</application>

</manifest>
139 changes: 139 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
## Requirements

- minSdkVersion: 14 (Android 4.0 IceCreamSandwich)
- targetSdkVersion: 19 (Android 4.2 Kitkat)
- Internet connection, communication via standard SSL port 443

## AndroidManifest

The following permissions are required:

```
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
```

If Video-Ident will be used, the following permissions are required as well:

```
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```

Moreover, when using an Android LibraryProject, all the Activities, Services and <uses-feature> from the LibraryProject (SDK) have to be mentioned in your Apps AndroidManifest. The simplest way is just to copy the corresponding part of the IDnowSDK AndroidManifest.

## Preparation for Eclipse

The project directory is ready to use for Eclipse.
If you haven't installed Eclipse, download and install Eclipse, the Android SDK and the Eclipse ADT
plugin (see http://code.google.com/android/intro/installing.html for more details)
then start Eclipse.

Import the SDK into your workspace:
For importing select the "existing projects into workspace" option, and browse to the directory of the IDnowSDK-project.
The SDK should then be imported as a library project and should be ready to use.

## BUILDING

For the betaVersion of the SDK, the Crashlytics Plugin has to be installed in Eclipse (http://download.crashlytics.com/android/eclipse/).
This plugin tracks crashes and will be removed in the final SDK version.
Note: don't forget to add the meta-data with the crashlytics api-key into the manifest.

Used libs (these are already added into the project, one doesn't have to set up anything more)
- Socket Communication - Atmosphere: https://github.com/Atmosphere/wasync
- okHttp and Retrofit: http://square.github.io/retrofit/
- OpenTokAndroidSDK 2.4.1 (https://tokbox.com/opentok/libraries/client/android/)

## Example

Please see https://github.com/idnow/de.idnow.android-sample for a sample application

## Usage

The SDK is distributed as an Android Library Project.
After importing the Project in your workspace, go to "Android" in your Project Preferences and add the project as a Library.

The ONLY class in the SDK designated for user access is the IDnowSDK class.

To create an instance of the IDnow SDK, perform the following call and provide the companyid, which was provided to you during setup as well as an activity that receives callbacks. IDnowSDK is a singleton class, so whenever you need to call it just do so with IDnowSDK.getInstance().

```
IDnowSDK.getInstance().initialize(<Activity>, "<companyid>");
```

Set the static parameters for the SDK usage. Context has to be passed, as parameters are persisted in Preferences. You can decide whether to let the user confirm legal agreements (setShowVideoOverviewCheck).
You also can decide if after the identification the IDnow Error/SuccessScreen is shown, or if the callback to your app is triggered right after identification is finished.

```
IDnowSDK.showVideoOverviewCheck(<true/false>, <Context>);
IDnowSDK.showErrorSuccessScreen(<true/false>, <Context>);
```

To actually start the identification pass your transaction token.

```
IDnowSDK.getInstance().start(<Your transaction token>);
```

Here is the full example:

```java
try {
// Initialize with your activity which will handle the SDK callback and pass the id of your company.
// IDnowSDK is a singleton class, so just call it with IDnowSDK.getInstance()
IDnowSDK.getInstance().initialize(StartActivity.this, "ihreBank");

// Set the transactionToken, for example from a TextField
IDnowSDK.setTransactionToken(editTextToken.getText().toString(), context);

// You can decide whether to let the user confirm the legal points.
IDnowSDK.showVideoOverviewCheck(true, context);

// Same goes to the success screen. If none is shown, the app sends the results right back.
// The defaults for the both parameters are "true";
IDnowSDK.showErrorSuccessScreen(true, context);

// To actually start the identification process, pass the transactionToken.
IDnowSDK.getInstance().start(IDnowSDK.getTransactionToken(context));
} catch (Exception e) {
// The SDK checks the input parameters and throws an exception if they don't seem right.
e.printStackTrace();
}
```

The SDK checks the input parameters and throws an Exception if something is deemed not right, to provide you with quick feedback. Handle it as desired.

To handle the results of the identification, implement the standard onActivityResult function in your activity.:

```
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == IDnowSDK.REQUEST_IDNOW_SDK) {
switch(resultCode) {
case IDnowSDK.RESULT_CODE_SUCCESS:
If (data != null) {
String transactionToken = data.getStringExtra(IDnowSDK.RESULT_DATA_TRANSACTION_TOKEN);
Log.v(TAG, "success, transaction token: " + transactionToken);
}
break;
case IDnowSDK.RESULT_CODE_CANCEL:
if (data != null) {
String transactionToken = data.getStringExtra(IDnowSDK.RESULT_DATA_TRANSACTION_TOKEN);
String errorMessage = data.getStringExtra(IDnowSDK.RESULT_DATA_ERROR);
Log.v(TAG, "canceled, transaction token: " + transactionToken + “, error: “ + errorMessage);
}
break;
case IDnowSDK.RESULT_CODE_FAILED:
if (data != null) {
String transactionToken = data.getStringExtra(IDnowSDK.RESULT_DATA_TRANSACTION_NUMBER);
String errorMessage = data.getStringExtra(IDnowSDK.RESULT_DATA_ERROR);
Log.v(TAG, "failed, transaction Token: " + transactionToken + “, error: “ + errorMessage);
}
break;
}
}
}
}
```
Binary file added libs/armeabi/libopentok.so
Binary file not shown.
Binary file added libs/armeabi/libopentok.so2
Binary file not shown.
Binary file added libs/crashlytics.jar
Binary file not shown.
Binary file added libs/gson-2.2.4.jar
Binary file not shown.
Binary file added libs/idnow-android-sdk-0.5.0-beta.jar
Binary file not shown.
Binary file added libs/jackson-annotations-2.2.3.jar
Binary file not shown.
Binary file added libs/jackson-core-2.2.2.jar
Binary file not shown.
Binary file added libs/jackson-databind-2.2.2.jar
Binary file not shown.
Binary file added libs/opentok-android-sdk-2.4.1.jar
Binary file not shown.
Binary file added libs/retrofit-1.6.1.jar
Binary file not shown.
Binary file added libs/slf4j-simple-1.7.2.jar
Binary file not shown.
Binary file added libs/wasync-1.4.1-SNAPSHOT-all.jar
Binary file not shown.
Binary file added libs/x86/libopentok.so
Binary file not shown.
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>IDnow</groupId>
<artifactId>IDnow</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>com.github.nkzawa</groupId>
<artifactId>socket.io-client</artifactId>
<version>0.1.2</version>
</dependency>
</dependencies>
</project>
15 changes: 15 additions & 0 deletions project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
# proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19
android.library=true
Binary file added res/drawable-hdpi/Thumbs.db
Binary file not shown.
Binary file added res/drawable-hdpi/action_switch_camera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/archiving_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/archiving_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/audio_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/autofocus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions res/drawable-hdpi/button_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true"
android:drawable="@color/blue" />

<item android:state_focused="true"
android:drawable="@color/blue" />

<item android:drawable="@color/trans" />

</selector>
Binary file added res/drawable-hdpi/camera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/driverslicense.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/face_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/idcard.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/idcard_old.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/idnow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/logo0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/logo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/mask_id_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/mask_id_2_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/mute_pub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/mute_sub.png
Binary file added res/drawable-hdpi/no_video.png
Binary file added res/drawable-hdpi/passport.jpg
Binary file added res/drawable-hdpi/residence.JPG
Binary file added res/drawable-hdpi/speaker_active.png
Binary file added res/drawable-hdpi/unmute_pub.png
Binary file added res/drawable-hdpi/unmute_sub.png
Binary file added res/drawable-mdpi/Thumbs.db
Binary file not shown.
Binary file added res/drawable-mdpi/action_switch_camera.png
Binary file added res/drawable-mdpi/archiving_off.png
Binary file added res/drawable-mdpi/archiving_on.png
Binary file added res/drawable-mdpi/audio_only.png
Binary file added res/drawable-mdpi/autofocus.png
Binary file added res/drawable-mdpi/avatar.png
12 changes: 12 additions & 0 deletions res/drawable-mdpi/button_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true"
android:drawable="@color/blue" />

<item android:state_focused="true"
android:drawable="@color/blue" />

<item android:drawable="@color/trans" />

</selector>
Binary file added res/drawable-mdpi/camera.png
Binary file added res/drawable-mdpi/driverslicense.jpg
Binary file added res/drawable-mdpi/face_mask.png
Binary file added res/drawable-mdpi/ic_launcher.png
Binary file added res/drawable-mdpi/idcard.jpg
Binary file added res/drawable-mdpi/idcard_old.jpg
Binary file added res/drawable-mdpi/idnow.png
Binary file added res/drawable-mdpi/logo.png
Binary file added res/drawable-mdpi/logo0.png
Binary file added res/drawable-mdpi/logo1.png
Binary file added res/drawable-mdpi/logo2.png
Binary file added res/drawable-mdpi/mask_id_1.png
Binary file added res/drawable-mdpi/mask_id_2_3.png
Binary file added res/drawable-mdpi/mute_pub.png
Binary file added res/drawable-mdpi/mute_sub.png
Binary file added res/drawable-mdpi/no_video.png
Binary file added res/drawable-mdpi/passport.jpg
Binary file added res/drawable-mdpi/publisher.png
Binary file added res/drawable-mdpi/residence.JPG
Binary file added res/drawable-mdpi/speaker_active.png
Binary file added res/drawable-mdpi/unmute_pub.png
Binary file added res/drawable-mdpi/unmute_sub.png
Binary file added res/drawable-xhdpi/Thumbs.db
Binary file not shown.
Binary file added res/drawable-xhdpi/action_switch_camera.png
Binary file added res/drawable-xhdpi/archiving_off.png
Binary file added res/drawable-xhdpi/archiving_on.png
Binary file added res/drawable-xhdpi/audio_only.png
Binary file added res/drawable-xhdpi/autofocus.png
Binary file added res/drawable-xhdpi/avatar.png
12 changes: 12 additions & 0 deletions res/drawable-xhdpi/button_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true"
android:drawable="@color/blue" />

<item android:state_focused="true"
android:drawable="@color/blue" />

<item android:drawable="@color/trans" />

</selector>
Binary file added res/drawable-xhdpi/camera.png
Binary file added res/drawable-xhdpi/driverslicense.jpg
Binary file added res/drawable-xhdpi/face_mask.png
Binary file added res/drawable-xhdpi/ic_launcher.png
Binary file added res/drawable-xhdpi/idcard.jpg
Binary file added res/drawable-xhdpi/idcard_old.jpg
Binary file added res/drawable-xhdpi/idnow.png
Binary file added res/drawable-xhdpi/logo.png
Binary file added res/drawable-xhdpi/logo0.png
Binary file added res/drawable-xhdpi/logo1.png
Binary file added res/drawable-xhdpi/logo2.png
Binary file added res/drawable-xhdpi/mask_id_1.png
Binary file added res/drawable-xhdpi/mask_id_2_3.png
Binary file added res/drawable-xhdpi/mute_pub.png
Binary file added res/drawable-xhdpi/mute_sub.png
Binary file added res/drawable-xhdpi/no_video.png
Binary file added res/drawable-xhdpi/passport.jpg
Binary file added res/drawable-xhdpi/residence.JPG
Binary file added res/drawable-xhdpi/speaker_active.png
Binary file added res/drawable-xhdpi/unmute_pub.png
Binary file added res/drawable-xhdpi/unmute_sub.png
Binary file added res/drawable-xxhdpi/archiving_off.png
Binary file added res/drawable-xxhdpi/archiving_on.png
Binary file added res/drawable-xxhdpi/audio_only.png
Binary file added res/drawable-xxhdpi/autofocus.png
Binary file added res/drawable-xxhdpi/avatar.png
Loading

0 comments on commit 24d52d8

Please sign in to comment.