Monthly Archives: February 2018

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

By | February 25, 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 | February 15, 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 | February 5, 2018

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 »