Load data from internet to a GridView in Flutter with Retry Logic, JSON parsing and Error handling in Flutter

By | December 15, 2018

I am assuming that you already have some understanding about Flutter. If you have no information about Flutter SDK, then I could recommend first going to flutter.io and get the initial knowledge. Our Final app will look like this. App will implement GridView JSON Implementation Error Handling Retry Implementation At first we will create the cell for the… Read More »

James

Is Javascript Multithreaded? How it handles asynchronous actions?

By | December 14, 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 executing scripts in… Read More »

James

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

By | December 7, 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 lead to memory… Read More »

James

Using WKWebkit in iOS – Simple Example

By | December 2, 2018

Whenever you want to show a webpage in your iOS App, use WKWebview instead of UIWebview. You have to supply an url that is complete. ie. with “http” or “https”. If you are using “http”, make sure you enable the “App Transport Security Settings” and add “Allow Arbitrary Loads” to yes.     Our Final output will look… Read More »

James

How to use Theme in a Flutter App?

By | November 14, 2018

In this article, I will tell you a simple way to theme a flutter app. Here is a simple code that illustrates that. We use the theme property of each widget to theme it. For example, to theme the whole application, we would do something like this. Take a look at the theme property of the MaterialApp. You… Read More »

James

Prompt users to rate your app in iOS with StoreKit.

By | November 13, 2018

Apple has introduced a new API to allow developers to prompt users with rate their apps directly from the app. Old way In the old way, we used to redirect users to the Appstore with the app’s link to rate the app. This makes users to navigate out of the app. This was not an efficient way to… Read More »

James

How to configure Firebase Google-Services.json for different targets in iOS?

By | November 3, 2018

Once you have different Google-Services.json for different targets for your firebase applications, you may be wondering how all can have same filenames and configure for different targets. However the solution is simple. Initial Steps * Create new directory for each directory inside for project folder. Make sure the folder name is different from the target name (you can… Read More »

James

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 class for the… Read More »

James

Hide Navigation – Android Tip – 1

By | October 29, 2018

We are starting simple posts for tips in Android so that you can master android very fast in a very simple manner. Here is a simple android tip. Hide Software Navigation in Android

James

RNFirebase core module was not found natively on ios – Fix

By | October 28, 2018

This issue happens in react-native-firebase for a various reasons. First thing you have to do is check Firebase/Core is in your pods. Try Cleaning and rebuilding your project. Click on the target you are running in xcode and check the frameworks section in ‘General’ Tab -> Check you have linked libFirebase.a there. If not click the “+” button… Read More »

James

Interview Question & Answers – Migratory Birds Count – 11

By | October 23, 2018

Question You have been asked to help study the population of birds migrating across the continent. Each type of bird you are interested in will be identified by an integer value. Each time a particular kind of bird is spotted, its id number will be added to your array of sightings. You would like to be able to… Read More »

James

Interview Question & Answer – 10 – Divisible Sum pairs

By | October 22, 2018

Question Find the count where the number k is divisible by sum of two numbers in the array and first number index should be less than second number index. Function has the following parameter(s): n: the integer length of array ar: an array of integers k: the integer to divide the pair sum by You can download the… Read More »

James

Interview Question – 9

By | October 15, 2018

Question Maria plays college basketball and wants to go pro. Each season she maintains a record of her play. She tabulates the number of times she breaks her season record for most points and least points in a game. Points scored in the first game establish her record for the season, and she begins counting from there. For… Read More »

James

Doing Simple Navigation in Flutter – Simple Example

By | October 12, 2018

Navigation is done is Flutter using the Navigator class. Lets look at a simple example The first thing you have to register routes for difference screen is to build a Map of ‘String’ (route) and the page (Widget).   Lets say I have a utility class for the Creating Routes named routes.dart. The contents of route.dart contains the… Read More »

James

GridView Demo in Flutter

By | October 10, 2018

Hi Friends, Today we will see how to implement GridView in Flutter.     We are going to use this service for the data First we will create a Model for the Grid Cell No we will create view for Grid Cell Create a file named “cell.dart” and copy this into it. Service Class We have the below… Read More »

James

Interview Question & Answer – 9

By | October 10, 2018

Question Given a time in -hour AM/PM format, convert it to military (24-hour) time. Note: Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock. Noon is 12:00:00PM on a 12-hour clock, and 12:00:00 on a 24-hour clock. Sample Input 07:05:45PM Sample Output 19:05:45 Solution

James

Interview Question & Answer – 8

By | October 8, 2018

Question You are in charge of the cake for your niece’s birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out.… Read More »

James

Doing HTTP Calls in Flutter and Parsing Data

By | October 7, 2018

Here is a simple example of doing Http calls in Flutter. In this example we will try to fetch some JSON value from the below url https://jsonplaceholder.typicode.com/posts/1 You can read more from here. Add Dependencies First you need to add the http plugin in dependencies. The latest version of http can be found here (https://pub.dartlang.org/packages/http). Example Lets look… Read More »

James

Flutter – Saving Data in Local using Shared Preferences

By | October 4, 2018

This simple example demonstrates saving an integer value in the local shared preferences. We will use a flutter plugin called shared_preferences for this. You can read more about the plugin from here. Add Dependency First thing is to add the package to the dependencies. Go to pubspec.yaml and add the package. Example

James

Interview Question & Answer – 6

By | October 4, 2018

Question Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix is shown below: 1 2 3 4 5 6 9 8 9 Ans : | (1+5+9) – (3+5+9) | = 2. Solution

James