Get Started with Android
Reference for the Magic SDK for Android.
Overview
The Magic SDK for Android is your entry-point to secure, passwordless authentication for your mobile app. This guide will cover some important topics for getting started with Android APIs and to make the most of Magic's features.
Magic can support either server-based or serverless web applications. It is up to the developers to implement the Admin SDK to validate the DID Token.
- View the API documentation below to learn the methods you'll be using
Installation
Magic SDK is available in mavenCentral
. Simply add the following line to the build.gradle
in your Android project:
Sync the project with new dependencies settings.
Creating an SDK Instance
All the examples are written in Kotlin.
Returns CompletableFuture
All Magic functions are asynchronous calls. They will return a CompletableFuture object, which resolves the results in a Response class.
To get the result without blocking the UI thread, call CompletableFuture.whenComplete
to wait for the results asynchronously.
For the full implementation of Response class, please check here.