diff --git a/README.md b/README.md new file mode 100644 index 0000000..82afadb --- /dev/null +++ b/README.md @@ -0,0 +1,123 @@ + +

+ + BiometricKit Fingerprint Authentication Library + +

+ + + +[![](https://jitpack.io/v/AlexJuca/BiometrickKit.svg)](https://jitpack.io/#AlexJuca/Kiyo) + +BiometricKit is a simple to use and android fingerprint authentication Library written in pure kotlin for Android M (API 23) and above that follows the material design guidelines. Guidelines + + + +Download +-------- + +Download the latest version via Gradle: + +**Step 1:** Include jitpack to your projects build.gradle file +``` +allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } +} +``` + +**Step 2:** Add the Kiyo dependency to your build.gradle file + +``` +dependencies +{ + implementation 'com.github.AlexJuca:Biometrickit:0.0.1' +} +``` + + +Usage +---------- + +**Step 1:** Set up a BiometricKitCallback to handle callbacks. +```java + +private val biometricKitCallback: BiometricKitCallback = object: BiometricKitCallback { + override fun onSdkVersionNotSupported() { + + } + + override fun onBiometricAuthenticationNotSupported() { + + } + + override fun onBiometricAuthenticationNotAvailable() { + + } + + override fun onBiometricAuthenticationPermissionNotGranted() { + + } + + override fun onBiometricAuthenticationInternalError(error: String) { + + } + + override fun onAuthenticationFailed() { + + } + + override fun onAuthenticationCancelled() { + prompt.authenticate(this, false) + } + + override fun onAuthenticationSuccessful() { + Toast.makeText(this@MainActivity, "Bought successfully", Toast.LENGTH_SHORT).show() + } + + override fun onAuthenticationHelp(helpCode: Int, helpString: CharSequence?) { + + } + + override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) { + + } + + } +``` + +**Step 2:** + +```java + val prompt = BiometricKit.BiometricBuilder(this as Context) + .setTitle("Confirm Payment") + .setSubtitle("corextechnologies@gmail.com") + .setDescription("Paying for Kamba Gas Service") + .setNegativeButtonText("Cancel").setInstructions("Touch the fingerprint sensor") + .build() + + prompt.authenticate(biometricKitCallback, true) +``` + +## Version history +``` 0.0.1: Initial Version - 28/03/2019 ```
+ +License +-------- + + Copyright Alexandre Antonio Juca + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/app/src/main/java/io/github/alexjuca/biometrickitdemo/MainActivity.kt b/app/src/main/java/io/github/alexjuca/biometrickitdemo/MainActivity.kt index 19dfb7f..7d67f64 100644 --- a/app/src/main/java/io/github/alexjuca/biometrickitdemo/MainActivity.kt +++ b/app/src/main/java/io/github/alexjuca/biometrickitdemo/MainActivity.kt @@ -66,7 +66,7 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - prompt = BiometricKit.BiometricBuilder(this as Context) + val prompt = BiometricKit.BiometricBuilder(this as Context) .setTitle("Confirm Payment") .setSubtitle("corextechnologies@gmail.com") .setDescription("Paying for Kamba Gas Service") diff --git a/logo.png b/logo.png index a5a54ac..c50d770 100644 Binary files a/logo.png and b/logo.png differ