James Montemagno
James Montemagno

Live, Love, Bike, and Code.

Tags


Twitter


James Montemagno

Plugins

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 with just a few lines of code. This code led to the creation of my Current Activity Plugin 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 been installed over 600,000 times from NuGet! Times change and it is time for an update to this near perfect library. If you have ever use…

James MontemagnoJames Montemagno

Moving Plugins for Xamarin to .NET Standard

I could never imagine the amazing response to Plugins for Xamarin, 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 leap to .NET Standard. What i…

James MontemagnoJames 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 MontemagnoJames 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: This is pretty simple to do for iOS and Android by launching a specific UR…

James MontemagnoJames Montemagno

Cross Platform Photos with Media Plugin

After months of work, contributions, code reviews, testing, new operating system releases, and tons of awesome new features the brand new Media Plugin for Xamarin and Windows is ready for mass consumption. Not matter how your developing your applications with Xamarin or Xamarin.Forms you can easily have your users take or pick photos and videos from shared code! Here is the easiest example of taking a photo and displaying it in a Xamarin.Forms image. takePhoto.Clicked += async (sender, args) =&g…

James MontemagnoJames Montemagno