bitcoin - Mobiloitte Blog

How to Implement Bitcoin Payment Gateway in Your Android Application?

A lot of dust has been blown around the Bitcoin phenomenon. Over dozens of our clients are asking us how can they integrate Bitcoin payment gateway inside their Android app and they benefits they could harness from this step. This post will be for everyone who wants to know how to implement Bitcoin payment module inside your your mobile app and earn from it, especially if it is a free app. Before we go to the technical part, let’s just remind each other what all ways can you use to make money out of your app:

  • Premium version with extra features
  • Mobile ads
  • In-app purchase
  • Donate button via Paypal

There are many countries for which 3 out these 4 ways are not available and the only option that remains is to set up mobile advertising via their app – a nice option in case you don’t have anything against renting part of your app for mobile ads. From user experience point of view, ads are not usually a good option, but you can still reduce the blow through right ads and right targeting in order to give value to the user of your app.

Why would you decide to implement Bitcoin payment gateway for your Android app?

  • It is voluntary
  • Zero ads
  • No extra programming
  • It makes a mimic of the popular Bиy me a Beer via Paypal, which works great across the world
  • It is new trendy and still in early adopting

In order to make your app accept Bitcoins, you ought to do 2 things:

  • Install Bitcoins wallet (zero coding)
  • Setup a button inside your app (includes bit of coding)

Step 1 – The installation and the setup of the Bitcoin wallet is as easy as installing any other app from the marketplace – download and install.

Your Bitcoins wallet includes Bitcoin account where you get the crypto funds and from where you can also make payments later on if your balance is positive.

Step 2.  The only thing remaining is to implement the Bitcoin button inside your Android app. Make sure that you first talk to your designer about the most appropriate place to put it (or consult us), and then use the following method to call the function:


private void donateViaBitcoin() {

String bitcoinSchema = "bitcoin:";
String bitcoinReceiveAddress = "19JddkKowamVFs3LbpnUcJNyyPp7TL6gWe"; //your address from wallet
String bitcoinAmount = "?amount=0.00129548"; //Amount in BTC, 1$
String bitcoinURI = bitcoinSchema + bitcoinReceiveAddress + bitcoinAmount;
Intent bitcoinIntent = new Intent(Intent.ACTION_VIEW);
bitcoinIntent.setData(Uri.parse(bitcoinURI));
try {
startActivity(bitcoinIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(getApplicationContext(), "You don't have any Bitcoin Wallet installed.", Toast.LENGTH_SHORT).show();
}

Note – Make sure you read the app’s safety guidelines before you proceed with the code installation. Just in case

We are done. Now your Android app accepts Bitcoins from all across the world. Shoot us a comment in case you have already implemented Bitcoins in your app and let us know how it went

Best,

Mobiloitte

OUTSOURCING EBOOK