Category Archives: ANDROID

Using Content Resolver to List Contacts – Android

By | October 31, 2018

Here is a simple example to list contacts in android using the Content Resolver. Note : You need to have two things before accessing contacts. 1. Contacts Permission in the Android Manifest 2. Ask Runtime permission from the user Code Here is our MainActivity that lists the contacts. MainActivity.java Adapter Class Below is the adapter… Read More »

Simple Interview Question and Answer – 1

By | September 28, 2018

Question John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. For example, there are socks with colors . There is one… Read More »

Project Treble – Android Version Fragmentation Solved

By | August 18, 2018

Solved Yes, a longtime problem with Android has been solved. Yes, version fragmentation problem. Version fragmentation is often Android from different manufacturers had been stuck on different versions which makes it difficult for developers to support all variety of devices. Hopefully the problem is going to be solved. From Google’s perspective, an OS rollout is… Read More »

How to listen to events from react native?

By | August 14, 2018

Hi friends, This is essentially a continuation of this post http://www.coderzheaven.com/2018/08/10/how-to-create-a-custom-native-imageview-in-android-for-reactnative/ Now we will listen to a click event from the image we just created. For that we have to add the ClickListener to the image in Android. Add below methods to the java class On the React Native Side The whole java class will… Read More »

How to create a custom native ImageView/View in Android or iOS for ReactNative?

By | August 10, 2018

Many times we need custom components from native. Here is a simple example on how to create a custom imageview in Android for react native. First we will start with the Android Version Android Create a class that extends SimpleViewManager. Write a setSrc method which accepts the source url from React Native. Implement ‘createViewInstance’ method… Read More »

Awesome React Native Image Caching Libraries

By | August 4, 2018

Image Loading and caching had been a little bit pain in react native. In-fact react native didn’t had native support for caching. But after the recent release, there is now support for caching in iOS only. Still not for Android. You can read more about this from here https://facebook.github.io/react-native/docs/images.html#cache-control-ios-only Now these are the variety of… Read More »

Top 10 most downloaded and used mobile apps

By | July 23, 2018

Studies show that we spend more time with our mobile devices every day, either working or enjoying our leisure time. And we use apps in these devices . But what are the ones that we use the most? Sensor Tower is a company dedicated to the marketing of mobile applications, which periodically publishes a report… Read More »

Free Daily News App

By | July 18, 2018

Download our free news app and get instant news from popular news channels instantly. Get the app from here… https://play.google.com/store/apps/details?id=app.mobile.daily_news          Please download and leave your valuable feedback as well. Why you will download this app? Fast and efficient. Incorporates news from all famous news channels. Consumes minimal battery. No intruding ads… Read More »

How Image Loading Libraries work in Android?

By | July 14, 2018

In this article, Lets find out how the image loading libraries like Picasso, Glide and Fresco works. We know that images are the one which takes most of the space in our application either in App size or the memory at runtime. Also using large number of images often kicks off Garbage Collection (GC) Events.… Read More »

How to encrypt and decrypt an audio file in Android?

By | May 8, 2018

Here is a simple example to encrypt and decrypt a audio file in Android. We will directly go to the implementation part. Demo Video You can check the demo video here. Download Library You can download the simple library from here. Aim Download an audio file from internet. Encrypt and save the encrypted file in… Read More »

Android’s new D8 dexer

By | April 30, 2018

Google has now come up with a new compiler for Android, the D8. This one is basically improved and efficient compared to the DX compiler. Google had shipped the D8 compiler along with Android Studio 3.0 with a opt-in feature. In the initial phase the default compiler would be DX, then Google will deprecate it… Read More »

What are promises in React Native, How is it different from Callbacks?

By | April 23, 2018

Basically saying both are same. But there are some differences. Lets see what are some of the advantages of Promises. Promises are just a cleaner way for running asynchronous callbacks. Promises also has error catching mechanism which are not in callbacks. Promises are an abstraction for cleaner and better functional code. What are callbacks? Callback… Read More »

React Native Module Bridge Example

By | April 15, 2018

The document demonstrates the steps to create react native module bridge in Android and iOS. Below are the steps for creating a native bridge in Android. ANDROID Open the Android Studio with the corresponding project from your react native project. Step 1 : Create the Java class that extends ReactPackage. (eg: AndroidModulePackage.java). Implement the interface… Read More »

Room Database from Google – A Simple Example

By | April 5, 2018

Lets talk about the Room Persistent Library from Google. The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite. The library helps you create a cache of your app’s data on a device that’s running your app. This cache, which serves as your… Read More »

Implementing GCM in Android

By | March 30, 2018

Hi Friends, In this article I will be talking about how you can implement GCM in Android using FirebaseMessaging Service. Below are the steps you need to follow… Create Project in Android Studio Create a new project in Android Studio. The package name we use here will be used in the Firebase Console. Create Project… Read More »

Working with SMS in Android, Read Messages from Inbox and Get Notified on new Incoming messages

By | March 20, 2018

Permissions Add these two permissions in the Android Manifest Read SMS from Inbox Reading SMS from inbox is not a big task, but your user needs to allow it if you app is running on Marhmallow or more. if you app is below marshmallow, then you wont need it. But here we will write one… Read More »

What is ButterKnife?

By | March 15, 2018

What is ButterKnife? Its a kind of view injection in Activities or Fragments using Annotations. Butterknife can be used to 1. Bind Views 2. Bind Clicks 3. Can be used with resources like strings, colors, Dimens, Drawables etc. Below are the annotations available AnnotationDescription @BindView Binds view object. TextView, Button, Spinner or any view object… Read More »