How to use Single Instance Class / Singleton class in Android / Java ?

The single instance classes are mostly used when you don’t know how to create a object of this class from some distant class or instead of allocating memory for the class, just create object once and use it till entire life of the application. The Single Instance class, also called at Singleton class just creates … Read more

Replacing old android application in Google Play [ Possible Errors ]

I had a previous application in google play at which need to be updated, I faced following issues after developing new application, 1) The new app should have same package name as old app, so I had to change code to use package name as com.wAgriConnect in new application source. 2) You can’t download the … Read more

Compiling Android application as part of AOSP source code

This post details about how you can integrate your Android application as part of Android OpenSource Build system to get it compiled using command line. Normally Android applications are developed using Android Studio and it generates build.gradle to configure and compile the application, but when you want to get this same application compiled as part … Read more

Universal Android Music Player Example

This post shows how to implement an audio media app that works across multiple form factors and provide a consistent user experience on Android phones, tablets, Android Auto, Android Wear, Android TV, Google Cast devices, and with the Google Assistant. $ git clone $ cd uamp

Identify media encoder / decoder (codec) information of Android device

This post details, how you can obtain the media encoder and decoder ( codec) information of your android Android device. First we will show, how you can use media codec API’s to get this information. You just follow the steps from “Android demo application with button click event” to create the demo application and then … Read more

How to use Picture in Picture (PIP) mode in Android ?

What is Picture in Picture ( PIP ) mode in Android ? PIP is a special type of multi-window mode mostly used for video playback. It lets the user watch a video in a small window pinned to a corner of the screen while navigating between apps or browsing content on the main screen. In … Read more

Android demo application with button click event

Following source code describes a simple demo application which shows a button which when clicked prints a message in logcat. You can customise this application as per need to handle the button click event by implementing necessary code inside click handler. Below is the code for activity layout which uses just a single button which … Read more

How to fix – error: package R does not exist

When I was compiling one of our previously written android application, I got following error, error: package R does not exist This is because, in our app’s MainActivity we were using a code as below, Solution : The right solution to this error is to import the Resources’s class i.e. R as, For example, our … Read more