Skip to main content
Flutterwave’s Android SDK can be used to integrate the Flutterwave payment gateway into your android app. It comes with a ready-made Drop In UI and non-UI module, depending on your preference. The payment methods currently supported are Cards, USSD, Mpesa, GH Mobile Money, UG Mobile Money, ZM Mobile Money, Rwanda Mobile Money, Franc Mobile Money, US ACH, UK Bank, SA Bank, Nigeria Bank Account, Nigeria Bank Transfer, Barter Mobile Wallet. Screenshot of Drop-In

Before you begin

Requirements

  • The minimum supported SDK version is 15
  • Rave android sdk 1.0.50 and above only supports projects that have been migrated to androidx. For more information, read Google’s migration guide.

Adding it to your project

Step 1. Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency If you want to use the default Drop In UI, add the rave-android module dependency
if you are not interested in our default UI and you want to use yours and only want to interact with our core sdk, use the rave_presentation module
Step 3. Add the INTERNET permission to your android manifest
The steps below show how to use the Flutterwave Android SDK as a Drop-in UI (all the views for the payment process are handled by the SDK). If you would like to use your own custom UI instead, please see the continuation here.

Usage

For using the default UI

1. Create a RaveUiManager instance

Set the public key, encryption key and other required parameters. The RaveUiManager accepts a mandatory instance of the calling Activity (or a Fragment that has a parent activity).

Function Definitions

Note: The order in which you call the methods for accepting different payment types is the order in which they will show in the UI.
To see a more practical way of using the sdk, head to our sample app in the repository here

2. Handle the response

In the calling activity, override the onActivityResult method to receive the payment response as shown below
The intent’s message object contains the raw JSON response from the Rave API. This can be parsed to retrieve any additional payment information needed. Typical success response can be found here and failed response here.
PLEASE NOTE We advise you to do a further verification of transaction’s details on your server to be sure everything checks out before providing service or goods.

3. Customize the look

You can apply a new look by changing the color of certain parts of the UI to highlight your brand colors. First specify the theme in your styles.xml file. In this theme, you can edit the style for each of the elements you’d like to style, like the pay button, OTP button, etc.
Then in your RavePayManager setup, add .withTheme(<Reference to your style>) anywhere before calling the initialize() function. e.g.
There is a limit to which the drop-in UI can be customized. For further customization, see our Custom UI implemetation guide here.

Configuring Proguard

To configure Proguard, add the following lines to your proguard configuration file. These will keep files related to this sdk

Help