Why I use Kotlin for Android

Kotlin is a statically typed language developed by JetBrains that targets the JVM. If you have worked with Java before, you know how verbose it could be. When Apple released Swift, developers rejoiced for a better alternative to Objective C. Kotlin could be that alternative for Android developers working with…

Refresh OAuth access token with Retrofit, RxJava

A very common use case when working with OAuth is to refresh the auth token. One way could be to do it periodically. A much simpler way, although, is to try refresh the auth token when you see a 401 response for an authenticated user. This is very straightforward to…

Realm for Android

Realm is a mobile database: a replacement for SQLite & Core Data that works for both iOS and Android. It has a really concise API and works extremely fast. Let's see how we define a model in Realm: public class User extends RealmObject { @PrimaryKey private int identifier; private String firstName;…

How to Set Up Android App to Support Expansion Files

Google Play currently requires that your APK file be no more than 50MB. For most applications, this is plenty of space for all the application's code and assets. However, some apps need more space for high-fidelity graphics, media files, or other large assets. Previously, if your app exceeded 50MB, you…

Recycler View Item Click Listener

With the Android L release, RecyclerView has replaced ListView as the goto component for creating a view for providing window to a large data set. It promises lots of performance improvements over the standard list view. To use the RecyclerView widget, you have to specify an adapter and a layout…