Xamarin: Inspect, Visualize, and Debug Your App Live

When you’re adding the final polish before releasing your mobile app, it’s easy to get stuck in that dreaded tweak-code-debug-run cycle. For every change that you make, even the simplest ones, you have to relaunch your app on several emulators or devices to ensure it’s working properly. This is where the brand new Xamarin Inspector […]

The post Inspect, Visualize, and Debug Your App Live appeared first on Xamarin Blog.


Daniel Cazzulino: How to get the item type or build action of a file in a project

When working with Roslyn inside a Visual Studio extension, it’s not rare to need to go back and
forth between the two. In Roslyn-land, projects are mostly identified by their Guid. This is the
ProjectGuid MSBuild property of a project, available from the IVsHierarchy
VSHPROPID_ProjectIDGuid property that uniquely identifies the
project in a solution. And documents are most easily identified by their
FilePath property.

In my case, I needed to retrieve the item type (build action in the property browser), given
the things that the Roslyn API works with: project id, file path. Tell me it
doesn’t give you the creeps:

static string GetItemType (IServiceProvider services, Guid projectId, string filePath)
    var solution = services.GetService<SVsSolution, IVsSolution> ();

    IVsHierarchy project;
    uint itemId;
    object projectItem;
    string itemType = null;

    if (ErrorHandler.Succeeded (solution.GetProjectOfGuid (projectId, out project)) &&
        ErrorHandler.Succeeded (project.ParseCanonicalName (filePath, out itemId)) &&
        itemId != (uint)VSConstants.VSITEMID.Nil &&
        ErrorHandler.Succeeded (project.GetProperty (itemId, (int)__VSHPROPID.VSHPROPID_ExtObject, out projectItem)) &&
        projectItem != null && projectItem is ProjectItem) {
        itemType = ((ProjectItem)projectItem).Properties.Item ("ItemType").Value.ToString ();

    return itemType;

And when searching for things like this, it’s pretty awesome to come across posts that say things like Who said building Visual Studio Extensions was hard?.



Xamarin: Tips for Winning a Xammy at Xamarin Evolve 2016

Xamarin app developers, mark your calendars: the last day of 2015 is the deadline to enter your app for consideration in the Xamarin Evolve 2016 Xammy Awards! We will then choose the finalists in each of the three major categories of Enterprise, Emerging Devices, and Consumer, with winners announced on stage at Xamarin Evolve 2016. Here […]

The post Tips for Winning a Xammy at Xamarin Evolve 2016 appeared first on Xamarin Blog.


Chris Riesgo: Android AltBeacon Library: Version 2.7

It’s overdue, but I just published version 2.7 of the Android AltBeacon Library.

You can find it on:

What’s new

There have been several major version releases from AltBeacon since the Xamarin library has been updated, so here’s a quick rundown of new shiny bits you can expect to find:

Features changes:

  • Optionally allow tracking multiple beacons with the same identifiers, distinguishing with the mac address.
  • Support for Gatt-based beacons and interleaved frames
  • Filter out invalid RSSI values of 127 for distance calculations
  • Identifier class now supports conversion to/from the UUID class.
  • Optionally allow using an ArmaRssiFilter for faster distance calculation convergence.
  • Support detection of Eddystone-UID, Eddystone-TLM and Eddystone-URL
  • Support transmission of Eddystone-UID and other GATT-based formats
  • Add more options for parsing identifiers of specific lengths
  • When scanning in Background on Android 5+, do a full scan without filters during the main scan period (default for 10 seconds once every 5 minutes) in case scan filters are unavailable
  • Common open-source BeaconParser layouts are defined as constants on BeaconParser
  • Bluetooth address is now a field on Region, offering the option of monitoring and ranging for all beacon transmissions from a known device’s MAC Address
  • Target SDK bumped to 23 for Android 6.0
  • Adds hardware accelerated detection of Eddystone frames in the background on Android 5+
  • Provides ability to forward BLE scan callbacks for non-beacon advertisements

Bug Fixes:

  • Workaround for 500 alarm limit on Samsung devices.
  • Fix NPE in scanning for beacons on Lollipop in the emulator
  • Restart scanning after app is killed due to memory pressure
  • Protect against crashes when falling behind on scans
  • Protect against null pointer exceptions in race conditions
  • Protect against crash when stopping advertising with bluetooth turned off
  • Stop BLE scanning after stopping ranging of the last region
  • Fix for NPE on Galaxy Note 4
  • Keep from getting stuck in background mode after stopping and restarting service
  • Protect against Null Pointer Exceptions when dynamically adding and removing monitored/ranged regions
  • Protect against an underlying Android BLE bug that sometimes causes Null Pointer Exceptions when starting stopping scanning.
  • Ignore corrupted beacon BLE packets instead of throwing an exception about them
  • Use a private ThreadPoolExecutor for beacon scanning to avoid thread starving apps using AsyncTask
  • Allow missing data fields, setting data values to zero if data fields missing in packet
  • If a custom AltBeacon parser is supplied, don’t crash with NPE if it is not found
  • Android 5.x devices could not detect AltBeacons on with unusual manufacturer codes in versions 2.3 and 2.3.1 due to Android 5.x BLE scan filters being inadvertently enabled in the foreground.
  • Improve handling of PDUs with unexpected lengths.
  • Add ability to optionally shorteten Beacon identifiers if their max length can be longer than the PDU.
  • Fix improper termination of URLs on URI Beacons causing an extra byte to show up on the end.
  • Identifer.parse(“0”) is now handled properly. A bug in the previous release did not handle it properly leading to ranging/monitoring failures on regions with such an identifier.
  • Switch BeaconParsers list to be a CopyOnWriteArrayList to avoid UnsupportedOperationException changing list after starting scanning.
  • Fix crash when region has more identifiers than beacon
  • Fix bugs with compressing Eddystone-URL to bytes and back
  • Allow Regions to match beacons with fewer identifiers if the extra region identifiers are null. This allows matching Eddystone-UID and Eddystone-URL beacon with the default Region with three null identifiers. This started failing in version 2.6.
  • Declare the ACCESS_COARSE_LOCATION permission in the manifest since it is required for Android 6.0. This is helpful to keep beacon detection working on Android 6.0 for apps that don’t explicitly declare this in their own manifest.
  • Fix rescheduling of alarms in the distant future so they don’t inadvertently go off right away

If you notice an issue…

Please help the community by logging any issues you find.

  1. make sure that the issue hasn’t already been logged against the original library
  2. if the original library works correctly, log an issue against the Xamarin binding

Can’t wait to hear about the cool apps you build!


Michael Ridland: MVVM / MVC is dead? Is Unidirectional a MVVM / MVC Killer?

Ah so now when you’ve learnt MVC/MVVM, everyone’s decided that we shouldn’t do it anymore? Huh? MVVM is a great pattern which allows for a clean separation between views and logic, it also lends itself well to unit testing, but is it the only way? If you didn’t already know there’s some new kids on the […]

The post MVVM / MVC is dead? Is Unidirectional a MVVM / MVC Killer? appeared first on Michael Ridland.