How to Integrate Okra in Your Android App

Okra’s upgraded Android SDK helps you build great fintech android apps.

How to Integrate Okra in Your Android App

Hey, you might have opened this article because you want to use Okra in your Android application, but you're unsure how to get started. Or maybe you are just curious. Whatever the case may be, you're in luck! In this piece, I'll be walking you through step-by-step instructions on how to get it done; spoilers - it's super easy 🎉

Definitions

Okra provides open finance infrastructure that enables developers and businesses to build personalized digital products and services for consumers in Africa.

Android provides the right building blocks to help you create experiences that people love, faster and easier across every Android device.

Prerequisites

This article is not an intro to android development, and it doesn't cover the basics. You'll need to be familiar with java or kotlin and have a basic android studio setup on your machine to get started.

If you don’t have a basic android studio setup for your machine, follow this guide, else continue with the article.

To get started with Okra, you need to do the following:

  • Sign up with Okra (if you don't already have an account with Okra)
  • Retrieve your Okra credentials:
  • Client Token
  • API key
  • Add the code below to your root build.gradle file at the end of the repositories:
allprojects {
  repositories {
   ...
   maven { url '<https://jitpack.io>' }
  }
}
  • Add the code below to dependencies:
dependencies {
  implementation 'ng.okra.com:okra:1.0.0'
 }

Let’s Get Started 🎉

Now that we have installed the right dependencies, it’s time to integrate the Okra widget into your app. Please note that we're using a demo app for this guide. You can choose to have this implementation anywhere in your app, depending on your business logic.

There are two ways to build your widget - BuildWithShortUrl or BuildWithOptions.

BuildWithShortUrl

This method takes away the burden of customizing your widget in your text editor; instead, it allows you to leverage the Okra dashboard to customize the appearance and features of your widget. After customization, it presents a short URL, which is a vital link for the widget.

This method saves time, and it's a no-code option.

Depending on your logic, you can set up the function registerForActivityResult in your controller or view the model class with the necessary options and call it when needed, which would be most likely when your user triggers a call to action of your choice, in this case, the Raised Button.

BuildWithOptions

This method gives you the freedom to code by hand the necessary parameters required to kickstart the SDK.

Using BuildWithOptions lets you customize the appearance, features and be creative. Hence, it's the best choice for a developer who wants to change their widget's look and feel frequently.

Depending on your logic, you can setup the function registerForActivityResult in your controller or view model class with the necessary options and call it when needed, which would be most likely when your user triggers a call to action of your choice, in this case, the Raised Button.

Conclusion

I hope this guide helped you implement Okra in an Android project. We'd love to know how your integration with our SDKs is going, so feel free to buzz us on Slack.

Check out this repo for the entire project, and don't forget to star it.

Read our documentation to explore all of Okra's wonderful services. Or, if you want to try it out for yourself, sign up for a free account to start building with the Okra today.

If you are passionate about open finance, you can also visit our website to see all the services that might be appealing to you.

Contact sales or send an email to sales@okra.ng to get started!