Originally I had the swatches generating as part of the build, and doing this really should be the recommendation — slower build, but faster app.

In the end I preferred storing the data in a database for easier querying. Android doesn’t lend itself to embedding read-only databases without having to copy them to disk, well there is a way using the native libsql but then you’re having to manage native code too, so it just seemed easier to create the DB on the fly.

Part of my motivation for doing it on the fly was, over-engineering now, but with the thought that in the future the images would come from a server to be dynamically updated.

Matt Dolan has been eating doughnuts and developing with Android since the dark days of v1.6.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store