Android SDK for the mTag Platform (v2)
Currently this library is only available through Github. Feel free to either clone the repo, or use jitpack.io
.
- Add the JitPack repository to your build file Add it in your build.gradle at the end of repositories:
repositories {
// ...
maven { url "https://jitpack.io" }
}
- Add the dependency in the form
dependencies {
implementation 'com.github.BlueBiteLLC:mtag-sdk-android'
}
- Add the library to your target's Gradle file.
- Extend the target Activity with
BlueBiteInteractionDelegate
. - Implement the two delegate methods,
interactionDataWasReceived
andinteractionDidFail
. - Create an instance of
API
using theAPI(BlueBiteInteractionDelegate mDelegate)
constructor, with the Activity from Step 2 as the argument. - Upon finding a potential verifiable URL, call
API.interactionWasReceived
and pass the target URL as a String. - Handle the response in the
BlueBiteInteractionDelegate
methods.
There is an example app included in this repo. Simply clone it and run the app
target in Android Studio. The app will attempt to validate any http(s) format NFC tag, displaying output from the Interaction Delegate both in console and in UI.
This SDK is licensed under Apache 2.0, please see the LICENSE.txt file for more information.