SSID Connector – Compatibility Wrapper

Recently a friend and former colleague Robert Sproats approached me regarding some issues he was having. He asked if I was aware of best practices for connecting to a specific WiFi SSID on modern and legacy devices. Android Q deprecated the WifiManager APIs for this and they no longer work for Q and later devices.…

SSID Connector – Callback Flow

Recently a friend and former colleague Robert Sproats approached me regarding some issues he was having. He asked if I was aware of best practices for connecting to a specific WiFi SSID on modern and legacy devices. Android Q deprecated the WifiManager APIs for this and they no longer work for Q and later devices.…

Kotlin: Serialization – Update

Last week I published an article covering the kotlinx.serialisation library and how it had the potential to overcome the issue of Kotlin object serialization using Java Serialization not correctly handling the object singleton implementation which under-pins Kotlin objects. However, at the time I wrote that article, Kotlin sealed class hierarchies were not supported by kotlinx.serialisation,…

Kotlin: Serialization

After chatting with Sebastiano Poggi about the issues with using Kotlin objects that I covered in a recent post, he made the interesting suggestion that possibly kotlinx.serialization might work better than the Java implementation because it is faster, more flexible (we can use different serialisation formats such as JSON or Protobuf), and is built with…

Kotlin: Serializable Objects

When is a Kotlin object not a Kotlin object? When it’s a Serializable Kotlin object. This blog post is the story of a strange issue that I encountered recently where a Kotlin object stopped behaving as it was supposed to, how I initially got it working with a bad fix, and how I eventually fixed…

Parcelize

A Parcel is an optimised serialisation format for Android which is designed to enable us to transfer data between processes. This is something that most Android developers need to do occasionally, but not that often. Making a class Pareclizable actually requires a little bit of effort, but there’s a Kotlin extension that simplifies things enormously.…

Kotlin: Function References

Kotlin is a very feature rich language with and the subtleties of some of these features are worthy of some exploration to fully appreciate. In this ad-hoc series we’ll look at some of these, and in this article we’ll look at function references and some of the really nice tricks that we can achieve with…

Kotlin: Mutability

Kotlin is a very rich language with much subtlety tucked away. In this occasional series (meaning that there will be occasional, standalone posts covering distinct areas) we’ll explore some of these subtleties. In this post we’ll take a look at mutability.

Kotlin: Contexts & SharedPreferences

In advance of a new series of posts which start next week, I ported the code from a previous series of articles to Kotlin. I opted to port the code manually rather than rely on any automated conversions and there are a couple of things worthy of explanation hence this article.

MidiPad – Midi Events

Musical Instrument Digital Interface (MIDI) has been around since the early 1980’s and the basic specification has changed little since. It is a standard by which electronic musical instruments and other devices can communicate with each other. In Marshmallow (V6.0 – API 23) Android actually got some good MIDI support, and in this series of…