Skip to main content

Posts

Showing posts with the label Xamarin

SmartHotel360 Demo Apps and Architecture

Looking at other people their code is a great way to extend your skills as a developer and architect.  One great set of examples are the reference apps that Microsoft created for the Connect event last year .  Time to check SmartHotel360 in GitHub . SmartHotel360 is a fictitious smart hospitality company showcasing the future of connected travel. Their vision is to provide: Intelligent, conversational, and personalized apps and experiences to guests Modern workplace experiences and smart conference rooms for business travelers Real-time customer and business insights for hotel managers & investors Unified analytics and package deal recommendations for campaign managers . The heart of this application is the cloud – best-in-class tools, data platform, and AI – and the code is built using a microservice oriented architecture orchestrated with multiple Docker containers. There are various services developed in different languages:...

Xamarin Workbooks

I started experimenting with Xamarin Workbooks as a new(better) way to create my API documentation. Workbooks are an interactive combination of executable code snippets and markdown documentation. Xamarin Workbooks is a cross platform tool both available for Windows and Mac. Download information is available here: https://developer.xamarin.com/guides/cross-platform/workbooks/install/ After installation, it is time to create your first workbook: Open Xamarin Workbooks. The new C# workbook window is shown. You can choose between a Console iOS, Android or WPF app(at the moment of writing). Xamarin Workbooks uses the concept of agents. Agents are responsible to inject and execute your code in a specific application type. This means there is a seperate agent for WPF, iOS, Android,… Let’s start simple and choose Console . You are welcomed by a blank workbook. In the workbook you can add two types of cells, either an executable C# cell or a document...

ReactiveList: ObservableCollection on steroids

If you ever build an MVVM style application before(using WPF, Silverlight, UWP,…) you probably used the ObservableCollection class.  It implements the INotifyCollectionChanged interface and can be seen as the counterpart of INotifyPropertyChanged. Through this interface the ObservableCollection notifies its subscribers about items being added, deleted, moved, … Unfortunately the ObservableCollection is rather limited in it’s behavior and doesn’t fit well in a truely observable architecture. Luckily the ReactiveUI framework and more specificly the ReactiveList solve exactly this problem… Let’s describe a scenario I had to build that was hard to do using ObservableCollection and a walk-in-the-park with ReactiveList: In our application we have to show a list of alerts and update the list when new alerts arrive. However alerts can arrive at a high pace and we don’t want to update the UI continuously but only when at least 5 alerts are raised. In our original implementat...

Xamarin.Forms: INSTALL_FAILED_UPDATE_INCOMPATIBLE when trying to deploy to Android device

