Category Archives: ANDROID

Roman numeral format to decimal.

By | June 22, 2023

Given a number in Roman numeral format, convert it to decimal. The values of Roman numerals are as follows: { ‘M’: 1000, ‘D’: 500, ‘C’: 100, ‘L’: 50, ‘X’: 10, ‘V’: 5, ‘I’: 1 } In addition, note that the Roman numeral system uses subtractive notation for numbers such as IV and XL. For the… Read More »

Problem Solving – IP addresses must follow the format A.B.C.D, where A, B, C, and D are numbers between 0 and 255.

By | June 19, 2023

Given a string of digits, generate all possible valid IP address combinations. IP addresses must follow the format A.B.C.D, where A, B, C, and D are numbers between 0 and 255. Zero-prefixed numbers, such as 01 and 065, are not allowed, except for 0 itself. For example, given “2542540123”, you should return [‘254.25.40.123’, ‘254.254.0.123’]. To… Read More »

MVVM in Android – ViewModels, ViewModelScope, Retrofit all with a Simple Example.

By | June 6, 2021

Let’s learn how to implement MVVM in Android. It’s actually really simple. ViewModel is just another class that that implements the main Business Logic. ViewModel is a middle man between your view and your Data class(Repo/any Data Provider). It can be represented simply like this. Here the View just displays the data. ViewModel doesn’t know… Read More »

Theming your App in Flutter using BLoc, Save & Reload

By | December 6, 2020

In this article, we will see how we can use BLoc to Theme your app in Flutter. To understand BLoC with a real world example, you can refer to my previous post on BLoC here. Part 1 Part 1 For this demo also we will need the below plugins If you follow my previous tutorial,… Read More »

How to use YouTube APIs and Play YouTube videos in Flutter.

By | August 27, 2020

In this article we are gonna talk about how to use YouTube API’s and play YouTube videos in Flutter. Watch Video Tutorial Add Dependencies Open pubspec.yaml file in your Flutter project and add below dependencies Now, Let’s create two screens Home Screen Video Player Screen In the HomeScreen we will show the list of videos.… Read More »

Bottom Navigation in Flutter

By | April 18, 2019

This article shows how to implement Bottom navigation using Tabs in Flutter.     Watch Video Tutorial     For that we need to have a TabController and a TabBarView Widget.   Create Tabs   This is our demo tab layout widget. Create a new file name FirstTab.dart and copy the contents into it. You… Read More »

Flutter – Android, iOS , Native communication Simple Demo

By | December 25, 2018

Hello Devs, You know flutter is now a hot topic. Learning flutter will always help in your future career. In this article we will see how we can communicate between Flutter and Android. Watch Video Tutorial MethodChannel Flutter communicate with Native using “MethodChannel“. So you have to create a method channel with a constant as… Read More »

Is Javascript Multithreaded? How it handles asynchronous actions?

By | December 13, 2018

Javascript is a single threaded application. That means you cannot run more than one script at one time to modify DOM or something. But there are something called “Worker Threads” that spans separate threads outside your application that can do complex tasks which is linked by a Callback method. What is a Web Worker? When… Read More »

What is Context in Android and What is the proper way to use it?

By | December 12, 2018

Lets see what a Context is… Context : Current State of the application. Context : Handle of the application. Context : Provides access to the resources, preferences, accessing database etc. Activity inherits from the Context. Context is the most important part of the Android application and its everywhere. If you wrongly use Context, it can… Read More »

Using Content Resolver to List Contacts – Android

By | October 30, 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 29, 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 24, 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 12, 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 | July 11, 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 | July 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 31, 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 | August 7, 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 »