Quantcast
Channel: CoderzHeaven
Browsing all 528 articles
Browse latest View live

Hex String to UIColor in iOS Swift

Dear Friends, In Today’s post I will show you how to convert a simple hex color string to UIColor in Swift 3. static func hexStringToUIColor (hex:String) -> UIColor { var cString:String =...

View Article


How Type Safety is implemeted in Swift 4?

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...

View Article


How to Count characters in a String in Swift 4?

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: let sampleString = "Koala, Snail, Penguin, Dromedary"...

View Article

Image may be NSFW.
Clik here to view.

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

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...

View Article

Special characters that can be included in a Swift String ?

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...

View Article


Path from URI returning Null when selecting from Photos or Gallery in Android...

For API above 19 @SuppressLint("NewApi") public static String getPathAPI19(Context context, Uri uri) { String filePath = ""; String fileId = DocumentsContract.getDocumentId(uri); // Split at colon, use...

View Article

Simple Job Scheduler Demo in Android

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...

View Article

How to BackUp user’s data programatically in Android?

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...

View Article


Image may be NSFW.
Clik here to view.

Implementing Downloadable fonts in Android – Kotlin.

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...

View Article


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

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...

View Article

Why you should use StringBuilder instead of StringBuffer in Android for...

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...

View Article

Quick Git Command you can use in your project

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...

View Article

How to Check if your app is in Foreground or Background?

Here is a simple way to check if your app in running in Foreground or Background private boolean isAppIsInBackground(Context context) { boolean isInBackground = true; ActivityManager am =...

View Article


How to call a click on a button Programatically?

The click on a button or View is usually called when the user clicks on it. But how can we call it programatically. Here is a simple example Button btnClick = findViewById(R.id.btnClick); LinearLayout...

View Article

What is ButterKnife?

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,...

View Article


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

Permissions Add these two permissions in the Android Manifest <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.READ_SMS"...

View Article

Implementing GCM in Android

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...

View Article


Room Database from Google – A Simple Example

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...

View Article

React Native Module Bridge Documentation

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...

View Article

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

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...

View Article
Browsing all 528 articles
Browse latest View live


Latest Images