A complete guide to in-app purchase integration

Image for post
Image for post

Introduction

Google Play in-app purchases are the simplest solution to selling digital products or content on Android apps. So many app developers who want to sell digital goods or offer premium membership to users can simply use the Google Play in-app billing process for smooth and easy checkouts.

In this article, we’ll check the end-to-end process of implementing in-app purchases on an Android app as well as creating in-app billing products on the Google Play console.

If you want to dive into the code directly, here’s the repo:

Let’s get started!

An Overview of Google Play’s Billing System

Before directly jumping into the code, let’s get a basic idea of the billing system. One of the important things to know is what kind of products we can sell to users. Google Play’s billing system helps us sell the following types of digital…


Creating custom UI elements for ExoPlayer

Image for post
Image for post

If you haven’t checked out my first part on ExoPlayer like What is ExoPlayer, Why do we need it and ExoPlayer basic integration please checkout Android ExoPlayer: Play Videos in Your App Like YouTube for better understanding while further reading. Else if you have a basic idea regarding ExoPlayer you can skip that and proceed.

Introduction

ExoPlayer is the video player running in the Android YouTube app, Netflix, Hotstar, Amazon Prime, etc. For the reasons like it is an open-source project which is maintained by Google that has its perks and it’s totally free most player apps in Android use this ExoPlayer. Also, the other reason is that customizing the default MediaPlayer is very difficult to manage and doesn’t support many formats for flexible use. In my previous article, we discussed the importance and basic usage of ExoPlayer. In this post, we will focus on how to customize the UI of an ExoPlayer as per our requirement. …


A beginner’s guide to ExoPlayer integration in Android

Image for post
Image for post

The Importance of Video Apps

There’s a constant need for video-playing apps for entertainment, educational, and many other purposes. You can see it clearly if we look at Youtube usage over the past five to ten years. Even in most remote areas of the globe, mobile entertainment increased a lot. Even illiterate people in remote villages are using video apps for entertainment purposes. On the other hand, thanks to the pandemic caused by COVID-19, most schools across the world are turning to E-Learning. For these reasons, there’s a lot that can be done by one good application, built to serve the hunger of the current world. …


Protect your APK from code theft with minimal configuration

Image for post
Image for post
Image source: Author

Introduction

In the current world, security has become important to almost every aspect of our life. The same applies to the code that we write for our apps. Any APK file in the PlayStore can be deobfuscated. Here we are talking about reverse engineering of the APK file. What we do during our development is that we put our efforts into converting our ideas into code and then package them to an APK file to deploy.

But what hackers do is simply pick our APK file, download it from any third-party site, and deobfuscate the APK file to generate the source code files or resources that we developed. It’s generally not a good idea to go live without securing your codebase. …


Writing blocking and non-blocking code with coroutines

Image for post
Image for post
Photo by the author.

One of the interesting features of Kotlin is coroutines. In Android development, the management of threads has always been a little bit challenging because there are limitations on dealing with things related to UI or the main thread. And it's been common practice to use UI or main thread for UI-related operations and background threads for blocking operations like network calls, database operations, heavy computation tasks, etc.

If the thread management is not done properly it has a huge impact on the app’s performance, resulting in ANRs, UI freezing, crashes, etc. …


The best way to learn Android for beginners, an overview of the basics of Android Development

Image for post
Image for post

Introduction

Android is a platform where apps are built and deployed. The process of building apps is a typical way of learning and experimenting with different things. In Android development there also the flexibility of choosing languages like Java or Kotlin for development. It’s not so complicated to begin and do some basic stuff but for mastering anything takes much time so be patient. Things will be simple in the first phase once you dig a little you understand the depth.

Why learn Android

One important thing about learning Android is you can explore the entire SDLC(Software Development lifecycle) on your own. Let’s take a simple example of creating a simple app of displaying a list of customized smileys with share feature. For this simple thing, you can define the scope of your application, sit and analyze the requirements with ease, develop it, and deploy it to the Play Store with minimal cost of 25USD as a lifetime fee. Later you have many free tools like firebase Analytics and Crashlytics where you can track your users and do the changes for better user engagement. These things if you are proficient in Android can be done in one day nothing much so rush in and crush it. …


Coroutines for asynchronous programming

Image for post
Image for post

Introduction

In most of the programming languages, it’s quite a common thing of doing synchronous tasks like hitting an API and waiting for the result to process the next steps, waiting for fetching data from the database, etc.

We basically started handling this using the callback mechanism. We do something like hitting an API and wait for the callback to get invoked where we process the result.

A callback is a function that will be executed after another function has finished executing. And if there are a series of things to be done synchronously then we will fall into callback hell that can lead us to ambiguity in understanding the code. …


Explore about Google Firebase App Analytics to increase user engagement at zero cost

Image for post
Image for post

Introduction

Nowadays building and publish an app at play store is not a great task. Even children are doing that stuff. But there is always a difference between building a great user engagement product and building simply a product. From my personal experience, I have seen apps acquiring and losing users in a very short span of time. I have seen apps getting installs around 1 lakh per month with no penny spent and uninstalls around 80 to 90K. Isn’t a good performing app nope because these days getting traffic to apps is not a big deal maintaining a retentions user base is a great thing. …


Everything about Vector Assets in Android

Image for post
Image for post

Introduction

In the beginning, Android had fixed sizes of devices so it’s become a common practice of using assets in the form of bitmaps like PNG formats. But in the current era, Android devices are having different screen sizes and densities which is making the task of maintaining assets a bit complex. In this post, we will discuss the importance of usage of Vector Drawables, basic usage, and drawing simplified vectors.

Problem using PNG’s

The PNG format assets being used in Android applications have an intrinsic size and their quality is dependent on pixels. Each PNG asset which we use is specific to a certain density. That was the reason we provide different versions of the same image for different screen densities. …


How to make use of Android PdfRenderer

Image for post
Image for post
Photo by Vikas Pawar on Unsplash

Introduction

During development until unless we encounter a challenge or a problem most of us are not aware of many things in the system that we can benefit from. We are habituated in such a way that until unless a thing is needed we don’t explore the stuff available.

So it’s always a good habit to explore a few resources that make our work easier when the time comes and for this, we need to keep on exploring the things in the platform we choose. One such thing in Android is dealing with PDF documents. …

About

Satya Pavan Kantamani

Android Dev at Toppr. Interested in Traveling, App development. Based in Hyderabad, India. Catch me at https://about.me/satyapavankumar

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store