how to implement an anonymous abstract class in Kotlin

TIL how to implement an anonymous abstract class in Kotlin. This is something you do all the time in Java with Android for example, when an interface calls for a single abstract method implementation. Consider the following Java code for example. abstract class Foobar { abstract String foo(); } Foobar = new Foobar(…

Keeping Android Secrets Secure with Fingerprint Authentication and the Keystore

I spoke at DevNexus 2017 about how to get cryptography right on Android, and how to work with the fingerprint API to ensure robust security is in place ,especially for apps that need to store authentication details (like an authentication token). title: Keeping Android Secrets Secure with Fingerprint Authentication and…

Kotlin's invoke operator

An interesting feature of the Kotlin language is the ability to define an "invoke operator". When you specify an invoke operator on a class, it can be called on any instances of the class without a method name! This trick seems especially useful for classes that really only have one…

How to build a single-choice RecyclerView

In this article, i'll walk through one way to build a single-choice RecyclerView in Android. This will result in a general purpose RecyclerView-based component that mimics a typical "radio group" component you may be familiar with from html. This gives you a list of radiobuttons with one selection maximum. RadioAdapter.…

Implementing Swipe to Refresh, a Material Design UI Pattern

One of the great ideas formalized in the new Material Design user interface guidelines is the Swipe to Refresh UI pattern. In fact, you’ve probably already seen and used the Swipe to Refresh pattern. It's found its way into many popular Android apps like Facebook, Google Newsstand, Trello, Gmail…