When we tried to deploy a Xamarin Forms app to an Android device, we got the following error: Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass2a.<InstallPackage>b__29(Task`1 t) at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token) at Xamarin.AndroidTools.AndroidDeploySession.Start(CancellationToken token) The problem seemed to be that a "ghost" copy of the app still existed on the device although there was no app icon. However when searching under Applications we found it with ...

Xamarin.Forms: Error CS1703 Multiple assemblies with equivalent identity have been imported

When trying to build our Xamarin.Forms project on a VSTS hosted build server, our build failed first with the following error message: Error CS1703 Multiple assemblies with equivalent identity have been imported: ‘C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll’ and ‘C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll’. Remove one of the duplicate references. On our local system it worked without any compiler errors. We tried the easiest solution first, following the advice as mentioned in the error message. We removed the mscorlib.dll from the references. After doing that, everything was working again. I hate it when the behavior differs between a local Visual Studio Build and the build server

Updating Xamarin in Visual Studio

After the announcements of the new Xamarin updates, I thought time to update! And indeed when opening Visual Studio a notification appeared telling me an update was available. But after clicking on the notification I couldn’t find how to initiate the update … Turns out that this is actually not that hard: Inside Visual Studio, click on Tools –> Options Search for Xamarin in the Options menu Select Other and click on Check Now to find and install available updates.

TFS Build: Failed to activate Xamarin license.

While helping a customer setting up a release pipeline for their Xamarin Mobile applications, I noticed that their CI(Continuous Integration) build was failing for some time. When opening the build results I saw the following error message: “Failed to activate Xamarin license. {"code":-3,"message":"Could not look up activation code."}” The build was failing on the Activate Xamarin license step: The acquisition of Xamarin by Microsoft made this license check obsolete, so just remove it and  you are good to!

Creating a release pipeline for your mobile applications

I’m currently working on a release pipeline for our mobile applications, making it easy to build, deploy and test the mobile solutions we are creating on top of the Xamarin platform. Everyone who ever tried to publish a mobile application to a store(Apple AppStore, Google Play Store, Microsoft App Store,…) knows that it is cumbersome process requiring things like certificates, keystores, a lot of configuration work and so on… To optimize the process we went fully automated by using a combination of the following tools: Visual Studio Team Services Hosted Build Service MacInCloud Xamarin Test Cloud HockeyApp A great help during our journey was the DevOps blog series by Richard Woollcott: Xamarin DevOps VSTS – Getting Started: http://www.thexamarinjournal.com/xamarin-dev-ops-with-vsts-getting-started/ Xamarin DevOps with VSTS - Setup iOS CI Builds With MacinCloud: http://www.thexamarinjournal.com/xamarin-dev-ops-with-vsts-setup-ios-ci-builds-with-macinc...

Xamarin Evolve 2016–Videos available

If you were one of the lucky guys/girls who attended Xamarin Evolve , you can ignore this post. For all other people, the videos from all sessions at Evolve are published yesterday. So time to free some time in your agenda, close the curtains, get some good popcorn and start learning…!

Xamarin error - Could not load assembly 'Xamarin.Android.Support.v4'

After upgrading my Visual Studio to the latest version, I couldn’t compile my Xamarin project anymore. Instead I got the following error: Severity    Code    Description    Project    File    Line    Suppression State Error        Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? File name: 'Xamarin.Android.Support.v4.dll'    at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)    at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)    at Xamarin.Android.Tasks.Resolve...

Microsoft Build–Code Labs

In case you weren’t at Build 2016 or had to miss the Code Lab sessions while there, all the content, instructions, setup and source is available now in the Microsoft-Build-2016 repo. CodeLabs-UWP CodeLabs-Data CodeLabs-WebDev CodeLabs-IoTDev CodeLabs-Office CodeLabs-MobileDevOps CodeLabs-GameDev-1-UnityIntro CodeLabs-GameDev-2-UnityWin10 CodeLabs-GameDev-3-ANGLE CodeLabs-GameDev-4-GraphicsDiag CodeLabs-GameDev-5-MonoGameIntro CodeLabs-GameDev-6-Azure

Adventures in Xamarin Forms

With the recent announcement that Microsoft is buying Xamarin, I thought it was time to have a second look at Xamarin Forms(I took a first look more then a year ago, so hopes are that it evolved a lot in the meanwhile). The most interesting resource I could find is the Adventures in Xamarin Forms blog by Jonathan Yates in which he describes the lessons he learned while creating the Mountain Weather application.

ReactiveUI - The base class or interface 'Splat.IEnableLogger' could not be resolved

I’m building an application where I’m experimenting with ReactiveUI , an MVVM framework built on top of the Reactive Extensions. It’s the perfect fit if your application has a lot of interactivity and data that changes a lot. When I started using it, after installing the “reactiveui” nuget package , it immediately failed with the following error message: The base class or interface 'Splat.IEnableLogger' in assembly 'Splat, Version=1.6.2.0, Culture=neutral, PublicKeyToken=null' referenced by type 'ReactiveUI.IReactiveObject' could not be resolved. It is an annoying issue in the NuGet package where ReactiveUI.Core has a dependency on a Splat version >= 1.0. according to the package configuration. The problem is that the  latest version of Reactive UI couldn’t work with older Splat versions. After updating Splat to the latest version, the issue was solved. I hope the creator of the NuGet package fixes this, as this is really annoying for everyone...

Specflow and Xamarin

I’m a big fan of BDD and SpecFlow in particular. Last month I did a session about Specflow for my colleagues in the Netherlands. One of the questions I got during the presentation was if it was possible to use Specflow together with Xamarin. My short answer was “yes”. I promised to write a follow-up post explaining all the details. When I started writing this post, I stumbled over Rob Gibbens ‘BDD Tests with Xamarin.UITest and SpecFlow’ post where he explained everything much better than I could do myself. He even included some sample code .   Thanks to Rob, I don’t have to write this post anymore and start my weekend a little bit sooner. Great!

Xamarin.Forms: Xamarin-Forms-Labs

The amount of controls for Xamarin.Forms is rather limited. Luckily with the help of the community and control vendors like Telerik, Syncfusion,etc… this is changing. One of the open source initiatives is Xamarin-Forms-Labs : “Xamarin Forms Labs is a open source project that aims to provide a powerful and cross platform set of controls and helpers tailored to work with Xamarin Forms” It offers a wide range of controls, services, helpers and plugins. A must have for every Xamarin.Forms developer… Available controls AutoComplete (beta) Calendar Control (beta) Checkbox (beta) DynamicListView (beta) ExtendedContentView (beta) ExtendedEntry (beta) ExtendedLabel (beta) ExtendedScrollView (IOS beta) ExtendedTabbedPage ExtendedTextCell (beta) ExtendedViewCell (beta) HybridWebView (alpha) GridView (IOS beta) ImageButton (beta) RadioButton(beta) RepeaterView (beta) SegmentedControlView (IOS beta) Web Image (beta...

Xamarin.Forms: No valid iOS code signing keys found in keychain

Yesterday while creating a new Xamarin.Forms application,  it failed to build for iOS with the following error message: No valid iOS code signing keys found in keychain I first thought that there was something wrong with my iOS configuration, but when I tried to create a ‘traditional’ iOS application, it just worked. On the Xamarin forums I found the following solution that worked for me: Open your Xamarin.Forms projects. Unload the iOS project in Visual Studio. Open the csproj file and search for the following element <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> </PropertyGroup> Remove ‘ Entitlements.plist’ from the ‘CodesignEntitlements’ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' "> <CodesignEntitlement...

Xamarin and Caliburn

This news made my week! My favorite cross-platform framework( Xamarin ) and my favorite MVVM framework( Caliburn.Micro ) are finally coming together. The team after Caliburn.Micro announced that they have a working port of Caliburn for Xamarin. Not everything is ported yet, but I expect that some of the platform specific features will be ported as well. A working sample can be found here: nigel-sampson/xamarin-experiements .

Xamarin Forms Succintly

The Syncfusion ‘Succintly’ collection of free e-books keeps growing. The latest addition is  Xamarin.Forms Succintly . It is available for free here (registration required). Xamarin.Forms Succinctly With the fragmented landscape of mobile device platforms, tools for creating cross-platform apps have sprung up as varied and numerous as apps themselves. Most of these tools create their own APIs and translate them into the mobile platform APIs, which works fine for some. And then there’s Xamarin.Forms, which creates mappings from its C# classes and controls directly to the native platform APIs and controls. With Xamarin.Forms Succinctly by Derek Jensen, you will learn how to use Xamarin.Forms to build a common code base that can be deployed to iOS, Android, and Windows Phone devices, coming as close as possible as to the mythical “write once, run everywhere.” You’ll also learn how to build UIs with some of the 40 controls included in Xamarin.Forms, and even how to access na...

Mobile Development Platform Performance Comparison

When choosing a development platform for building Mobile applications, performance is always one of the discussion points pro- or contra a specific technology. A lot of people claim that technology X is faster than technology Y without real numbers to proof their point. I did some tests myself and had mixed experiences using Cordova, Xamarin and Native Mobile development. Last week I noticed this blog post by Kevin Ford: http://magenic.com/Blog/PostId/67/mobile-development-platform-performance . Kevin took the time to create a formal comparison between Native (Objective-C 64 bit and Java) Cordova (Multi-Device Hybrid Apps) using Intel's App Framework for the UI Classic Xamarin (64 bit unified beta for iOS) Xamarin.Forms (64 bit unified beta for iOS with beta version of Xamarin.Forms, note latest version of the unified API in the beta/alpha channels could not be used as it is not supported by Xamarin.Forms) Go check out the full post for all the details, but some things...

DevIntersection 2014 – Cross platform mobile development and MacInCloud

At the moment I’m in Las Vegas attending DevIntersection . During the mobile development workshop I attended, the presenter mentioned MacInCloud , an online service to remote access a Mac in the Cloud. I’m a cross platform mobile developer, why should I care? If you are doing cross-platform development(with for example Xamarin), you’ll need a Mac sooner or later. Apple Licensing Terms doesn’t allow you to design and build your application on non-Apple hardware. So don’t think that creating a Virtual Machine and installing OS X on it, is a feasible solution. Now you would think that the only option left is to buy a Mac, but Macs are expensive. Thanks to MacInCloud , you can use a Mac and only pay for the time you are using it.