James Montemagno
James Montemagno

Live, Love, Bike, and Code.

Tags


James Montemagno

Xamarin.Forms

Add ASP.NET Core's Dependency Injection into Xamarin Apps with HostBuilder

Dependency injection(DI) and inversion of control (IoC), have been a recurring theme in questions that I have received over the last six years. Sometimes it is around using constructor injection(), simple service containers, and often around full frameworks such as Prism or MVVM Light. I will be honest with you, I have never been a fan of DI/IoC when building mobile apps. My main reason is that there has never been any official pattern or recommendations from Google or Apple (or Microsoft/Xamari…

James Montemagno James Montemagno

Optimizing Xamarin Apps & Libraries with the Linker

The Xamarin linker is one of the most important pieces of technology when building mobile apps, that no one knows exists. It does all of the hard work for you, stripping out all unused code from libraries that you include in your apps. It should only be used in release mode as it takes extra time to compile your app, but means that your app will be smaller: The linker has specific implementations for both iOS and Android and is completely customizable. Linking for App Developers Before I get…

James Montemagno James Montemagno

Hangout, Drink Coffee, & Cycle with Me at Build 2019

Microsoft Build 2019 is right around the corner (not only from where I live, but also it starts next Monday), so what better time to plan some meetups with awesome .NET developers <3. There will be tons of awesome sessions, the Xamarin booth, but also tons of coffee drinking with me, and even a bike ride opportunity. Here is my schedule for Build! Monday May 6th 7am - 8am: Early Morning Coffee (pre-keynote): Monorail Espresso - (across the street from convention) 3pm - 3:30pm: Hub Theater…

James Montemagno James Montemagno

Using Font Icons in Xamarin.Forms: Goodbye Images, Hello Fonts!

Updated: See the newest way of importing fonts with Xamarin.Forms 4.6 on my latest blog post. My full walkthrough: My entire mobile development career I have gone all in on using device specific images and icons. These are properly scaled and sized images that fit @1x, @2x, @3x, hdpi, xhdpi, xxhdi, and so on, which are great because they are super optimized for each platform. The reason I do this was because it gives very consistent look and feel to an app across all of the different form fac…

James Montemagno James Montemagno

The Beautiful & Complex FlexLayout Comes to Hanselman.Forms

Last week I wrote about my new quest to fully optimize and enhance Hanselman.Forms. This involves using the latest and greatest in Xamarin.Forms and Xamarin.Essentials, but it also means spicing up the app with some lovely visuals and design. My first quest was to re-design the podcast section of the mobile app to create a list in grid form of different podcast that Hanselman produces. So, first things first we should design a card to hold each podcast in. This can be accomplished with a simple…

James Montemagno James Montemagno

Control Text Size on Android Bottom Navigation View

It seems as though my obsession with the Android Bottom Navigation View aka Bottom Tabs will never end! This time I got a question about controlling the size of the text when the user taps on a tab. The default behavior is to zoom in on the text: Inside of your Android project's Resources/values folder create a new file called dimens.xml if it doesn't exist. Then add the following XML to override the size of the text when it is active and not active: <resources xmlns:tools="http://s…

James Montemagno James Montemagno

Modernizing Hanselman.Forms: A Customizable Brand Mobile App

The night before we launched Xamarin.Forms in mid-2014, I was having a conversation with Nat about creating a nice out of the box real world example of a Xamarin.Forms app. We discussed several different app ideas, but we were short on time as it was already 8PM at night. Then I thought perhaps I could create an app for my idol and fellow Chipotle lover Scott Hanselman. Fast-forward 8 hours and several cups of coffee later and Hanselman.Forms was born! It was very simple with an about page, Twit…

James Montemagno James Montemagno

Xamarin.Forms: Fully Customize Bottom Tabs on Android & Turn Off Shifting

It seems as if the BottomNavigationView aka Bottom Tabs on Android is one of the top things that I write about on my blogs. There was an introduction post, how to use reflection to remove shifting on native Xamarin.Android, official support in Xamarin.Forms, and most recently how to get a nice drop shadow. I am back one more time to talk specifically about how to finely tune those bottom tabs on android and stop the ridiculous default Android behavior of shifting the tab icons and text. Let's…

James Montemagno James Montemagno

I crush code and share it, publish NuGet packages, speak at conferences, upload videos, pretend I am good at playing video games, tweet up a storm, drink gallons of coffee, and ride my bike. Checkout my monthly newsletter that you should subscribe to!