James Montemagno
James Montemagno

Live, Love, Bike, and Code.

Tags


James Montemagno

Plugins

Upgrading to Xamarin.Essentials from Plugins

Xamarin.Essentials [https://docs.microsoft.com/en-us/xamarin/essentials/] is a new official library from Microsoft (that I worked on) that provides developers with over 30 cross-platform APIs for their mobile apps to tap into to access native features. Yes, this may sound similar to Plugins for Xamarin, but it is an evolution that is super optimized for each plaform, provides a consistent API, and is super crazy well documented. And of course it is completely open source on GitHub [https://githu…

James Montemagno James Montemagno

Continuous Integration & Delivery for Xamarin & .NET Libraries with Azure DevOps (VSTS)

I build a lot of .NET libraries that include simple .NET Standard libraries to fully cross-platform plugins for Xamarin and Windows that target up to 10 different platforms. When I got started building libraries and shipping them to NuGet I went down a simple path of just building everything locally on my machine and manually uploading them to NuGet. This worked great for a single library, but as soon as I took on a second... third... forth... and so on, things got out of hand and I knew I had t…

James Montemagno James Montemagno

Converting Xamarin Libraries to SDK Style & Multi-Targeted Projects

If you are like me you may have a lot of standard Xamarin.iOS and Xamarin.Android libraries sitting around. They aren't plugins [https://montemagno.com/new-plugin-for-xamarin-multi-target-templates-for-visual-studio-2017/] , but they do extend a single platform with custom functionality and controls. Wouldn't it be great if you could update them to the new SDK Style projects which use Package References, auto-NuGet packaging, and load WAY faster?!?!? It is all crazy simple to do just lik…

James Montemagno James Montemagno

Monitoring Android Activity Lifecycle Events: Return of Current Activity Plugin

It has been nearly two and a half years since I wrote about how to easily get access to the current Android Activity [https://montemagno.com/access-the-current-android-activity-from-anywhere/] with just a few lines of code. This code led to the creation of my Current Activity Plugin [https://github.com/jamesmontemagno/CurrentActivityPlugin] for Xamarin.Android apps and library creators to easily get access to the current Activity. Since then it has been the core of many of my plugins and has bee…

James Montemagno James Montemagno

Connectivity Plugin 4.0: Important and Awesome Changes

The Connectivity Plugin for Xamarin [https://www.nuget.org/packages/Xam.Plugin.Connectivity] is my second most installed NuGet package with nearly 600,000 installs at time of writing this. It is easy to see why as it gives developers the ability to check connectivity on any platform with a single line of code, subscribe to events, and see what the current connection type is, with a complete cross platform API for iOS, Android, macOS, and Windows. I mean look at this thing, it is beautiful: i…

James Montemagno James Montemagno

Moving Plugins for Xamarin to .NET Standard

I could never imagine the amazing response to Plugins for Xamarin [http://xamarin.com/plugins], those amazing little libraries that abstract away all that platform specific code into a lovely cross-platform API for iOS, Android, and Windows. They sure have grown, with hundreds of plugins being generated by the community and with tons of installs. My plugins alone have now hit 3 Million installations! With all this momentum it is a great time to look to the future, simplify plugins, and take the…

James Montemagno James Montemagno

Unit Testing Plugins for Xamarin

So you love unit testing…. said no one ever, but you are forced to write unit tests and you want to use Plugins for Xamarin which are all singletons and need platform specific implementations or they will throw an exception in your tests…. what to do?!?!? Plugins are all interface based, which means all we have to do is use standard practices to not directly call the singleton, and setup our code to return the instance we want. In unit tests we can return a Mock (or Moq) of the interface, and in…

James Montemagno James Montemagno

Opening App Store for Ratings on iOS and Android

Sometimes you want to ask your users to rate your application. There are several components out there that will open a dialog box and prompt for ratings, but sometimes you don’t want to stop the flow of your app and throw it in their face. What I do in my application is simply add a section on my settings page asking if they would like to rate the app. When pressed I launch the app store directly to the review page: Update! This is now easier than ever with my Store Review Plugin [https://git…

James Montemagno James Montemagno