In the parts one and two of this series I covered how to use a Fragment to maintain state through configuration changes and how to launch a new Activity and wait for its results using async/await. In the third part I take this a step further and show how to get direct access to a new (in-process) Activity instance so that you can call methods on it, use events, or whatever else you need to do.
Wednesday, September 16, 2015
Taming the Android Activity, Part 3
Wednesday, May 13, 2015
Blurred Image Renderer for Xamarin.Forms
In response to a recent Xamarin forum post I spent some time building a custom Xamarin.Forms renderer for a blurred image on iOS and Android. Read on to learn how I did it.
Sunday, May 10, 2015
Taming The Android Activity, Part 2
In part one of this series I covered how to use a Fragment to maintain state through configuration changes. In part two I will cover how to launch a new Activity (in-process or not) and wait for its results using C#'s async/await feature.
Thursday, April 30, 2015
Objective-C Categories in Xamarin.iOS
One of the cool things about Objective-C is how dynamic it is. This includes the ability to add methods to classes that already exist even at runtime. Categories are a feature of Objective-C that can be used to do all kinds of things that might otherwise be difficult or impossible, but until very recently this feature has been inaccessible from C#. This post will explain what categories are, what they're used for, how to use them in C# using Xamarin.iOS 8.10, and a useful example.
Saturday, April 25, 2015
Taming The Android Activity, Part 1
The Activity is a core building block in an Android application, but in some cases it can be a pain to work with. This article is part one of a series showing how to deal with some of the complexities of the Activity in a clean way using some of the capabilities of C# available to Xamarin.Android developers.
Wednesday, March 25, 2015
Decoupling Views In Multi-Screen Sequences
In my previous post I explained how to decouple individual views and why that is a good idea. In this post I will take that idea further and explain how to use this concept in more advanced UX scenarios involving multi-screen sequences.
Friday, March 13, 2015
Decoupling Views
One of the most common design mistakes that I see people make in mobile applications is coupling their views together. In this post I will explain why this is a problem and how to avoid it.
Wednesday, February 18, 2015
Checking For iOS Layout Gotchas With Roslyn
Markus Schiller at App & Mensch did something awesome. He created a Roslyn Diagnostic Analyzer to look for one of my iOS Layout Gotchas. Check out his blog post explaining how.
Roslyn is going to be a boon to static code analysis, and I can't wait to see what else we can do with it.
Wednesday, January 28, 2015
View Controller Lifecycle
New iOS developers are often confused about the life cycle of view controllers. In this post I will walk through the various life cycle methods and explain how to use them and some common mistakes to avoid.
Monday, December 22, 2014
iOS Layout Gotchas Redux
Since my last post on iOS Layout Gotchas I have encountered a few more basic layout mistakes that can lead to bugs and brittle code. Some of these are things I have found myself doing so hopefully they will be useful to others.
Sunday, December 7, 2014
Xamarin.iOS Deep Dive Talk Recording
I have sadly neglected this blog a bit during the busy month of Novembruary1, but I wanted to link to a recording of a relevant talk I gave recently on Xamarin.iOS. The talk was given at the Austin Mobile .NET Developers Group's November meeting. Here is the abstract:
This month's talk is a whirlwind tour through how Xamarin marries the worlds of C# and Objective-C. In this talk we will explore the basics of Objective-C and Cocoa Touch and how the Xamarin.iOS runtime and bindings map to C#. You will learn how delegates work, how memory management works, and how to work around missing or incomplete bindings. You will also learn how to use Xamarin Studio to explore Xamarin's code and expand your knowledge on your own.
The presentation runs about 1hr. 20min., but it is full of detailed information. If you are interested in learning more about how Xamarin.iOS works under the hood then I think it is well worth viewing.
Link (embedded recording after the break, along with links to example code from the talk)
Sunday, November 9, 2014
iOS Layout Gotchas
In a previous post I touched on layout in iOS by describing the difference between Frame and Bounds, and in that post I covered one of the most common layout mistakes I encounter in iOS code. However, there are several other common mistakes in layout that I have been seeing a lot recently. Read on to learn how to avoid these gotchas in your own code.
Monday, September 22, 2014
UIView Frame vs. Bounds
The UIView class on iOS has several properties related to size and position, and some of them seem to overlap in functionality. It may not be obvious at first which ones to use when or whether there is even a difference, and as a result I have seen many people get confused by how these properties fit together, and many examples of them being used improperly. This post will try to explain how these properties work.
Monday, September 8, 2014
Navigation With MVVM
In my previous post I covered the basics of navigation patterns in mobile apps and the Xamarin.Forms navigation APIs. In this post I will cover architectural issues related to navigation in an app using the MVVM pattern and one method of implementing your navigation in a more portable way.
Tuesday, September 2, 2014
Navigation in Xamarin.Forms
Navigation is a fundamental concept in mobile applications. Desktop computers have relatively large screens that lend themselves to many modeless windows, which allows users to see multiple views at once switch between tasks quickly. Mobile devices, on the other hand, have small screens. It would be impractical in most cases to show multiple views at once (no matter what Samsung's marketing says). As a result, mobile applications tend to be designed around the concept of moving from one full-screen view to another. In this post I'll describe the most common types of navigation in mobile apps and how to use them in Xamarin.Forms.