Drop the temp!

In classic Java, it is a common idiom to set up a temp variable to hold some value, populate it in a for loop (often after checking some condition for values to add), and then subsequently return the temp variable: public List<Person> getFilteredUsers(List<Person>…

Kotlin Riddler: Legit Syntax?

will the following compile? class Qaz { var bar = "hey" } class Foo(private var qaz: Qaz?) { fun assignBarMkayyy() { if (qaz != null) { qaz.bar = "hey!" } } }…

How to get Kotlin JS to work with JQuery (or other external libraries)

If you have tried to get external javascript libraries working with Kotlin (when compiling to javascript) it can be somewhat puzzling to get external libraries to work with Kotlin while at the same time being typesafe. Kotlin provides https://kotlinlang.org/docs/reference/dynamic-type.html to work around this, but…

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…