SAWO
Login
Join our Discord 👋
Contact Sales
Search…
Getting Started 🚀
Integrations
Quickguides
FAQs
Ask the community
Single Page
React
SAWO React Component
Angular
Vue
HTML
Server Side Rendering
NEXT
NUXT
Web Apps
Flask
Django
Laravel
Node JS
Mobile-Development
Android
iOS
HYBRID
Flutter
React Native
Ionic App(React - Typescript)
No Code
Wordpress
Bubble
DESKTOP APPS
Electron
Additonal Content
What to do with your Payload?
How to verify a user?
Migration
Migrating from Passwords to SAWO's Passwordless
Migrating from Social Sign On to SAWO's Passwordless
Powered By
GitBook
Android
Android software development is the process by which applications are created for devices running the Android operating system.
Let's Get your Android App running with SAWO
🙌
​
Requirements
​
​
​
​
Steps
1. Add the following line to the root of
setting.gradle
repositories block.
1
maven
{
url 'https
://
jitpack
.
io'
}
Copied!
2. Add this to your app level build.gradle android block.
1
compileOptions
{
2
sourceCompatibility
JavaVersion
.
VERSION_1_8
3
targetCompatibility
JavaVersion
.
VERSION_1_8
4
}
5
​
6
kotlinOptions
{
7
jvmTarget
=
'1.8'
8
}
Copied!
3. Add this to your app level build.gradle dependencies block
1
implementation 'com
.
github
.
sawolabs
:
Android
-
SDK
:
0.3.0
'
Copied!
Add this to your app level build.gradle defaultConfig block
1
minSdkVersion
24
Copied!
4. Sync your project.
5. To use SAWO Login you would need an
API key
which can be obtained by creating a project in the
sawo dashboard
.
6. Copy the
API key
from the project and keep it safe and secure.
The best practice to store your API key is to store values in .env so that they are not exposed.
7. Create an Activity in Android Studio to get login success response for this example lets assume it is CallbackActivity.
8. In your MainActivity add a button to login and add following code to its onclick handle.
Java
1
import
com
.
sawolabs
.
androidsdk
.
Sawo
;
2
​
3
public
void
onClickLogin
(
View
view
)
{
4
new
Sawo
(
5
this
,
6
""
,
// your api key
7
""
// your api key secret
8
).
login
(
9
"email"
,
// can be one of 'email' or 'phone_number_sms' or 'both_email_phone'
10
CallbackActivity
.
class
.
getName
()
// Callback class name
11
);
12
}
Copied!
Kotlin
1
import
com
.
sawolabs
.
androidsdk
.
Sawo
2
​
3
fun
onClickLogin
(
view
:
View
)
{
4
Sawo
(
5
this
,
6
""
,
// your api key
7
""
// your api key secret
8
).
login
(
9
"email"
,
// can be one of 'email' or 'phone_number_sms' or 'both_email_phone'
10
CallbackActivity
::
class
.
java
.
name
// Callback class name
11
)
12
}
Copied!
10. Get the response payload in the CallbackActivity
Java
1
import
com
.
sawolabs
.
androidsdk
.
ConstantsKt
;
2
​
3
Intent
intent
=
getIntent
();
4
String
message
=
intent
.
getStringExtra
(
ConstantsKt
.
LOGIN_SUCCESS_MESSAGE
);
5
​
6
// continue with your implementation
Copied!
Kotlin
1
import
com
.
sawolabs
.
androidsdk
.
LOGIN_SUCCESS_MESSAGE
2
​
3
val
message
=
intent
.
getStringExtra
(
LOGIN_SUCCESS_MESSAGE
)
4
// continue with your implementation
Copied!
Once the SAWO SDK is successfully set up, a
login form
will be rendered in the provided container as displayed in the picture below:
Congratulations !! The SAWO API is now ready to be used in your Android application
🤘
.
You can also check out SAWO's
Android Sample Kotlin
,
Android Sample Java
​
Deployed Kotlin App
and
Deployed Java App
​
It's okay, we get it! You got Stuck!
😞
Feel free to contact us on #ask-for-help on our
Discord
​
Web Apps - Previous
Node JS
Next - Mobile-Development
iOS
Last modified
23d ago
Copy link
Contents
Let's Get your Android App running with SAWO
Requirements
Steps