Setting up Android Studio
This document shows the steps on how to set up your Android environment for the IBM Verify SDK.
- Download the SDK from the App Exchange.
- Start Android Studio and create a new project by accepting the default settings.
- Go to
File
->Project Structure...
and add a new module by click on the+
symbol in the upper left corner. - Select
Import .JAR/.AAR package
and clickNext
. - Click on the Browse button for the
File name
and select theVerifySdk.aar
on your file system. ClickFinish
. - In the left side bar, select your app and then in the tab view, go to the
Dependencies
tab. - Add a new dependency by clicking on the
+
symbol at the bottom. SelectModule dependency
. - Select the
VerifySdk
module in the dialog. - Close the dialogs.
- Click on the
Sync your project with Gradle files
icon.
You should now have the SDK properly linked! Let's test it.
-
In your
MainActivity.java
, insideonCreate()
, add these lines:HotpGeneratorContext hotpGeneratorContext = new HotpGeneratorContext("AB4C", 6, HmacAlgorithm.SHA1, 0); Log.i("SDK Demo", "HOTP: " + hotpGeneratorContext.create());
-
Launch the app in an emulator. Look in Android Monitor, ensuring that your log level is set to "Info":
You'll see a line like this:
SDK Demo: HOTP: 630496
You can find a more detailed description of how to get started with the SDK at https://www.ibm.com/blogs/security-identity-access/getting-started-with-the-ibm-verify-sdk/.