Skip to main content

Mobile

Tappable label in Xamarin.Forms

·2 mins

Adding tap/click handling to Xamarin.Forms Label is fairly easy. You can do it both in XAML or code behind using GesureRecognizers collection like it is described in this recipe. Unfortunately if you plan to use this solution intensively in your app it will add quite a lot of repeatable code for setting up those handlers (especially in XAML)

Cleaning ADAL token cache on Android and iOS

·2 mins

Microsoft Azure Active Directory Authentication Libraries (ADAL) is a popular set wrapper around Azure Active Directory API distributed in the form of platform and language specific components. It’s especially useful in multi-platform applications that integrate with various AD APIs such as Outlook or Graph API. It not only wraps the oAuth endpoints but automates the entire application flow for retrieving, refreshing and persisting tokens.

How to setup Ninject as the default DI container in MvvmCross?

·3 mins

When you build a multi-platform application in .NET, especially for the mobile, you typically choose between two approaches. One is to code the shared UI layer commonly with Xamarin.Forms (you will still need to have some parts to be placed in platform projects, like custom renderers or providers). The second is to put the entire UI code in platform-specific projects. In this approach you can use the full power of each platform features (like fragments on Android). Both solutions allow for sharing common business logic between all the platforms. On the other hand full implementation of MVVM pattern in the second approach can be tricky and time consuming. The solution is to use 3rd party library; and here comes the MvvmCross. It covers many more areas than the pure MVVM pattern:

AAPT: Unknown option '--no-version-vectors'

If you ever encountered the error AAPT: Unknown option '--no-version-vectors' during the Xamarin build you probably found this page looking for a solution. Like I did. Then you probably first tried setting AndroidSdkBuildToolsVersion to the latest you have. Just like me. Or uninstall all the older versions. If this didn’t work (like in my case) stay with me.

Why ADAL does not persist user credentials on iOS simulator?

·2 mins

If you are using Azure Active Directory services you probably at least considered using ADAL as a client library in you application. It’s easy to setup, use and it offers a unified API across the most popular platforms - iOS, Android, UWP, web - both .Net and native. Unfortunately sometimes things just does not work out of the box without deeper understanding how some features are implemented. This post is about one of them - credentials cache persistency on iOS.