Skip to content

Commit

Permalink
Merge pull request #27 from veryfi/feature/LP-363-update-github-demo
Browse files Browse the repository at this point in the history
LP-363: Update Android Demo and improve code
  • Loading branch information
alejouribesanchez authored Mar 21, 2023
2 parents ccbe4f3 + c880095 commit e8b180e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 56 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ package manager for Java.
Add in your project build.gradle file the Veryfi Lens Checks Android SDK dependency:
```ruby
dependencies {
implementation 'com.veryfi.lens:veryfi-lens-cheques-sdk:1.7.0.4'
implementation 'com.veryfi.lens:veryfi-lens-cheques-sdk:1.7.0.5'
}
```

## How to run this project <a name="configuration"></a>
- Clone this repository
- Open the demo with Android Studio
- Add your Veryfi Artifactory credentials to settings.gradle
- Replace credentials in `Application.kt` with yours
- Replace credentials in `MainActivity.kt` with yours
```
const val CLIENT_ID = "XXX" // replace XXX with your assigned Client Id
const val AUTH_USERNAME = "XXX" // replace XXX with your assigned Username
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ dependencies {
implementation 'com.github.pvarry:android-json-viewer:v1.1'

// Veryfi lens
implementation 'com.veryfi.lens:veryfi-lens-cheques-sdk:1.7.0.4'
implementation 'com.veryfi.lens:veryfi-lens-cheques-sdk:1.7.0.5'
}
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:tools="http://schemas.android.com/tools">

<application
android:name="com.veryfi.lens.cheques.demo.Application"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
40 changes: 0 additions & 40 deletions app/src/main/java/com/veryfi/lens/cheques/demo/Application.kt

This file was deleted.

25 changes: 13 additions & 12 deletions app/src/main/java/com/veryfi/lens/cheques/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -464,23 +464,24 @@ class MainActivity : AppCompatActivity() {
veryfiLensSettings.showDocumentTypes = true

val veryfiLensCredentials = VeryfiLensCredentials()
veryfiLensCredentials.apiKey = Application.AUTH_API_KEY
veryfiLensCredentials.username = Application.AUTH_USERNAME
veryfiLensCredentials.clientId = Application.CLIENT_ID
veryfiLensCredentials.url = Application.URL
veryfiLensCredentials.apiKey = AUTH_API_KEY
veryfiLensCredentials.username = AUTH_USERNAME
veryfiLensCredentials.clientId = CLIENT_ID
veryfiLensCredentials.url = URL

VeryfiLens.configure(
this.application,
veryfiLensCredentials,
veryfiLensSettings
) {
}
VeryfiLens.configure(application, veryfiLensCredentials, veryfiLensSettings) {}
startActivity(Intent(this, LogsActivity::class.java))
}

private fun formatColor(color: Int): String {
return String.format("%08x", color)
}
}


companion object {
// REPLACE YOUR KEYS HERE
const val CLIENT_ID = BuildConfig.VERYFI_CLIENT_ID
const val AUTH_USERNAME = BuildConfig.VERYFI_USERNAME
const val AUTH_API_KEY = BuildConfig.VERYFI_API_KEY
const val URL = BuildConfig.VERYFI_URL
}
}

0 comments on commit e8b180e

Please sign in to comment.