Svens Blog
372 FOLLOWERS
Sven is developing mobile Apps with Xamarin and MvvMCross since 2013 and the organizer of the Munich Mobile Xamarin & .NET Developers meetup group.
Svens Blog
4y ago
One of the latest big improvement to the Xamarin.Forms ecosystem is Xamarin LiveReload. It’s the next step when you reach the limits of LivePlayer. It helps you quickly iterating during your UI developent.
For more information and installation intructions, see: Xamarin Live Reload.
Ian Vink wrote a blog post about how to use Xamarin Live Reload in a MacOS + VMWare Fusion + Visual Studio 2017 on a Windows 10 VM environment.
The major disadvantage of the described setup is: It doesn’t work without internet or setting up a local MQTT server.
That’s why I want to describe the setup I’ve chosen on ..read more
Svens Blog
4y ago
The latest Visual Studio update makes an Xcode iOS/tvOS debugging feature available for Xamarin developers. It’s called WiFi debugging. This means that you can now debug your Xamarin.iOS Apps without having to plug your phone in via USB.
Requirements
Make sure you have installed at least these versions of the following software:
Xcode 9.0
macOS 10.12.4
VS Mac 7.4 or VS 2017.1.6
iOS 11.0 or tvOS 11.0
Your Mac and your device have to be connected to the same network.
Setup
Setting up your device for WiFi debugging is pretty easy. Just
connect your iOS Device via USB
open Xcode
navigate to the ..read more
Svens Blog
4y ago
Besides introducing the famous ARKit, Apple made a former private API usable in every App with iOS 11: CoreNFC. CoreNFC allows reading NFC tags with your iPhone 7/7+ and maybe soon with your iPhone 8 ;) And of course the Xamarin team has worked hard to make it usable with C#. In this blog post I’ll show you how to quickly read a message from a NFC tag formatted in NDEF.
Setup Development environment
Because iOS 11 is still beta, the setup up effort is a bit higher. You can skip this if Apple and Xamarin have released the stable verions.
Download and install XCode 9 beta 6
Download and install ..read more
Svens Blog
4y ago
Calligraphy is a nice library that provides custom font handling in Android. I once had issues with the MvvmCross layout inflation and knew that using Calligraphy with MvvmCross will cause some problems and I pushed it onto my Blog todo list - but I was lazy. But this week I saw a question on stackoverflow.
TL;DR
If you just want to get Calligraphy working.
Install-Package MvvmCross.Calligraphy
and modify your Setup.cs
public class Setup : MvxAndroidSetup
{
protected override MvxAndroidBindingBuilder CreateBindingBuilder()
{
return new CalligraphyMvxAndroidBindingBuilder ..read more
Svens Blog
4y ago
In 2016 github added a feature, that allows users to create templates for new issues and pull requests. This is nice, because if the maintainers can help users to provide all necessary data without asking for them several times. Unfortunately, some people just delete all of the template and start typing. In this blog post I’ll show my solution for this problem.
Functionality
When a user opens a new issue, github sends the issue information to a Azure Function web hook. The function analyses the issue data and compares the issue text with the issue template. After computing the matching quote ..read more
Svens Blog
4y ago
Today we had an awesome Xamarin Dev Day in Munich. Unfortunately a lot of people, especially people (and MVPs :P) that have installed Xamarin freshly, had problems building the sample apps.
If you just installed Xamarin or updated the Xamarin.Forms NuGet package or one of the Xamarin.Android packages and run into one of the listed error messages, reading further will probably relieve your pain.
Errors
We saw a variety of build errors. Here are a couple of them.
Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file ...\AppData\Local\Xamarin\Xamarin ..read more
Svens Blog
4y ago
I recently pushed the stable version 1.3.0 of my fingerprint plugin for xamarin to NuGet. The code is available on github.
If you want to try it you have two options. You can simply clone the repository and build and execute the sample applications, or integrate it directly into your own app via NuGet .
Changes Breaking
The property IsAvailable got replaced with GetAvailabilityAsync() which gives you a more detailed feedback why the fingerprint authentication is not available if it isn’t available. The possible options are:
Available: Fingerprint authentication can be used.
NoImplementation ..read more
Svens Blog
4y ago
Xamarin has done a great job on bringing async/await to animations on iOS (as Kerry shows on his blog) and on Xamarin.Forms. For my Fingerprint Plugin I was playing around with some animations on Android and I expected to find a similar animation extension - but I did not (If I’ve overseen something, tweet me). But, awaiting animations is pretty easy with a small extension method.
Problem
I want to colorize a icon, animate it and remove the color after the animation. In another use case I want to animate the icon and close the dialog afterwards.
Solution
The Android way would be to implement a ..read more
Svens Blog
4y ago
I saw a question on stackoverflow and thought it would be a nice use case for Effects.
Problem
The FontAttributes contain only None, Bold and Italic. If you want to underline your text, you have to implement it on your own.
Effects
Xamarin.Forms Effects allow you to customize the underlying native controls without writing custom renderers and custom controls. Creating your own effects is really easy if you follow the linked tutorial.
Core
To be able to use the effect in you Xaml, you have to create a RoutingEffect in your Core project.
public class UnderlineEffect : RoutingEffect
{
pu ..read more
Svens Blog
4y ago
There is a old tutorial from Stuart Lodge (Polymorphic lists in the MvvmCross tutorials) where he explains how to show different table cells for different types of ViewModels. This post will show you how to do the same with a MvxRecyclerView. The example code is available on github.
Problem
Sometimes there is the need to layout the items of RecyclerView differently. This is mostly the case, if your ItemsSource stores items of different classes.
ViewModels
For this example, we use the following ViewModels:
public class FirstViewModel : MvxViewModel
{
public ObservableCollection<PetViewM ..read more