Gaps between layout components in Android

There is a very simple solution in Android if you want to have space between components. You can always set margins but you can also use the Space class. You can use it like this: <Space android:layout_width="1dp" android:layout_height="30dp"/>

May 4, 2020 · 1 min · gmirchev90

Retrofit – Authorization &amp; Expiring Tokens

Situation is like this: You got an AccessToken and RefreshToken (AT and RT for now on) Every API call needs to contain the AT When the AT expires you need to refresh it using your RT

May 4, 2020 · 2 min · gmirchev90

How to download older version of Google Play Services?

In the new version of the Google Play Services library there is a lot of new code for the material design which really made my app huge and it crossed the border of 65 536 methods.

May 4, 2020 · 2 min · gmirchev90

Exporting Card.IO as a fragment

You probably know the famous card detection library called card.io. It is developed by PayPal and used worldwide. There is a lot of OpenCV usage behind it, but I will leave this for another article. The problem The problem is that the library can only be used as a separate module. You can call the card.io Activity and it will return you the results from the detection. But what if you want to embed the detection view inside your app? Well, sadly, there is no fragment for that. But the library is open-source so you can change everything to fit your needs. So let’s start then!

May 4, 2020 · 5 min · gmirchev90

Spinner in Toolbar – How to change the selected item text color?

That bastard drove me nuts today. I do not understand why is it so hard to fix. I want the text to be white. After 2 hours of reading useless posts, I found a solution working for me.

May 4, 2020 · 1 min · gmirchev90

Implementing Face Detection in Android

Recently, I got a task to implement face detection for a camera preview we have within our mobile app. So if the app detects a face, a button should be displayed, otherwise – the button should remain hidden. There are several ways to implement face detection in Android

May 4, 2020 · 2 min · gmirchev90

Android Flux Architecture Example

I found Flux architecture for several months and I have written a couple apps with React & Flux and as an Android programmer also I think that it has to have an implementation. So I decided to do it. You can check it HERE. I really believe that Flux for Android will be a “groundbreaker” (may be not my try but the whole concept :)).

May 4, 2020 · 3 min · gmirchev90

How to get ScrollView height (getHeight() = 0) and how to display an arrow that it is scrollable?

Lets say that we have a ScrollView which should ahave an arrow at its bottom. That arrow is visible only when the ScrollView is scrollable (That means it has more content than it can display). In android the scrollview does not have a method isScrollable() and I am still wondering what is the reason. May be too complex realization.

May 4, 2020 · 1 min · gmirchev90

Android prevent a dialog from closing when a button is clicked

My problem was that when a user clicks the Sign Up for example button I wanted to validate a field if it contains a valid email and after that dismiss or keep the dialog showing.

May 4, 2020 · 1 min · gmirchev90

Sample architecture to handle notifications in Android

The use case I am working in a company here in Bulgaria where we are building a huge android app with over 250 screens. It was time to integrate Firebase push notifications in it. Here were the requirements for them:

May 4, 2020 · 7 min · gmirchev90