• Adding Clustering to MAUI Maps on Android

    Over the years I’ve developed a number of mobile applications that require the ability to display a number or locations on a map.

    The challenge comes when there are a large number of locations to display because the map very quickly becomes overwhelmed with marker pins - but only really on Android because Apple Maps provides a degree of clustering out of the box.

    image of android emulator and ios simulator running the sample application which displays a map of the UK with 500 randomly dropped pins. The landmass of the UK is almost totally obscured by the pins while ios is only displaying about 50 pins which massively reduces the on screen clutter.

    The above images show the difference between the standard Android and iOS maps with 500 markers randomly dropped onto them and as you can see, Android isn’t really cutting it as the UK landmass is pretty much totally obscured by the marker pins. While it could be argued that the iOS version is the lesser of the two implementations because there is clearly data missing, zooming in will cause more marker pins to be revealed.

    In this post I’ll show you how to extend the functionality of the regular Android mapping implementation provided by the Microsoft.Maui.Controls.Maps package to include Marker Pin Clustering which, in my opinion, will improve the UX no end.

    Read more
  • Developing a Jekyll Website with Docker

    docker logo

    Yesterday I spun up Jetbrains Rider, loaded up the Jekyll folder for this very website and prepared to get a blog post out of my head and online … but this is not that blog post!

    No, that post had to go on hold while I battled with error after error as I tried to get the site built and the Jekyll service up and running. Before I knew it, the evening was drawing to a close and I still didn’t have the site running locally.

    The problem was clear though - dependency issues with Ruby and its Bundler that are core to Jekyll’s operation. Something had updated on my MacBook Pro and it had really upset the apple cart.

    error in Rider terminal when trying to start jekyll server showing what appears to be a dependency error

    So how was I going to get around that?

    Read more
  • Save Blushes with Git Hooks

    We’ve all done it - we’ve committed a file, pushed it to the repository and it’s broken the build …. I know, shock, horror huh!?

    Now I’m not suggesting that experienced developers are committing code that doesn’t even build - I mean, we all check that much right ….. right? But do we always remember to run the unit tests?

    No, we don’t, and what happens next - we have to run the tests locally, find the issue, fix it and then go through the cycle again. While you make be able to squash these ‘fixing build’ commits out of the history but that build failure will always be there (unless you’re the DevOps admin of course).

    But what if there was a way that you could avoid having to remember to do these simple, but easily forgotten, tasks. Well, that’s where git hooks come in.

    Read more
  • Spurious Sockets Exception reported by Sentry

    While finishing off the migration of my Smite Scoreboard app to MAUI and having completed the bulk of the work I turned my attention to replacing the soon-to-be retired App Center for a suitable alternative capable of capturing exceptions and providing enough information to investigate them effectively.

    After reviewing a number of alternatives I opted for Sentry, mainly because of the presence of a decent free tier that offered the basic features I require with decent data retention policy.

    After configuring a project on my shiny new Sentry account, adding the required initialisation code to the MAUI project and replacing all the AppCenter references it was time to try it out …. and that’s where the trouble started.

    Read more
  • Deploying and Debugging MAUI Apps to Older iOS Devices with Latest Xcode

    While migrating a clients application from Xamarin.Forms to MAUI there was a requirement to test it on older iOS devices such as an iPhone 6s. Now that’s not really a big issue, I happened to have one in my ‘test phone’ collection that hadn’t been recycled or handed out to a family member who had dropped their own phone in the toilet.

    Getting the phone charged and booted was the easy part - getting it connected to my MacBook Pro so that I could deploy and debug the application to it required a little bit more effort, but not too much as it turned out.

    Read more