James Montemagno
James Montemagno

Live, Love, Bike, and Code.

Tags


James Montemagno

Xamarin

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

Colored Map Markers on Xamarin iOS and Android

I was getting ready for my next Tech Summit presentation and wanted to spice up my Maps for iOS and Android. I didn’t want to create any custom marker images or anything like that, but just wanted a little color flare on it. I knew there had to be an API out there to do it in each of the native frameworks and of course there was, so here is the quick and easy solution. (If you need this for Xamarin.Forms this would make a great Effect most likely). Android - Google Map Markers Surprisingly this…

James Montemagno James Montemagno

Cleaning Up Space on Your Xamarin Development Machine

Today, I officially uninstall Visual Studio 2015 and upgrade to Visual Studio 2017 [http://www.visualstudio.com]!! Whenever I do a major upgrade I usually re-format my machine and get a fresh install, but this time I decided not to and just uninstall and clean up my machine as best as I can. While VS 2015 for sure installs tons of stuff all over the place and I can manually uninstall things, I figured it was a good time to help developers clean up space on their machines. I do this every few mon…

James Montemagno James Montemagno

Setting up Visual Studio 2017 for Xamarin Development

Visual Studio 2017 was just released yesterday, and it is awesome! You can re-live all the keynote and demo deep dives on Channel 9 [https://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2017-Launch]. There are tons of new features and a huge revamp to installation but things to me still aren’t absolutely perfect in the setup of how I like to develop. So in the spirit of my Cycle 8 [https://montemagno.com/preparing-machines-for-xamarin-cycle] and Cycle 9 [https://montemagno.com/xamarin-c…

James Montemagno James Montemagno

Deploying an ASP.NET Core app to Linux on Azure App Service

You probably wouldn’t expect this blog post from me as I run away from building any web apps, but I have been messing around with ASP.NET Core inside of Visual Studio for Mac. I thought it would be really cool to take our default app for items and deploy it to an Azure Linux based App Service. Because… why not?!?! Also, I will make Hanselman [http://twitter.com/shanselman]proud. So, first things first.. The backend. My Items on ASP.NET Core If you head over to your Visual Studio for Mac [https…

James Montemagno James Montemagno

Xamarin Cycle 9: Preparing Machines

It felt like just yesterday we released Cycle 8, which was packed full of good stuff like iOS 10 and Android N. I wrote a full blog post on how to prepare your machines for Cycle 8 [http://motzcod.es/post/150380059392/preparing-machines-for-xamarin-cycle], and I figure since today we released Cycle 9 [https://releases.xamarin.com/stable-release-cycle-9/] it would be a good time to refresh it! 1.) Install the latest JDK 1.8 [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-…

James Montemagno James Montemagno

Version Bumping iOS & Android apps in Azure DevOps (VSTS)

I love Continuous Integration and Deployment for mobile applications and have given several talks on it in the past. It streamlines your entire development process and makes it drop dead simple to simply commit code and have everything you don’t want to do manually be taken care of for you. This means build, test, bump versions, and ship off to testers with integrations like HockeyApp. Notice I mention “bump versions”, which is actually really important. Every build should be assigned a unique n…

James Montemagno James Montemagno

Xamarin.Forms Android Selected & Unselected Tab Colors

I get a lot of questions about Xamarin.Forms. One of my most popular blogs was about spicing upiOS tabs with selected and unselected tab colors [http://motzcod.es/post/138225183932/tintcolor-selectedimage-xamarin-forms-ios], and since that day developers have been asking about Android. Well, to be honest I was always against adding icons to material tabs in Android, but developers want to do it, so here is how you can, with a Custom Renderer for a Tabbed Page. Here is what it will look like at t…

James Montemagno James Montemagno