Disclaimer: this is an automatic aggregator which pulls feeds and comments from many blogs of contributors that have contributed to the Mono project. The contents of these blog entries do not necessarily reflect Xamarin's position.

March 29

An API is only as good as its documentation.

Your APIs are only as good as the documentation that comes with them. Invest time in getting docs right. — @rubenv on Twitter

If you are in the business of shipping software, chances are high that you’ll be offering an API to third-party developers. When you do, it’s important to realize that APIs are hard: they don’t have a visible user interface and you can’t know how to use an API just by looking at it.

For an API, it’s all about the documentation. If an API feature is missing from the documentation, it might as well not exist.

Sadly, very few developers enjoy the tedious work of writing documentation. We generally need a nudge to remind us about it.

At Ticketmatic, we promise that anything you can do through the user interface is also available via the API. Ticketing software rarely stands alone: it’s usually integrated with e.g. the website or some planning software. The API is as important as our user interface.

To make sure we consistently document our API properly, we’ve introduced tooling.

Similar to unit tests, you should measure the coverage of your documentation.

After every change, each bit of API endpoint (a method, a parameter, a result field, …) is checked and cross-referenced with the documentation, to make sure a proper description and instructions are present.

The end result is a big documentation coverage report which we consider as important as our unit test results.

Constantly measure and improve the documentation coverage metric.

More than just filling fields

A very important things was pointed out while circulating these thoughts on Twitter.

Shaun McCance (of GNOME documentation fame) correctly remarked:

@rubenv I’ve seen APIs that are 100% documented but still have terrible docs. Coverage is no good if it’s covered in crap. — @shaunm on Twitter

Which is 100% correct. No amount of metrics or tooling will guarantee the quality of the end-result. Keeping quality up is a moral obligation shared by anyone in the team and that can never be replaced with software.

Nevertheless, getting a slight nudge to remind you of your documentation duties never hurts.


March 27

Contest: What’s Beggin’ for a Beacon?

Yesterday, we put the spotlight on our beacons partners and today we’re inviting you to put on your creativity hat and dive into the world of context.

What are Beacons?

Beacons are small pieces of hardware that use Bluetooth technology to transmit signals to mobile devices, allowing developers to create context-aware apps. Our Component Store partners make it easy to build apps that detect beacon signals and can act accordingly, sending push notifications, coupons, or other information to a central database.


The bottom line: beacon potential is everywhere, from simple life productivity hacks to innovative business improvements. Share a picture, video, or brief description of something you think should be beacon-enabled – however practical or impractical – and we’ll award prizes to our favorite ideas.

How to Enter:

  • Submit your idea, including why it’s “beggin’ for a Beacon,” using a written description, video, and/or photos
  • Tweet your idea to @xamarinHQ with the hashtag #BeaconPotential

Example Tweet:

Always losin’ Fido. @XamarinHQ #BeaconPotential
Whiskey, Xamarin Office Dog


Most Creative Idea wins a Xamarin + Beacons extravaganza!

  • BKON hardware
  • MobStac swag and Rasberry Pi 2 kits
  • Estimotes beacon devkit & assorted swag
  • Xamarin swag

Real Potential

Do you have the next Fido finder app in the works? We’re on the lookout for submissions that have real potential! One submission will be eligible for a special prize from our beacons partners.

Special Prize:

Special prize for one lucky contestant whose submission has the most real-world applicability: our beacons partners are offering a 1:1 mentorship session to share their expertise. They will guide you through best practices for context-aware apps to help get your app off the ground – and provide beacon hardware to get you up and running.

Rules and Regulations:

All entries must be submitted by April 6th at 12pm EST. A valid entry is a tweet that highlights a unique, creative and useful Beacon use case and includes both @xamarinhq and the hashtag #BeaconPotential. We will review and evaluate your submissions based on a variety of factors, including creativity and number of likes, retweets, and shares. Contestants should follow @XamarinHQ to enable us to DM you for private follow-up if you win a prize. This contests is open to individuals and there is no purchase necessary to enter.

The post Contest: What’s Beggin’ for a Beacon? appeared first on Xamarin Blog.

Win an Apple Watch Contest Winner!

A couple of weeks ago we invited you to start creating your first WatchKit app using the Xamarin Storyboard designer for a chance to win an Apple Watch. With all of the excitement around this cool new device, we weren’t surprised when we got a ton of great submissions!

With a lot of thought and tough decision making, we’re pleased to announce that the winner of the contest is:

Car Parking App!

A huge thank you for all of the wonderful submissions; it was a truly difficult choice to pick just one. For more Apple Watch inspiration, check out this forum to see other examples from the contest!

The post Win an Apple Watch Contest Winner! appeared first on Xamarin Blog.

March 26

Xamarin Webinar Featuring Gartner: The Next 20 Million Apps

Gartner logoIn the near future, nearly every transaction and interaction will need to have a mobile surface, and millions of new apps will be required over the next few years to really achieve the promise of enterprise mobility to transform customer relationships and business processes.

How will the enterprise achieve this? Through scalable ways to build, test, integrate, and manage apps across a diverse and dynamic device landscape that is quickly moving beyond smartphones and tablets to wearables and M2M computing.

To help mobile leaders navigate this next phase of mobility, we invite you to register now for our April 9th webinar with Analyst firm Gartner, featuring Richard Marshall, Research Director of Enterprise Mobility at Gartner, and Xamarin’s Director of Enterprise Mobility, Steve Hall.

Register Now

About the Speakers

Richard Marshall, GartnerRichard M. Marshall is a Research Director in the Mobile and Client Computing group, focusing on enterprise mobility and especially mobile apps and mobile app development.He has experience across a wide range of software industry skills, from coding to corporate governance. This includes all phases of product development from initial concept through implementation and on to sales, product management and marketing. He is an inventor of software technology and has lectured and written papers, articles and reports for many years. Mr. Marshall has held a variety of leadership roles, including CTO, VP of Engineering and CEO. He has had extensive success in raising capital from angel and institutional investors.
Steve HallSteve Hall works with Xamarin’s enterprise customers providing guidance and best practices for implementing mission-critical mobile solutions in an enterprise setting. He has over fifteen years of mobile experience that covers enterprise mobile architecture, security, and development. In the span of his career, Steve has also designed secure mobile solutions for large enterprises, consumer applications, and government agencies.

The post Xamarin Webinar Featuring Gartner: The Next 20 Million Apps appeared first on Xamarin Blog.

Xamarin Tech Partner Update: Spotlight on iBeacons

We’ve been busy growing our mobile ecosystem over the past year, and the Xamarin Component Store now features over 300 components that allow developers to easily integrate new functionality into their apps. Features ranging from cloud services and backend systems integration to charts, graphs, and datagrids can be added with just a few lines of code. Today, we’re excited to highlight our beacons partners BKON, Estimote, and MobStac.

These partnerships give Xamarin developers the power to detect beacons with simple integrations, expanding on our mission to make it fast, easy, and fun to build great mobile apps.
Estimote LogoIn mobile, context is king, and Estimote, MobStac, and BKON allow developers to build context-aware apps using micro-location data to send information to the users’ device. Beacons can be used to improve customer relationships by sending relevant information instead of “spam” ads, to drive increased revenue for businesses by informing shop associates when customers are interested in objects, and to speed transactions with automatic check-in.
Mobstac LogoBeaconstac by MobStac is a hardware-agnostic cloud service, allowing developers to use any beacon vendor of choice, including Estimote, to tap into MobStac’s robust content management, reporting, and analytics capabilities. With MobStac, users can use iBeacon data to detect high-traffic retail areas, to target specific users based on CRM data, or to push certain product catalog information based on in-store location.
BKON LogoBKON and Estimote provide both beacon hardware and Xamarin Components to detect beacon transmissions. BKON offers two beacon hardware variants, as well as security and management for deployed beacons, giving customers the ability to detect battery levels, set passwords, and more. With Estimote and Estimote Stickers, beacons become even more portable. Users attach a beacon to objects, allowing any device or item to become a “nearable”: a mini smart-machine, broadcasting data to devices in range. This takes contextual targeting even further, allowing, for example, sales associates to be alerted when a customer engages with an item or museum curators to adjust exhibit displays based on visitor interaction.

