Blog

Let's Get The Job Done!

How to Unit Test live Data?

In this article we are going to discuss how we could unit test the Live Data object from googles architectural components. If you have tried to test live Data Object on Android platform you have certainly encountered the error below. java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked. See http://g.co/androidstudio/not-mocked for details. at android.os.Looper.getMainLooper(Looper.java) at android.arch.core.executor.DefaultTaskExecutor.isMainThread(DefaultTaskExecutor.java:58)…
Read more

Rx Android

Implement search using Rx.Android

In this article we are gonna learn how to implement a handy search tool using RxAndroid. So let’s take a look into the UI code: private val searchSubject = PublishSubject.create<String>() private fun initUi() { svMain.setOnClickListener { svMain.isIconified = !svMain.isIconified } svMain.setOnQueryTextListener(object : SearchView.OnQueryTextListener{ override fun onQueryTextSubmit(query: String?): Boolean { Utils.hideKeyboard(context!! , svMain) return true }…
Read more

How to create android custom dialog

Here we’re gonna discuss how to create a usable custom dialog for every day android work . Using dialogs for showing some messages or asking user what to do in some situations is a common and necessary feature in android development , so maybe you are tired of simple and ordinary standard dialogs and want…
Read more

Why to choose MVVM over MVP

Here we’re gonna talk a littile about Sofware Architecture Patterns and  discuss the advantages of MVVM architecture pattern over MVP in the Android app development . First off why we use such solutions , that some times make it harder and more verbose to write code !? so there were always problems in development like…
Read more

Kotlin : some cool features

Let’s take a look at some of kotlin‘s cool features here , gathered from multiple sources across web , i personally hope that kotlin replaces java in android totally. Extension function: As it’s name indicate this adds some extra functionality to the existing component. Have a look below we are adding an extra functionality to…
Read more

Android Studio Shortcuts

Some of the useful android studio shortcuts are : CTRL +  /  : comment/uncomment lines of codes. CTRL + .  : folds/unfolds the code blocks . CTRL+ R : replace. CTRL + SHIFT + R: Replace  in all Files . CTRL + SHIFT + A : search IDE commands. CTRL + F : searching a…
Read more

Android OpenCV : how to pass Mat objects between java & c++

Hello friends , in this article i’m gonna discuss a trick that could save a lot of time and energy and also give OpenCV fans so much flexibility working on the android platform. As you may encounter some of OpenCV parts are not ported into java for example the one that i had encountered is…
Read more

Android Studio Live Templates , Just What You Want!

In this post i’m gonna talk a little bit about android studio/Intellij Trick That makes you faster in every day programming and makes your IDE’s environment more friendly . that is Android Studio Live Templates . maybe you’ve used some of android studios convenient phrases to type down frequently used methods like : logd :…
Read more

How to apply sepia effect on a bitmap

  In this post i’m gonna show you how to apply sepia effect on your bitmap with just a simple method .     Let’s dive into the code : public static Bitmap applySepiaEffect( Bitmap src , int depth , double red , double green , double blue ){ int width = src.getWidth(); int height…
Read more

Some Useful Android Libraries & Tools

Let me show you some android useful lib’s that i found useful to throw in projects. Let’s Name Some Famous One’s First : RxAndroid , Retrofit , OkHttp ,  Picasso ,  Glide , EventBus , Mushi , Timber (Debugging Utility) , Room (ORM) , Dagger (Dependency Injection)  , ButterKnife . But Now I’m Gonna Introduce…
Read more