Matthew Kennard

03 Mar 2021

Assets vs drawable for adding a GroundOverlay to Google Maps on Android

I work on a number of map heavy apps with one of my clients. Recently I was tasked with porting an older app written by another developer to the newer platform we work with now. The app used an old map from a few hundred years ago and overlaid it on top of a Google Map. I was scratching my head yesterday with why my new code had much poorer performance than the older app in loading the map.

It turns out that creating a GroundOverlay using a bitmap read from a drawable resource is noticeable slower than reading it from assets. I’ve got too many different projects on at the moment to investigate exactly why this but have made a note to revisit the underlying reasons at some point in the future.