How to show a Snackbar in Flutter? iOS and Android.

By | May 15, 2018

Here is a simple example where the user clicks a button to show a Snackbar. We know that there is no inbuilt snackbar for iOS. But Flutter makes it easy to do without any custom native code. You can see a Demo video here. Here we use two main elements Scaffold Snackbar The Scaffold Widget… 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 »

AutoConnect to Wi-Fi in iOS

By | April 30, 2018

Apple has introduced a new API in iOS 11 where you can directly connect to a Wi-Fi from with-in the app. For this code to work 1. you need to enable the networking capabilities in your provisioning profile. 2. Once you enable the networking profile in the provisioning profile, you need to regenerate and sign… Read More »

Android’s new D8 dexer

By | May 9, 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 | May 9, 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 | July 12, 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 | August 6, 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 | April 2, 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 | April 2, 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 | January 13, 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 »

Quick Git Command you can use in your project

By | January 8, 2018

Here are some git commands that you will normally use in a git version controlled project repository. Commit For Commiting all modified files use git commit -am”Message” Status For checking the status of the git repository use git status Log For getting the information about the Git checkins use… git log To Print in a… Read More »

Why you should use StringBuilder instead of StringBuffer in Android for better performance?

By | January 1, 2018

StringBuffer StringBuffer is mutable means one can change the value of the object . The object created through StringBuffer is stored in the heap. StringBuffer has the same methods as the StringBuilder , but each method in StringBuffer is synchronized that is StringBuffer is thread safe.Due to this it does not allow two threads to… Read More »

Using Otto Event Bus to Communicate b/w Activity and Fragment.

By | January 1, 2018

Using Otto Event Bus to Communicate b/w Activity and Fragment. Otto Event Bus is an Android Library that helps developers to communicate between Android Activity and Fragment and vice-versa. Lets see a simple implementation of this. Here I will pass a simple string from Activity to Fragment and Vice-versa. Gradle Layout Activity layout Fragment Layout… Read More »

Implementing Downloadable fonts in Android – Kotlin.

By | December 29, 2017

Here is a simple example in which we will download a font from google and set it to our textview. View the Demo here Layout Here is our layout. The Edittext is a autocomplete textview where we will load the font names to download. The font names are stored in values.xml Lets see the layout.… Read More »

How to BackUp user’s data programatically in Android?

By | December 29, 2017

Android’s Backup service allows you to persist the data in a Google cloud storage. Android does this with the help of a BackUpAgent in the SDK. If we want to backup the data, then extend the BackupAgent. Lets see how we can do this. Benefits Reduce user frustration Increase login-rate. Reduce support calls Minimize user… Read More »

Simple Job Scheduler Demo in Android

By | January 10, 2018

Android helps us to schedule jobs in an efficient way. Android has a built in Job scheduler for this. Lets see how this is done. Before that lets see what google has to say about Job Scheduling. These are the normal tasks an application does : Updating network resources. Downloading information. Updating background tasks. Scheduling… Read More »

Special characters that can be included in a Swift String ?

By | December 27, 2017

Special characters can be included in string literals using the following escape sequences: The following example shows how to use a few string literals: Swift 4 Escape sequence Meaning \0 Null Character \\ \character \b Backspace \f Form feed \n Newline \r Carriage return \t Horizontal tab \v Vertical tab \’ Single Quote \” Double… Read More »

Store a Class object in Android Preferences or Store Non-Primitive types in Android Shared Preferences

By | January 1, 2018

We all know that Android only allows primitives types like int, float to be stored in preferences. But we can change this with the help of GSON. If you want to know more about GSON, you can refer my post here… Using GSON in Android – Simple Demo Now, In this demo, I will show… Read More »

How to Count characters in a String in Swift 4?

By | October 27, 2017

To retrieve a count of the characters in a string, call the global countElements function and pass in a string as the function’s sole parameter: prints “sampleString has 32 characters” Note : Different Unicode characters and different representations of the same Unicode character can require different amounts of memory to store. Because of this, characters… Read More »

How Type Safety is implemeted in Swift 4?

By | December 12, 2017

Swift 4 is a type-safe language which means if a part of your code expects a String, you can’t pass it an Int by mistake. As Swift 4 is type-safe, it performs type-checks when compiling your code and flags any mismatched types as errors. Playground execution failed: error: :6:6: error: cannot assign to ‘let’ value… Read More »