Our partnerships with Estimote, MobStac, and BKON make building native, context-aware apps simple, allowing your customers to remain relevant, gain competitive advantage, deliver better user experiences, drive additional purchases, and leverage user behavior to identify areas for growth.

Get started with BKON, Beaconstac by MobStac, and Estimote (iOS and Android) today.

The post Xamarin Tech Partner Update: Spotlight on iBeacons appeared first on Xamarin Blog.

March 25

Add Storage to Your Apps with Office 365

Enterprises with a Bring Your Own Device (BYOD) strategy face the challenge of securing their resources on various types of devices. For example, organizations want to share documents with their employees, allow them to collaborate on documents with coworkers, and more. Employees want to sync these documents with a variety of devices, such as tablets, laptops and mobile phones, with a seamless search experience. These challenges can be tackled by using OneDrive for Business, which is part of Office 365.

Xamarin developers can use OneDrive for Business in their iOS and Android apps to download, open, edit, and upload files in Office 365 (O365). In this post, we’ll build a simple Xamarin.Android app that can connect to OneDrive for Business to show a list of files.

Note 1: To build apps that can connect to Office 365, you’ll need an active subscription. Also, to follow the steps manually as mentioned in this blog, you’ll need to access the O365 associated Active Directory.

Note 2: The APIs, libraries, sample code and registration process are currently in preview. This blog post is intended to show the possibilities of using O365 with Xamarin.

Step 1: Register the app

As we’ve seen before, Office 365 uses Azure Active Directory (AD) as the Identity Provider. Which means that Azure Active Directory is used to authenticate and authorize users. To allow OneDrive to be accessed from mobile apps, it is mandatory to register this app in AD. You can follow our guide to registering an app with Active Directory to learn how.

Step 2: Give access to the O365 APIs

On the Configure tab, click the Add Application button at the bottom.


On next screen, select Office 365 SharePoint Online to access the Files and Lists.


Once these services are selected, give access to the tasks that a user can perform with the app on the next screen.


Now we can Save this configuration and focus on the mobile part of our app.

Step 3: Build mobile app

Step 3a: Refer NuGet packages

In order to use O365 services in your Xamarin app, you will need to add the following NuGet packages to your project.

  • Azure Active Directory Authentication Library (ADAL) – v3.0.11xx (Preview/Alpha)
  • Microsoft Office 365 My Files Library for .NET – v1.0.22 (Stable)
  • Microsoft Office 365 Discovery Library for .NET – v1.0.22 (Stable)

Step 3b: Declare variables

Add a new class to your project and name it AuthenticationHelper. Declare the variable at class and global level as outlined below:

public static readonly string DiscoveryServiceResourceId = "https://api.office.com/discovery/";
public const string Authority = "https://login.windows.net/common";
public static readonly Uri DiscoveryServiceEndpointUri =
new Uri("https://api.office.com/discovery/v1.0/me/");
public static Uri returnUri = new Uri("http://Xam-O365-Integration");
public static string clientId = "32088804-9284-451f-9ee6-2b70507a99cf";
public static AuthenticationContext authContext = null;

Step 3c: Write method to acquire AccessToken

Using ADAL, this app will fetch the Access Token from AD, as shown below. In this method, the second parameter will depend on the platform on which the code is executing. For example, in Android an Activity is passed, but on iOS and Windows Phone the second parameter is not required.

public static async Task<AuthenticationResult> GetAccessToken (string serviceResourceId, Activity activity)
   authContext = new AuthenticationContext(Authority);
   if (authContext.TokenCache.ReadItems().Count() > 0)
      authContext = new AuthenticationContext(authContext.TokenCache.ReadItems().First().Authority);
      var authResult = await authContext.AcquireTokenAsync(serviceResourceId, clientId, returnUri, new AuthorizationParameters(activity));
   return authResult;

Step 3d: Create DiscoveryClient

Discovery Service helps find Service Endpoints. Create a new method GetDocumentsList(), which will create DiscoveryClient for further use.

List<string> fileNames = new List<string>();
DiscoveryClient discoveryClient = new DiscoveryClient(
async () =>
var authResult = await AuthenticationHelper.GetAccessToken(AuthenticationHelper.DiscoveryServiceResourceId, this);
return authResult.AccessToken; });
var appCapabilities = await discoveryClient.DiscoverCapabilitiesAsync();
var myFilesCapability = appCapabilities.Where(s => s.Key == "MyFiles")
    .Select(p =>; new { Key = p.Key,
    ServiceResourceId = p.Value.ServiceResourceId,
    ServiceEndPointUri = p.Value.ServiceEndpointUri })

Step 3e: Create SharePointClient

Files in OneDrive or Lists from SharePoint in O365 can be accessed using SharePointClient. This object again encapsulates REST services provided by O365.

if (myFilesCapability != null)
SharePointClient myFilesClient = new SharePointClient(myFilesCapability.ServiceEndPointUri,
async () =>
var authResult = await AuthenticationHelper.GetAccessToken(myFilesCapability.ServiceResourceId, this);
 return authResult.AccessToken;
var myFilesResult = await myFilesClient.Files.ExecuteAsync();
var myFiles = myFilesResult.CurrentPage;
foreach (var myFile in myFiles)
myFilesResult = await myFilesResult.GetNextPageAsync();
} while (myFilesResult != null);

Step 3f: List files

By default, MainActivity is derived from Activity. Change this behavior to derive from ListActivity to display a list in the app.

Just after the above code, create an adapter and use it to show the list of documents.

