A simple Android app to demonstrate the use of Hover SDK for M-PESA Send Money while offline. This SDK does not require an internet connection, it automates USSD sessions in the background of an android application.

Related tags

App HoverSDKDemo
Overview

HoverSDKDemo

Hover SDK is an Android SDK that lets mobile developers to add money features to the applications. This SDK does not require an internet connection, it automates USSD sessions under the hood of an android application.

What is an Action

An Action depicts a path that one follows while using USSD codes. When you create an action, Hover uses it to navigate to the devices USSD menu.

Init Hover

Hover.initialize(this)

Run the USSD Session

binding.buttonSend.setOnClickListener {
            try {
                val intent = HoverParameters.Builder(this)
                    .request("14c45f2e")  //Action ID
                    .extra("phoneNumber", binding.editTextPhoneNumber.text.toString().trim())
                    .extra("amount", binding.editTextAmount.text.toString().trim())
                    .buildIntent()

                startActivityForResult(intent, 0)
            } catch (e: Exception) {
                Toast.makeText(this@MainActivity, "Hover Error", Toast.LENGTH_SHORT).show()
            }
        }

Listen for USSD Information

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        try {
            if (requestCode == 0 && resultCode == RESULT_OK) {

                Toast.makeText(
                    this,
                    "You will receive an MPESA Confirmation message shortly",
                    Toast.LENGTH_SHORT
                ).show()

            } else if (requestCode == 0 && resultCode == RESULT_CANCELED) {

                Toast.makeText(this, data?.getStringExtra("error"), Toast.LENGTH_SHORT).show()
                Log.d(TAG, "onActivityResult: ${data?.getStringExtra("error")}")
            }
        } catch (e: Exception) {
            Log.d(TAG, "onActivityResult: ${e.localizedMessage}")
        }
    }

Demo

20210831151243.mp4
You might also like...
A Simple movies app using Kotllin, MVVM, and with an offline caching capability.
A Simple movies app using Kotllin, MVVM, and with an offline caching capability.

IMDB-CLONE A simple imdb clone using KOTLIN,MVVM with searching and bookmarking ability with offline caching ability Libraries used:- Kotlin Coroutine

 🍲Foodium is a sample food blog Android application 📱 built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, Flow, Dagger 2/Hilt, Architecture Components, MVVM, Room, Retrofit, Moshi, Material Components). 📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.
📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.

NotyKT 🖊️ NotyKT is the complete Kotlin-stack note taking 🖊️ application 📱 built to demonstrate a use of Kotlin programming language in server-side

Android Application for a user’s favorite Movies, TV shows and Anime while keeping up to date with the latest releases.

Android Application for a user’s favorite Movies, TV shows and Anime while keeping up to date with the latest releases.

You can store all your password, bank details, card details in one place and remember only one master PIN. The application works totally offline.
You can store all your password, bank details, card details in one place and remember only one master PIN. The application works totally offline.

Keep Password An application where you can store all your password, bank details, card details in one place and remember only one master PIN. The appl

This is a Interview application which made by me in interview task what it do? that will give you the result from Api and also save data in the cache using RoomDb so that we can access it offline.
This is a Interview application which made by me in interview task what it do? that will give you the result from Api and also save data in the cache using RoomDb so that we can access it offline.

Clean-MVVM-App An Android application built using Clean + MVVM architecture. Components used in the app. Kotlin - As a programming language. Material

NetGuard provides simple and advanced ways to block access to the internet
NetGuard provides simple and advanced ways to block access to the internet

NetGuard NetGuard provides simple and advanced ways to block access to the internet - no root required. Applications and addresses can individually be

🛒A Minimal Expense E-Commerce App built to demonstrate the use of modern android architecture components [Navigation, Room, MotionLayout, etc..] with MVVM Architecture. ✔
🛒A Minimal Expense E-Commerce App built to demonstrate the use of modern android architecture components [Navigation, Room, MotionLayout, etc..] with MVVM Architecture. ✔

E-Store A Simple E-Commerce App 📱 built to demonstrate the use of modern android architecture component with MVVM Architecture 🏗 . Made with love ❤️

This project demonstrate the use of CameraX API for in-app face time.
This project demonstrate the use of CameraX API for in-app face time.

CameraApp This project demonstrate the use of CameraX API for in-app face time. You can click picture using main or front. I have also used yalantis.u

Owner
Joel Kanyi
Android Developer | Kotlin | Java
Joel Kanyi
ASJ-Quix - A quiz app developed for Android Study jams sessions

ASJ-Quix A quiz app developed for Android Study jams sessions

Vishnuxx 4 Jan 30, 2022
Money Manager Ex is a free, open-source, cross-platform, easy-to-use personal finance software

Money Manager Ex is a free, open-source, cross-platform, easy-to-use personal finance software. It primarily helps organize one's finances and keeps track of where, when and how the money goes.

Money Manager EX 1.2k Dec 31, 2022
All-money-converter-app - A currency converter App built a free Currency API Dependency injection

This a currency converter App built a free Currency API Dependency injection . T

Espérant GADA 0 Feb 3, 2022
Ivy Wallet is an Open Source money manager app for android that you can either build or download from Google Play.

Ivy Wallet is an Open Source money manager app for android that you can either build or download from Google Play.

null 727 Dec 26, 2022
Money Manager app that helps you to add your daily small incomes and expenses and track them easily.

Simple Money Manager This app is a simple money manager app which helps you to add your daily small incomes and expenses and track them easily. Screen

Yash Bansal 2 Nov 21, 2021
Shumba money weather app, using openweather api and retrofit

Shumba Money Weather App Language KOTLIN Libraries used 1.) Retrofit library - REST Client for Java and Android. It makes it relatively easy to retrie

Glen Chiridza 1 Nov 21, 2021
An easy to use android library to let devs know how much internet-data their app is consuming

EasyAnalytics! an easy to use android library to let developers know how much internet-data their app is consuming. We can identify this as we want ba

Sachin Rajput 13 Feb 21, 2022
DNS over HTTPS / DNS over Tor / DNSCrypt client, firewall, and connection tracker for Android.

RethinkDNS + Firewall for Android An OpenSnitch-inspired firewall and network monitor + a pi-hole-inspired DNS over HTTPS client with blocklists. In o

null 1.1k Jan 5, 2023
A Simple Expense Tracker App 📱 built to demonstrate the use of modern android architecture component with MVVM Architecture

Expenso ?? A Simple Expense Tracker App ?? built to demonstrate the use of modern android architecture component with MVVM Architecture ?? . Made with

Michel Horacio 1 Dec 28, 2022