this.ListAdapter = new ArrayAdapter(this,

Last, call this ‘fat’ GetDocumentsList method from the OnCreate method and run the app. It should show the following result, listing files from your OneDrive account.


Now you’ve got a fantastic foundation to build multi-tenant, intranet, integrated mobile apps using Office 365. Office 365 has a huge number of features which we’ll be highlighting in future guides and samples apps.

If you’re interested in exploring a sample project, you can download a copy of the source code from this blog post on GitHub and discuss this topic in forums.




The post Add Storage to Your Apps with Office 365 appeared first on Xamarin Blog.

March 24

The So Very Many Games of GDC 2015

While GDC is a big show with a lot of big game development news and interesting talks, it’s also become a show where a ton of games, especially from independent studios, have a chance to shine. There were a LOT of games made with Unity at and around the show this year. We’ve been trying to compile a list of what we saw during GDC and right now we’re now counting over 140 (!!!!) titles. Holy moly!

This includes everything we saw (that we can talk about) that were part of a booth (GDC Play, IGF, Alt.Ctrl.GDC, Indie Megabooth, Valve, Microsoft, etc.), at an outside event like Mix, or even that we just happened to see at the show from a dev in the hallway. The wild thing is that this list likely isn’t complete as we didn’t manage to hit all of the booths.

We’ve listed them alphabetically so give them a look and if you know of any other Unity made games at GDC that you don’t see on the list, let us know and we’ll add them in!!

Aer by Forgotten Key Afro Samurai 2 by Redacted Games Amikrog by Pencil Test Anarcute by Anarteam a•part•ment by Robyn Gray and Richard Emms Armello from League of Geeks Armed and Gelatinous by Three Flip Studios Bedlam by Redbedlam Beyond Eyes by Tiger Squad Blues and Bullets by A Crowd of Monsters Book of Fate by Nigel E Randall Cadence by Made with Monster Love Captain Forever Remix by Pixelsaurus Chem Caper by Ace Edventure Clockwork by Gamesoft Pty Cloud Chasers by Blindflug Clusterpuck 99 by PHL Collective Crossy Road by Hipster Whale Cuphead by Studio MDHR Deluxe Turbo Racing by Super Soul Donut Country by Ben Esposito Down the Drain by Cubicorn Games Dragon Maze by Feline Arts Dungeon League by Christopher Yabsley Dyscourse from Owlchemy Labs Earthlock: Festival of Magic by Snowcastle Games Elegy for a Dead World by Dejobaan Games else Heart.Break() by Niklas Åkerblad, Erik Svedäng, et al. Ephemerid by SuperChop Games Even the Stars by Pol Clarissou Fabric by Patchwork Game Studios Fallen: A2P Protocol by Red Katana Feist by Feist Team Fight with Light by Prefrontal Cortex Fireborne by Year Seventeen Firewatch by Campo Santo Forma.8 by Mixed Bag Fox Trotte by WitchLake Studios Fruits 'n' Tails by Mukutu Game Studios FutureGrind by Milkbag Games Galak-Z by 17-bit Gang Beasts from Bone Loaf Goat Punks by Studio Canvas Graywalkers Purgatory by Dream Lords Gunsport by Necrosoft Games Guns Up! by Valkyrie Entertainment Hac by Minskworks Her Majesty's Spiffing: The Empire Staggers Back by BillyGoat Entertainment Hex Heroes by Prismatic Games Holy Potatoes! A Weapon Shop?! by Daylight Studios Home Improvisation by The Stork Burnt Down Hunger Beast by Diorama Games Jenny LeClue - Detectivú by Mografi Jetpack Squad by VAP Games Keep Talking and Nobody Explodes by Steel Crate Games Killer Queen Arcade by Josh DeBonis and Nik Mikros Kyn by Tangrin Entertainment LA Cops by Modern Dream Legacy Quest by Socialspiel Entertainment Let's Robot by Aylo Games Machineers by Lohika Games Mekazoo by Good Mood Creators Memory of a Broken Dimension by XRA Mordheim: City of the Damned by Rogue Factor Mushroom 11 by Untame MyDream by MyDream Interactive Myriad by Erland Grefsrud Nebulous by Namazu Studios Nimbatus by Micah Stettler Noomix by REDOX Game Labs No Pineapple Left Behind by Subaltern Games Omega Agent by Fireproof Games One More Line by SMG Studio Ori and the Blind Forest from Moon Studios Outer Wilds by Outer Wilds Team Overland by Finji Overpower by Overpower P.A.M.E.L.A. by NVYVE Studios Pebble by Full Circle Games Phantasmal by Eyemobi Pixel Galaxy by Serenity Forge Planet of the Eyes by Cococucumber Pollen from Mindfield Games Plug & Play by Mario von Rickenbach Progress by Ludosity Qalupalik by Pinnguaq Radial G by Tammeka Games Read Only Memories by MidBoss Redux Ark by Hyper Games Reflections by Broken Window Republique Remastered from Camouflaj RocketsRocketsRockets by Radial Games Rogue Wizards by Spellbind Studios Screencheat by Samurai Punk Seasons After the Fall by Swing Swing Sumbarine Sequenced by  Ape Labs Shadow Blade Reloaded by DeadMage Shadow Puppeteer by Sarepta Studio Shiftlings by Rock Pocket Games Siegecraft Commander by Blowfish Studios Silence by Daedalic Entertainment Skyworld by Vertigo Games Smash Cops by Hutch Games Snail Run by ENIAROF Soul Axiom by Wales Interactive Space Noir from N-Fusion Spacebro Justice Rocket by Rad Sandwich Games Spacesluggers by Rocktastic Games Spider: Rite of the Shrouded Moon by Tiger Style Star Drive 2 by Zerosum Games Starr Mazer by Imagos Softworks Stifled by Gattai Games STRAFE by Pixel Titans Super Dungeon Bros from React Games Super Slam Dunk Touchdown by Tipping Goat Sword Coast Legends by n-Space SWORDY by Frogshark That Dragon, Cancer by Ryan Green & Josh Larson The Beggar's Ride by Bad Seed The Cosmos is Mine! by PlayCorp The Flock by Vogelsap The Gallery: Six Elements by Cloudhead Games The King's Bird by Serenity Forge The Room: Archive by Fireproof Games The Room Three from Fireproof Games The Sailor's Dream by Simogo The Trace from Relentless Through the Woods by Antagonist Tilt Brush by Skillman & Hackett Tinertia by Candescent Games Toren by Swordtales Total War Battles Kingdom from Creative Assembly Train Conductor 3 by Voxel Agents Transport Empire by Game Insight Trial by Viking by Last Life Games Unkilled by Madfinger Games Unknown Radio by Anthony Kozak Vertiginous Golf by Kinelco Volume by Mike Bithell Wasteland Bar Fight by Kybernesis The Winds of Venus by Petri Autio and Robin Baumgarten Wind Up Knight 2 Wii U by Robot Invaders ZHEROS by Rimlight Studios

Here’s the same list of games, but in text!

New Development Snapshot

After debugging a stack overflow caused by a weird class loader, I decided to make the runtime more robust against this and as a side effect I added the ability to disable eager class loading. This in turn made it easier to test the late binding infrastructure (which is used when a class is not yet available while a method is compiled) and that testing revealed a large number of bugs that have now been fixed.


  • Bug fix. When -Xsave is used the modopt types should be attached to unloadable types in inherited method signatures.
  • Bug fix. Don't try to get constructor on generic instantiation containing a TypeBuilder generic parameter.
  • Use the last write time of the input file for resources read from the file system.
  • Enable UniverseOptions.DeterministicOutput for ikvmc (unless -debug option is used).
  • Copy timestamps from source files for generated files that end up in resources.jar.
  • The zip file timestamp is in local time, but for deterministic builds we don't want to depend on system timezone, so we have to store the UTC time.
  • Bug fix. Removed legacy (incorrect) array assignability check that compensated for the lack of ghost array typing. This should have been removed when ghost array tagging was introduced.
  • Bug fix. Verifier should disallow using invokeinterface on private methods.
  • The message of a VM generated java.lang.NoClassDefFoundError exception should be the class name, not the message of the underlying exception.
  • Bug fix. Don't crash if java.lang.invoke.LambdaMetafactory class is not loadable.
  • Added Unsafe.reallocateMemory() and fixed allocateMemory() to do nothing if zero length is allocated.
  • Bug fix. Return background color (instead of foreground color). Fix by Daniel Zatonyi .
  • Bug fix. Dynamically created ghost arrays should get tagged.
  • Bug fix. When catching a dynamically loaded .NET exception type the exception should not be remapped.
  • Bug fix. Bootstrap classes that use .NET types in their signatures should be accessible via MethodHandles.
  • Bug fix. Allow MethodHandle for cli.System.Object methods to work on (Java compatble) arrays to handle a hole in the type system.
  • Bug fix. Handle unloadable types in interface stub signatures.
  • Bug fix. MethodHandle and JNI should be able to set static final fields.
  • Bug fix. If a miranda method signature differs from its base class miranda method (due to unloadable types), we need to emit an override stub.
  • Bug fix. Allow value type default constructor to be invoked using MethodHandle.
  • Bug fix. Allow invokedynamic with unloadable type in signature.
  • Bug fix. Handle late-bound MethodHandle.invokeExact() with unloadable type in signature.
  • Bug fix. Late bound instanceof and castclass should behave the same as regular versions (with respect to type system holes caused by .NET types).
  • Bug fix. MethodHandle interface method lookup should support methods inherited from base interfaces.
  • Bug fix. Late bound delegate signature conversion should use explicitCastArguments instead of asType to handle varargs correctly.
  • Implemented delegate constructor invocation on existing object (to enable MethodHandle to construct a delegate).
  • Bug fix. Handle unloadable return type in native method signature.
  • Bug fix. Handle unloadable types in native method signature in JniProxyBuilder (used when -Xsave is used).
  • Bug fix. Late bound invokespecial should also be handled in local variable analysis.
  • Bug fix. Handle unloadable type in BSM extra arguments.
  • Bug fix. Verifier would incorrectly report a loader constraints violated if a field type was not unloadable, but the field ref type was unloadable.
  • Bug fix. Make sure declaring class is loadable.
  • Bug fix. Try loading unloadable declared classes instead of simply throwing a NoClassDefFoundError.
  • Bug fix. Make sure inner classes are loadable.
  • Bug fix. Disallow invokevirtual MH constant to resolve to interface method and disallow invokeinterface MH constant to resolve to non-public method.
  • Bug fix. Handle unloadable type in MH.invoke() signature.
  • Bug fix. Handle invocation of method on unloadable value type.
  • Bug fix. Handle ghost and value types in override stub signatures.
  • Added a hack to the deprecated Reflection.getCallerClass(int) version to skip LamdbaForm methods to report the right caller when dynamic binding is used.
  • Bug fix. Dynamica caller id should return host class for anonymous classes injected into host class.
  • Avoid infinite recursion if (broken) class loader triggers a load of a class currently being finished.
  • Added environment switch IKVM_DISABLE_EAGER_CLASS_LOADING to enable testing late binding.
  • IKVM.Reflection: Added CoreCLR target.
  • IKVM.Reflection: Fixed ModuleBuilder.DefineManifestResource() to support very large resources.
  • IKVM.Reflection: Added new public API ModuleBuilder.__PEHeaderTimeDateStamp property.
  • IKVM.Reflection: Added UniverseOptions.DeterministicOutput to enable deterministic output (i.e. setting the PE file header time stamp to zero and computing the module version id based on the contents, instead of using a random guid).

Binaries available here: ikvmbin-8.1.5561.zip

March 23

Android Tips: Immersive Panoramic Google Maps

Displaying a map in your app can add a lot of context for a specific location. You can also take things a step further, though, and create a fully immersive experience to help your users get where they need to be.Panorama View Control Android This can be accomplished in just a few lines of code with the Street View Panorama View control.

Previously, I covered how to use Google Maps Lite in your Xamarin.Android apps for displaying non-interactive, light-weight maps. For the Panorama View, you will go through the same setup process of adding Google Play Services to your project and settings up your Google Maps API Key. In this example, we will add more context our Coffee Filter app by adding a button to navigate to the Street View page.

Add a StreetViewPanoramaView

The first step is to add a new layout. We are going to simply fill the entire page with a StreetViewPanoramaView as we want to fully immerse our users in the street view. You can of course embed the control into an existing page and make it any size you wish.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_gravity="center" />

Setting up the Activity

Similar to using Google Maps, we will need to implement a callback, IOnStreetViewPanoramaReadyCallback, in our Activity and initialize our StreetViewPanorama.

public class PanoramaActivity : ActionBarActivity, IOnStreetViewPanoramaReadyCallback
  StreetViewPanoramaView streetViewPanoramaView;
  StreetViewPanorama streetPanorama;
  LatLng latlng;
  protected override void OnCreate (Bundle bundle)
    base.OnCreate (bundle);
    SetContentView (Resource.Layout.panorama);
    //pass in lat/lng from parent activity
    var lat = Intent.GetDoubleExtra ("lat", 37.7977);
    var lng = Intent.GetDoubleExtra ("lng", -122.40);
    //create LatLng to display
    latlng = new LatLng (lat, lng);
    //find our panorama view and create async.
    streetViewPanoramaView = FindViewById<StreetViewPanoramaView> (Resource.Id.panorama);
    streetViewPanoramaView.OnCreate (bundle);
    streetViewPanoramaView.GetStreetViewPanoramaAsync (this);

The IOnStreetViewPanoramaReadyCallback interface has one method to implement OnStreetViewPanoramaReady. This will pass your StreetViewPanorama that you use to set certain properties and set the position to display. We will turn on just about every feature, and set the position to the position that was passed in from the parent activity.

public void OnStreetViewPanoramaReady (StreetViewPanorama panorama)
  this.streetPanorama = panorama;
  streetPanorama.UserNavigationEnabled = true;
  streetPanorama.StreetNamesEnabled = true;
  streetPanorama.PanningGesturesEnabled = true;
  streetPanorama.ZoomGesturesEnabled = true;
  streetPanorama.SetPosition (latlng);

In addition to this, it’s best practice to override OnResume, OnPause, OnDestroy, OnLowMemory, and OnSaveInstanceState in your Activity and call the matching methods on your StreetViewPanoramaView control. If you don’t want to wire the lifecycle events yourself, there’s also a Fragment & SupportFragment version of the StreetViewPanorama that will handle this for you automatically.

Full Immersion

In Android KitKat, Google introduced a new API called Immersive Full-Screen mode for an Activity. This enables your app to extend all the way into the status and navigation bars on the device. To take advantage of this, you simply need to add a few lines of code in your Activity, setting the SystemUiVisibility of the DecorView.

public override void OnWindowFocusChanged (bool hasFocus)
  base.OnWindowFocusChanged (hasFocus);
  if (hasFocus && (int)Build.VERSION.SdkInt >= 19) {
    Window.DecorView.SystemUiVisibility =
        | SystemUiFlags.HideNavigation
        | SystemUiFlags.LayoutFullscreen
        | SystemUiFlags.Fullscreen
        | SystemUiFlags.ImmersiveSticky);

We now have a fully immersive, beautiful Street View Panorama View in our app!

In Motion Panorama

Learn More

To get started, be sure to download the Google Play Service component from the Component Store for your Android apps. Read through the entire Street View documentation from Google for advanced options. We also have a full sample of adding Immersive mode to your Xamarin.Android apps. You can find the full source code for this sample and Coffee Filter on my GitHub.

The post Android Tips: Immersive Panoramic Google Maps appeared first on Xamarin Blog.

.NET Beyond Windows

On November 2014 Microsoft announced their new strategy for the .NET future. The most important part of the announcement was the release of .NET Core 5 as a componentized framework that will be shipped via NuGet. The .NET Core CLR is open source, and supports Windows, Linux and Mac OS X. It's publicly available in GitHub.

March 20

Functional GUI Apps with F# at FRINGE

I’m speaking at FRINGE!

My topic is “Functional GUI Apps” in which I will try to convince you that GUIs don’t have to be tangles of state transforming events.

When I first started using F#, I immediately recognized it as a wonderful data modeling and transformation language. But I wasn’t quite sure how to write GUI apps with it.

Sure, F# supports writing object oriented code so you can build UIs just as you would in C#. But I wanted more - I wanted my UI layer to have the same elegance as my model layer.

After a few false starts, I not only found that it’s possible to do GUIs in a functional style, but that there are a lot of advantages to doing it that way. I will be presenting my findings and also the work of others that have played in this fun world.

Mea Culpa: Dedicated readers will note that I whined a lot about not getting to speak at FRINGE just a couple days ago. Why this change of news? One simple answer: I’m terrible at email. Yes, my talk got accepted and, through my own cleverness, I never saw the acceptance letter. Some days… some days…

Code Review: Microsoft's System.Net.Mail Implementation

For those reading my blog for the first time and don't know who I am, allow myself to introduce... myself.

I'm a self-proclaimed expert on the topic of email, specifically MIME, IMAP, SMTP, and POP3. I don't proclaim myself to be an expert on much, but email is something that maybe 1 or 2 dozen people in the world could probably get away with saying they know more than I do and actually back it up. I've got a lot of experience writing email software over the past 15 years and rarely do I come across mail software that does things better than I've done them. I'm also a critic of mail software design and implementation.

My latest endeavors in the email space are MimeKit and MailKit, both of which are open source and available on GitHub for your perusal should you doubt my expertise.

My point is: I think my review carries some weight, or I wouldn't be writing this.

Is that egotistical of me? Maybe a little.

I was actually just fixing a bug in MimeKit earlier and when I went to go examine Mono's System.Net.Mail.MailMessage implementation in order to figure out what the problem was with my System.Net.Mail.MailMessage to MimeKit.MimeMessage conversion, I thought, "hey, wait a minute... didn't Microsoft just recently release their BCL source code?" So I ended up taking a look and pretty quickly confirmed my suspicions and was able to fix the bug.

When I begin looking at the source code for another mail library, I can't help but critique what I find.

MailAddress and MailAddressCollection

Parsing email addresses is probably the hardest thing to get right. It's what I would say makes or breaks a library (literally). To a casual onlooker, parsing email addresses probably seems like a trivial problem. "Just String.Split() on comma and then look for those angle bracket thingies and you're done, right?" Oh God, oh God, make the hurting stop. I need to stop here before I go into a long rant about this...

Okay, I'm back. Blood pressure has subsided.

Looking at MailAddressParser.cs (the internal parser used by MailAddressCollection), I'm actually pleasantly surprised. It actually looks pretty decent and I can tell that a lot of thought and care went into it. They actually use a tokenizer approach. Interestingly, they parse the string in reverse which is a pretty good idea, I must say. This approach probably helps simplify the parser logic a bit because parsing forward makes it difficult to know what the tokens belong to (is it the name token? or is it the local-part of an addr-spec? hard to know until I consume a few more tokens...).

For example, consider the following BNF grammar:

address         =       mailbox / group
mailbox         =       name-addr / addr-spec
name-addr       =       [display-name] angle-addr
angle-addr      =       [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
group           =       display-name ":" [mailbox-list / CFWS] ";"
display-name    =       phrase
word            =       atom / quoted-string
phrase          =       1*word / obs-phrase
addr-spec       =       local-part "@" domain
local-part      =       dot-atom / quoted-string / obs-local-part
domain          =       dot-atom / domain-literal / obs-domain
obs-local-part  =       word *("." word)

Now consider the following email address: "Joe Example" <joe@example.com>

The first token you read will be "Joe Example" and you might think that that token indicates that it is the display name, but it doesn't. All you know is that you've got a 'quoted-string' token. A 'quoted-string' can be part of a 'phrase' or it can be (a part of) the 'local-part' of the address itself. You must read at least 1 more token before you'll be able to figure out what it actually is ('obs-local-part' makes things slightly more difficult). In this case, you'll get a '<' which indicates the start of an 'angle-addr', allowing you to assume that the 'quoted-string' you just got is indeed the 'display-name'.

If, however, you parse the address in reverse, things become a little simpler because you know immediately what to expect the next token to be a part of.

That's pretty cool. Kudos to the Microsoft engineers for thinking up this strategy.

Unfortunately, the parser does not handle the 'group' address type. I'll let this slide, however, partly because I'm still impressed by the approach the address parser took and also because I realize that System.Net.Mail is meant for creating and sending new messages, not parsing existing messages from the wild.

Okay, so how well does it serialize MailAddress?

Ugh. You know that face you make when you just see a guy get kicked in the nuts? Yea, that's the face I made when I saw line #227:

encodedAddress = String.Format(CultureInfo.InvariantCulture, "\"{0}\"", this.displayName);

The problem with the above code (and I'll soon be submitting a bug report about this) is that the displayName string might have embedded double quotes in it. You can't just surround it with quotes and expect it to work. This is the same mistake all those programmers make that allow SQL-injection attacks.

For an example of how this should be done, see MimeKit's MimeUtils.Quote() method.

I had such high hopes... at least this is a fairly simple bug to fix. I'll probably just offer them a patch.

ContentType and ContentDisposition

Their parser is decent but it doesn't handle rfc2231 encoded parameter values, so I'm not overly impressed. It'll get the job done for simple name="value" parameter syntax, though, and it will decode the values encoded with the rfc2047 encoding scheme (which is not the right way to encode values, but it is common enough that any serious parser should handle it). The code is also pretty clean and uses a tokenizer approach, so that's a plus. I guess since this isn't really meant as a full-blown MIME parser, they can get away with this and not have it be a big deal. Fair enough.

Serialization, unsurprisingly, leaves a lot to be desired. Parameter values are, as I expected, encoded using rfc2047 syntax rather than the IETF standard rfc2231 syntax. I suppose that you could argue that this is for compatibility, but really it's just perpetuating bad practices. It also means that it can't properly fold long parameter values because the encoded value just becomes one big long encoded-word token. Yuck.


Amusingly, Microsoft does not use their Convert.FromBase64() decoder to decode base64 in their System.Net.Mail implementation. I point this out mostly because it is the single most common problem users have with every one of the Open Source .NET mail libraries out there (other than MimeKit, of course) because Convert.FromBase64() relies on the data not having any line breaks, white space, etc in the input stream.

This should serve as a big hint to you guys writing your own .NET email libraries not to use Convert.FromBase64() ;-)

They use unsafe pointers, just like I do in MimeKit, but I'm not sure how their performance compares to MimeKit's yet. They do use a state machine, though, so rock on.

I approve this base64 encoder/decoder implementation.


One thing they do which is pretty cool is connection pooling. This is probably a pretty decent win for the types of things developers usually use System.Net.Mail's SmtpClient for (spam, anyone?).

The SASL AUTH mechanisms that they seem to support are NTLM, GSSAPI, LOGIN and WDIGEST (which apparently is some sort of IIS-specific authentication mechanism that I had never heard of until now). For those that were curious which SASL mechanisms SmtpClient supported, well, now you know.

The code is a bit hard to follow for someone not familiar with the codebase (not nearly as easy reading as the address or content-type parsers, I'm afraid), but it seems fairly well designed.

It does not appear to support PIPELINING or BINARYMIME like MailKit does, though. So, yay! Win for MailKit ;-)

They do support SMTPUTF8, so that's good.

It seems that if you set client.EnableSsl to true, it will also try STARTTLS if it isn't able to connect on the SSL port. I wasn't sure if it did that or not before, so this was something I was personally interested in knowing.

Hopefully my SmtpClient implementation review isn't too disappointing. I just don't know what to say about it, really. It's a pretty straight-forward send-command-wait-for-reply implementation and SMTP is pretty dead simple.


Overall the bits I was interested in were better than I expected they'd be. The parsers were pretty good (although incomplete) and the serializers were "good enough" for normal use.

Of course, it's not as good as MimeKit, but let's be honest, MimeKit sets the bar pretty high ;-)

March 19

Exciting Xamarin Announcements from dotnetConf

Miguel and I just had the honor of helping kick off day two of dotnetConf, along with our good friend Scott Hanselman. dotnetconf logo
dotnetConf is a two-day virtual event, dedicated to all things .NET and to highlighting our vibrant developer community. We had a few exciting announcements to share with everyone, which you can watch for yourself in the recording below, or read about in the summary that follows.

Xamarin.Forms for Windows Preview

Xamarin.Forms for Windows Store

We launched Xamarin.Forms a year ago, enabling developers to rapidly create native applications for iOS, Android, and Windows Phone from a single shared C# code base. One of our most popular samples from that launch is an app dedicated to all things Scott Hanselman – aptly named Hanselman.Forms.

For today’s intro with Scott, I couldn’t resist taking the opportunity to re-launch Hanselman.Forms with podcast streaming and a few new bells and whistles showing off the latest features available in Xamarin.Forms, such as pull-to-refresh. But the fun didn’t stop there, as we capped off the demo with the exciting announcement of our preview support for building for Windows Store and Phone RT when developing with Xamarin.Forms.

Hanselman.Forms on All Devices

Xamarin.Forms for Windows Preview is available now on NuGet as a pre-release package. This is a very early preview that we’re making publicly available to get as much feedback as possible from the community as we stabilize our Windows support over the next few months. To get started, simply add a new Windows Store app to your existing solution and with a few lines of initialization code and you are on your way. We have full documentation for this preview available on our developer portal, and you can download and run the source for Hanselman.Forms straight from GitHub.

Xamarin Everywhere

The theme of today’s talk was “.NET deserves to be everywhere”, so in addition to extending the Hanselman app to Windows Store, I also took the opportunity to update it with support for wearable platforms, because I know that everyone wants mission-critical Hanselman updates on their wrist. Now, you will find a brand new Android Wear and Apple Watch app as part of the Hanselman.Forms project with plenty of awesome shared C# code, and you can start building your own wearable apps today with WatchKit in Xamarin.iOS, or by referencing the Android Wear Component or NuGet in your Xamarin.Android projects.


Xamarin Subscriptions for OSS Contributors

We love the .NET community and are dedicated to supporting the huge community of .NET developers working on powerful NuGets like PCLStorage, SQLiteNet and other plugins for Xamarin and Windows.

Xamarin Heart OSS

To ensure that all open source projects have everything they need to succeed, today we also announced the expansion of our our support for OSS developers to include free Xamarin subscriptions with support for Visual Studio. Any open source developers with app store compatible licenses receive non-commercial Xamarin subscriptions for the purpose of developing, testing and maintaining compatibility with the Xamarin platform. Active developers on established open source projects can apply now.

The post Exciting Xamarin Announcements from dotnetConf appeared first on Xamarin Blog.

Amsterdam here we come! Call for speakers for Unite Europe 2015

Our Unite conference is coming this year to Europe to one of our favourite locations, the Westergasfabriek in Amsterdam and we would like to invite you to present a topic for a talk at the show.  Held on June 24th and 25th this is a great chance to meet with the Unity team and to compare notes with the rest of our amazing community.  Details of the event are available here:


If you have worked on some unique tools, wrestled with technical challenges or shipped some cool projects using Unity then this is your chance to share your experiences with the world.   Talks can be either 30 or 60 minutes long and our speakers receive VIP treatment at the conference.

Check out the guidelines on how to submit a talk and the type of presentations we are looking for.

One category of talks we are reintroducing this year are the “Unity in the Wild” sessions.  These would be shorter presentations of 15 – 20 minutes that would be combined into a longer talk about using Unity in non-game applications.  In the past these have been about art installations, archeology, data visualisation and using Unity to train FBI agents at crime scenes.  We will give some more details in a subsequent blog post but please give these some thought.  It never fails to amaze me what our community can produce.

The call for presentations is now open and you have until April 25th to submit your talk.

Thanks and we look forward to seeing you in Amsterdam in June!

Andy Brammall

Microsoft Band SDK + Xamarin

Band-fans were happy to see Microsoft release their Java Android SDK for Microsoft Band a few weeks ago, and their Objective-C iOS SDK this week. Xamarin was then able to almost immediately release the Microsoft Band SDK component for iOS and Android, giving you the same functionality but entirely in C# for all three mobile platforms...

I decided to give it a try, converting my "magic eight ball" apps for Xamarin.Forms and Apple Watch to the Band. The idea is: you shake your wrist and the "prediction" appears on the Band!

It works because there is an Android app running on the paired phone, using the Band SDK. The app is tracking the Band's accelerometer, and using the readings to decide when you've shaken your wrist a couple of times.

When the shake-detection is triggered, the app picks a random number, pushes a new Tile onto the Band (if it doesn't already exist), and then sends a message for the tile with a random "prediction".

The Android app is simple, it contains only a Connect button to connect to the Band, and a Vibrate button to test the connection (plus a label that displays the "prediction" text that is sent to the Band).

The code for this Android sample is available on github, hopefully I'll get the iOS version running soon.

If you want to get more info about developing for the Band, check out Matt's detailed blogpost with code.

Finally, Microsoft built a quite detailed Android app that demonstrates all aspects of their SDK, and Matt did an amazing job of porting it to Xamarin - check that out too!

March 18

Microsoft Band SDK Now Available

Microsoft just announced iOS support for their recently released Microsoft Band SDK. The iOS preview joins their preview support for Android and Windows Phone, and we’re delighted to announce that within 24 hours of release, we’ve made these SDKs available to Xamarin developers on iOS and Android, too. Microsoft Band

The Band is very much designed for health and fitness with its many sensors, but it is not limited to health uses. Because we have access to the sensors and can interact with the device, we can use the Band to enhance and extend any mobile app.

There are 4 main ways we can interact with the Band:

  1. Reading information from the Sensors
  2. Creating themed app Tiles
  3. Sending Messages to the Band
  4. Theming and Personalizing the Band

To interact with a Band from your app, install the SDK and add the code to create a connection with a Band. The user will need the Microsoft Health app installed, and have paired their Band with their phone.

Once connected you can communicate with the Band easily using C# in your iOS and Android apps. The APIs allow you read from the various Band sensors, send messages that appear on the band while it’s connected, and much more.

Getting Started

To start building Band apps with Xamarin today, add the Microsoft Band SDK Component to your iOS or Android project, check out the component documentation and my samples for iOS and Android to learn how to connect and read sensor data.

Discuss this blog post in the Xamarin Forums.

The post Microsoft Band SDK Now Available appeared first on Xamarin Blog.

March 17

Hey Developers, You’re Awesome

Man it’s been a great couple of weeks for Unity and many of you in the community. We launched Unity 5, announced some great changes to our pricing, found out that Crossy Road‘s success is accelerating with the help of Unity Ads, and we met a ton of developers at GDC making some amazing games! We’ll have a post about all of those games soon.

Three games have now been released using Unity 5. First Republique Remastered came out and showed just how far the engine has come from the previous version. You can read more about that in our series of blog posts, videos, and podcasts from the guys at Camouflaj. Last week we also saw the release of Ori and the Blind Forest, an incredibly beautiful 2D game from Moon Studios and Microsoft for Xbox One and PC in addition to Cities: Skylines, an impressive city-builder from Colossal Order and Paradox for PC, Mac and Linux. Both of those games are getting a lot of praise heaped on top of them and for good reason. On top of just being great in a general sense, these  games are great examples of the breadth of projects that can be made in Unity and we’re very proud to see them out in the wild doing so well.

Ori and the Blind Forest from Moon Studios

Ori and the Blind Forest from Moon Studios

BAFTA Awards winners were also announced last week and we’re all excited to see that developers from the Unity community received recognition for their awesome talent and as you may or may not know, many more were nominated.

Monument Valley, having already won several awards recently including Apple’s App of the Year award, continued it’s incredible push by scoring nominations for Artistic Achievement, Best Game, Best Original Property, and winning BAFTA’s Best British Game and Best Mobile & Handheld awards.

Upper One Games was nominated for Best Story and was awarded Best Debut Game for their work on the beautiful and heartfelt game Never Alone that was inspired by Iñupiat history and mythology.

Blizzard Entertainment’s Hearthstone: Heroes of Warcraft, one of the most stupidly addictive games in recent years, continued it’s great success for the year with nominations for Best Mobile & Handheld Game and Best Game Design while pulling in the award for Best Multiplayer.

Finally, Overly Kinetic brought home the Ones to Watch award for their stylized Samurai Jack-inspired stealth split screen multiplayer game Chambara. While I haven’t had the chance to play this one yet, it looks incredible.

Monument Valley Hearthstone: Heroes of Warcraft Never Alone Chambara

Additionally nominated for awards were:

That’s 12 Unity-authored games that accounted for 22 nominations and 4 wins! Incredible!

At SXSW, Hearthstone: Heroes of Warcraft picked up yet another award for Mobile Game of the Year. Also nominated at that show were Monument Valley (Mobile Game of the Year, Excellence in Art, Excellence in Visual Achievement), Threes! (Mobile Game of the Year), and Wasteland 2 from inXile (Most Anticipated Crowdfunding Game).

There’s also a bunch of Unity-authored games at SXSW competing for the Gamer’s Voice award. If you’re at the show, make sure to go check them out!

So thank you all for your amazing work! Knowing that all of you are out there creating these games makes us that much more excited to keep moving Unity onward and upward.

Excited for FRINGE

It’s been too long since we’ve had an open source .NET conference. Since monospace/monkeyspace imploded, we’ve been left with just Xamarin’s Evolve. And while I love Xamarin, and Evolve is glorious, it’s just not the same thing as the free-wheeling brain fest of an OS conference. Only at an open source conference do I get to see free thinkers unabashedly demo’ing their latest library or idea without having to bend it to a corporate initiative. It’s liberating and exciting!

Thankfully, FRINGE is bringing back open source .NET conferences - and it’s doing a hell of a job of it. I love everything about it. I love their web site and the use of pink. I love writing it in all caps.  I love the people organizing it. I love the people who are going. I love the city it’s being held in. I want to retire and just attend FRINGE professionally for the rest of my life.

So go get a ticket and get your bum over to Portland - and bring your best ideas.

Sad about FRINGE Even More Excited for FRINGE

On a personal note, I’m a bit sad that I won’t get to speak at FRINGE. I will be speaking! Since deciding to become an active member of the .NET community (introverts such as myself make such decisions solemnly) I have gotten to speak at the mono and monkeyspaces every year.

It’s a tiring thing being a speaker. You have to do an enormous amount of preparation at home, then, at the conference, you can’t relax until your presentation is over. All that stress, and then your work disappears into the ether 45 mins after you begin (you pray, gods willing, that someone, somehow, remembers a word of what you said - that all that effort was not for nought).

But I love to present. I love to lecture. My friends will often yell, “stop lecturing me!” Little do they know that I’m just practicing for conferences - that I’m annoying them for the greater good of the .NET community.

Part of this comes from my philosophy of knowledge: You haven’t learned something until you can code it (explain it to a computer), and you don’t understand it until you can teach it (explain it to a human). Presenting gives me an excuse to intensely study - to interrogate and hopefully verify - my own knowledge and then communicate the findings. It’s like crack for someone like me.

Withdrawing from an addiction is a painful process.

Personal reflection is in order I suppose. I suppose the topic I proposed “using functional programming to create user interfaces” - while an incredibly timely and sexy topic (note libraries like React, note how kahn academy is writing their apps) in my mind, just didn’t resonate with the organizers. Perhaps my description sucked. Perhaps the other talks are more timely and more thought provoking. Or it could simply be I’m overthinking things and I should get back to work. Probably that last one. I’m an idiot.

See you at FRINGE!

Kick Off Build 2015 with Xamarin!

Xamarin Build 2015Kick off Build 2015 with a bang! Join us on Tuesday, April 28th, 2015 at Jillian’s Sports Bar & Billiards Hall, right across the street from the Moscone Center at 175 4th Street from 7:00-10:00pm.

Win a Xamarin “Go Mobile” Developer Rig and More

To celebrate having thousands of C#-loving (and F#-loving) developers in San Francisco at the same time for Build 2015, we are making sure everyone walks away from the party with something incredible:

  • Meet Charles Petzold and have him autograph your very own copy of his “Creating Mobile Apps with Xamarin.Forms” book.
  • Be one of the first in the world to sport a newly designed Xamarin T-shirt.
  • Wear the new Xamarin T-shirt to Day 1 of Build and you’ll be eligible for one of three Xamarin “Go Mobile” Developer Rigs. Valued at over $10k (USD), the rigs include your choice of laptop or desktop pre-configured with Xamarin subscriptions, iOS and Android devices, and more!

Enter your email address below and tweet your RSVP on the next screen and we’ll see you at Build!


The post Kick Off Build 2015 with Xamarin! appeared first on Xamarin Blog.

How do you upgrade your distro? A tale of two workarounds

Every classic Linuxer would know why it's very handy to dedicate a separate partition for the /home folder of your tree: you could in theory share it between multiple OSs that you installed in your box (which you choose to run when you start your computer).

Now, I'm guessing that many people reading and nodding to the above, will also know that sharing /home/ is one thing, sharing $HOME (/home/yourUserName) is a completely different beast.

For example: you have a stable distro installed in your box; you decide to install a new version of that distro along the old one, in the same box. You run the new distro with a new account tied to the old /home/yourUserName folder: KABOOM!!! Weird things start happening. Among these:

  • The newer versions of your desktop or desktop programs don't run properly with the settings saved in your .dotDirectories (they are to blame because they didn't probably have a settings-conversion feature).
  • The newer versions of your desktop or desktop programs have a buggy settings-conversion feature; because your program does not run properly, or as well as it would have run if it had been ran for the first time with no settings saved at all.
  • The newer versions of your non-buggy desktop or desktop programs convert your settings to a new format. Then when you go back and run your old distro again, your old-versioned programs stop working because they see settings in a new format which they don't understand. (This is impossible to fix, or very hard.) It's very important that this scenario works, because the migration to the new version of your distro may not be immediate, it may take you some days to figure everything out, and until that happens, you want to still be able to run the stable version of your desktop and desktop programs
  • Etc.

To workaround these problems, I have a strategy: I use a different /home/ sub-directory for each distro installed in my system. For example, for distro X version A.B I use /home/knocteXAB/, for distro Y version C.D I use /home/knocteYCD/. The advantage about this is that you can migrate your settings manually and at your own pace. But then, you may be asking, how to really take advantage of sharing the /home folder when using this technique?

Easy: I keep non-settings data (mainly the non-dotfiles) in a different /home/ folder with no associated account in any of the distros. For example: /home/knocte/ (no version suffix). Then, from each of the suffixed /home/ subfolders, I setup symlinks to this other folder, setting the appropriate permissions. For instance:

  • /home/knocteXAB/Music -> /home/knocte/Music
  • /home/knocteXAB/Documents -> /home/knocte/Documents
  • /home/knocteYCD/Music -> /home/knocte/Music
  • /home/knocteYCD/Documents -> /home/knocte/Documents
  • Etc.
You may think that it's an interesting strategy and that I'm done with the blog post, however, when using this strategy you may start finding buggy applications that don't deal very well with symlinked paths. The one I found which annoyed the most was my favourite Gnome IDE, because it meant I couldn't develop software without problems. I mean, they were not just cosmetic problems, really:

So I had to use a workaround for my workaround: clone all my projects in $HOME instead of /home/knocte/Documents/Code/OpenSource/ (yah, I'm this organized ;) ).

I've been trying to fix these problems for a while, without much time on my hands.

But the last weeks a magical thing happened: I decided to finally sit down and try to fix the last two remaining, and my patches were all accepted and merged last week! (at least all the ones fixing symlink-related problems), woo!!!

So the lessons to learn here are:

  • Even the slickest workarounds have problems. Try to fix or report settings-conversion bugs!!
  • Don't ever quit trying to fix a problem. Some day you'll have the solution and you will realize it was simpler than you thought.
  • realpath is your friend.
  • MonoDevelop (master branch) is now less buggy and as amazing as (or more than) ever (</PUBLIC_SERVICE_ANNOUNCEMENT>).

NGraphics in a Xamarin Sketch

Frank Krueger published a new open source graphics library called NGraphics today. As with everything Frank does it looks pretty awesome. It even has its own editor where you can type in code and live preview the output. So you probably won’t need what I’m about to show you, but I was curious if it would work with Xamarin Sketches (just for kicks).

Sure enough, all I had to do was add LoadAssembly calls to reference NGraphics assemblies in the sketch and add the assemblies to the sketchname.sketchcs.Resources folder alongside the sketchcs file. Then, since Frank includes methods to return native image types, such as NSImage on Mac, I can leverage the sketch visualizers in Xamarin Studio to get a live preview.

Here’s Frank’s sample code to draw a house in a sketch:


March 16

The Channel 9 Xamarin Invasion Advances

A little over one year ago we started our Channel 9 Invasion and, in the short time since then, videos featuring Xamarins have reached over half a million views! channel 9 logoWe started with features on popular Channel 9 shows Visual Studio Toolbox and DevRadio and then advanced to major conferences such as Build, TechEd Europe, and dotNetConf.

We’re kicking off 2015 with a bang with brand new episodes for your enjoyment. I had the honor of joining Robert Green again, expanding our four part series into an eight part series on Visual Studio Toolbox. Part 5 focuses on how you can leverage your C# and XAML skills to build cross-platform native mobile apps with Xamarin.Forms.

Part 6 goes in a different direction and focuses on how to use the Xamarin Designer for iOS inside of Visual Studio to craft beautiful iOS user interfaces.

If you missed any of last year’s episodes of Visual Studio Toolbox, you can catch up at the links below:
visual studio toolbox

Be sure to follow Channel 9, Robert Green, and of course Xamarin on Twitter for even more great episodes coming soon.

The post The Channel 9 Xamarin Invasion Advances appeared first on Xamarin Blog.

Introducing NGraphics

Many moons ago I created a cross platform library for rendering vector graphics called CrossGraphics. It was good. It supported lots of platforms and was fast. Very fast in fact because it was designed for my app iCircuit which was already a CPU hog and had to run on 2010 era mobile hardware. To be fast, I played loosey goosey with cross platform accuracy (they mostly rendered the same) and features (who needs gradients?).

But the times, they are a changin’. My phone’s CPU is 64-bits and massive. Apple now supports GPU based rendering (finally that G stands for something other than Triangle). And, the fact is, though flat is in style, you really do need gradients.


Today, I would like to announce NGraphics. A cross platform PCL to satisfy your 2D vector drawing needs. It’s available on nuget now!

NGraphics is a big improvement over CrossGraphics. Here’s why I’m excited:

Platforms! NGraphics comes out of the box supporting iOS, OS X, Android, and Windows.

Gradients! It supports both the linear and radial variety with any number of color stops.

Paths! Crazy paths with arcs can now be used and abused.

Images! Images can be loaded from streams, created by rendering onto a canvas, or built up pixel by pixel.

SVG Reading and Writing! CrossGraphics was able to output SVG, but NGraphics can read ‘em too.

Retained Mode and Immediate Mode! NGraphics supports both immediate mode rendering with canvases (DrawLine, FillPath, etc.) along with a retained mode graphics model (Path, Rectangle, Ellipse, …). This makes caching and serialization easy.

Unit Tests! It turns out that getting all the platforms to behave themselves requires more than blind faith. NGraphics has a unit test suite that runs on all the platforms (4) and generates images to easily spot consistency errors.

Editor! I love to use code to draw things, but I hate waiting for the compiler (or worse, the IDE). So I wrote a little editor that lets you type C# code and get a live preview of the graphic you are creating. I love this thing…


I hope you’ll check out NGraphics! It’s as simple as going to NuGet and searching for “NGraphics”. If you have the time, I would love bug reports, feature requests, and especially pull requests over at the NGraphics project.

Apply Now for Summer of Code 2015!

Student applications are now open for the Mono Project in the 2015 Google Summer of Code!

Our Mono Summer of Code 2015 announcement post has a lot of useful information and links to help get involved in our community and put together a good proposal. Remember in your proposal to show us how passionate you are about building great tools and frameworks, and demonstrate that you're able to research and develop things independently but also know when to ask smart questions.

We strongly recommend that you submit your application early. The deadline is March 27 at 19:00 UTC and late applications cannot be accepted for any reason. You can update your application and answer our questions after you submit it, so don't delay.

If you have any questions about the Mono Project in Google Summer of Code that are not answered by our GSoC page or in the #monosoc IRC or mono mailing list, please email soc@xamarin.com. Good luck!

Getting Started in Unity 5.0

Now that Unity 5.0 is here, many of you have been asking what is actually in Unity 5.0 and how best to learn it. We have a few ways of getting up to speed with our new features, and some sample and demo content that will get you 5’ing in no time. Let’s dive in!

Unity 5.0 Tutorials

Our Online Content Team has been busy creating a series of tutorials to get you up to speed with the headline features of Unity 5, so over in the Learn area, you’ll find a new series of videos for everyone to learn about Graphics, Audio and Animation, with more to follow in our scheduled Live Training sessions, where our twitch heroes Adam and Matt will be spending time with you to let you know about other features and answer your burning questions!

Tutorials for Unity 5.0


Live Training Sessions


We are also working to recreate our classic Roll-a-Ball tutorial series for total beginners to be aligned with Unity 5 so beginners get a good introduction.

Unity Labs


Those of you lucky enough to attend this year’s GDC will have witnessed our new interactive demo project Unity Labs. Home to the illustrious Dr Charles Francis (pictured above), Unity labs is our latest large project to help you understand the usage of many of Unity 5’s new features. It makes use of –

  • Enlighten Global Illumination
  • Standard shader
  • Audio Mixer
  • State machine behaviours
  • Custom skin and hair shading

We aim to ship this to you by the end of March to the asset store for you all to enjoy, and will keep you posted on when it’s live to download. This demo was shown at GDC on PC, Mac, Xbox One and Playstation 4. For more information on Unity labs and some of the other 5.0 features, see our Talking Tech video below.

Learning Physically-based Shading

For those interested in the art side of Unity development, you’ll likely know that Unity 5.0 ships with what we call the Standard Shader. The Standard Shader is a physically based shader designed to equip you with a single shader for 95% of the use cases in your games. To help you learn this there’s 3 main things you should do first –

1. Watch the tutorial! Read the docs! Check out the blog!

Docs page about the standard shader.

Blog post about physically based shading and how it works.

2. Download the Viking Village

Want to see how our internal teams are using the Standard Shader? grab the Viking Village now from the asset store.

3. Download the Shader Calibration Scene


This small test scene is setup for you to import your assets and try out the standard shader. It comes complete with an array of pre-built configurations of the shader, as well as a test scene with a variety of options for testing. Download it now!

Learn more!


Once you’ve done these, check out some of the content the community is building and sharing, such as this awesome guide to PBR from the guys at Allegorithmic.

Use the all-new Standard Assets


In Unity 5.0 we rebuilt Unity’s Standard Assets from scratch. For those unfamiliar, Standard Assets are our set of tools and prefabs for you to use as a building block in creating your game or even just to get you kickstarted in prototyping. So if you need an First or Third Person controller, a Car, a Plane or 2D character, look no further. We also include useful tools like Touch control setups.

You can grab the new assets from the Unity 5 installer, but if you didn’t grab them then, or you want to make sure you have the latest version, grab the assets from the Asset store.

Note: For anyone using this in beta, we referred to them as ‘Sample Assets’ – note this is simply a change of name – we returned to Standard Assets to ensure totally backwards compatibility. So if you’ve used these in beta when they were called Sample Assets, please update to the latest Standard assets and continue to use them. Thanks to Ray in the comments for raising this. At the time of writing there is no difference between the downloaded install version of SA and the version on the Asset store, but from time to time we may push fixes to the store outside of release / patch releases.

What else would you like to see from Standard Assets? we have more plans but would love to hear from you!


As of Unity 5.0 we’ve made a few changes to the scripting API to tidy things up, add new features and encourage best practices. One important thing we’d like to highlight is deprecation of some of our previous ‘Shortcut’ aspects of the API. In the past, you’ve been able to use for example –


Referring to the Audio Source component directly by using the term ‘audio’. Behind the scenes this was simply utilising a GetComponent(); command, and this is what our auto updater will replace it with. However if you are using this more than once in a script, be sure to go through and cache a reference to the component, instead of leaving many GetComponent calls in your script. For more details on this change, see Lucas’ blog post.

I hope this helps you get started with 5. We’ll have more tutorial and demo content coming soon, and please sound off in the comments below as to what you like and dislike, and if you have requests for future content, let us know about that too!

Agile project management with Axosoft

In any software development process planning and making knowledge available for the entire team is a valuable resource. With the right information it is possible to reduce confusion among team members. The team needs to know what each member is working on, how the overall project is going, what difficulties are raising and how to overcome them.

Tools like Axosoft helps you and your team to organize, plan and be ready to release your software in an easy way.

Revisiting the code snack concept

At the end of 2008 I had a clear mission for what I wanted to host on this domain. The idea of a "code snack" was born out of an observation that there needed to be a resource that provided small easily digestible pieces of information about software development. The definition of code snack is clear and concise:

code snack - [kohd snak] - n. - an easily digestible morsel of programming related information

However, despite having a clear vision and a solid definition, this site has only produced two snacks related to Windows 8 design:

  1. Metro Snack #1: Choosing XAML or HTML5 for Windows Developer Preview apps
  2. Metro Snack #2: What is WinRT?

These were written in January 2012. We're a third of the way into 2015 and as someone I respect a ton says frequently: "It's later than you think."

This blog got me started on a path that has certainly led me to where I am today but I can't say that it has lived up to its potential as the resource I defined right before the start of 2009. A very important person in my life recently rekindled this idea and I want to make sure I follow through this time.

Over the next few weeks I'm going to be brainstorming some topics that would make for good snacks but while I work on that I could use your help. What kind of topics would you like to see explained in short easily digestible chunks? Hit me up on Twitter @brentschooley or use my contact form if you have any ideas.

Here's to many snacks in the future.


Monologue is a window into the world, work, and lives of the community members and developers that make up the Mono Project, which is a free cross-platform development environment used primarily on Linux.

If you would rather follow Monologue using a newsreader, we provide the following feed:

RSS 2.0 Feed

Monologue is powered by Mono and the Monologue software.