August 8, 2014

Code Monkeys in the Wild Contest Winners!


Xamarin plush monkeys serve as an example of how big the Xamarin community stretches all over the world. In the latest contest, Code Monkeys in the Wild, we wanted to see what your plush monkey was up to. Choosing was a tough choice, as there were many great entries that ranged from the Swiss Alps to Rhode Island.

Thank you to everyone who participated! Below are some highlights of some entries, and  you can check out the rest of the Code Monkeys in the Wild photos here.


The winner for Best Monkey and an Exclusive Xamarin Swag bag goes to Bruno Pacola from Brazil! Bruno’s monkey sure has a relaxing lifestyle:

As for the Best Virtual Monkey, and winner of an Exclusive Xamarin Swag Bag PLUS a plush Xamarin monkey, goes to Russell Collingham from England! 

Thank you to everyone who participated in the Code Monkeys in the Wild contest! It’s always amazing to see our Xamarin community around the world. If you didn’t manage to get an entry submitted this time, no worries; keep an eye on the Xamarin Blog for future contest announcements!

August 6, 2014

Tips for Winning a Xammy


Xamarin App Developers, mark your calendars: Monday, August 11, 2014 is the deadline to enter your app for consideration in the Xamarin Evolve 2014 Xammy Awards. After that deadline, two apps in each of four major categories – Gaming, Enterprise, Emerging Devices, and Consumer – will be selected as Xammy finalists. If chosen, we will showcase your app on stage at Xamarin Evolve 2014.

Xammy winning logo

There’s no doubt the competition will be fierce! Here are a few tips on how to make it to the brass ring:

  1. Be Transformative: Mobile technology is changing the world. Tell us how your app is enabling new kinds of customer engagement, distributed workforce efficiencies, or further massaging the flow of data. Show us how your app is reshaping the way we connect, work and play.
  2. Be Innovative: The intense competition between platform vendors is greatly accelerating innovation. Explain the differentiating capabilities your app brings to customer interactions or business processes.
  3. Be Revolutionary: Tell us how your app significantly changed your audience’s behavior or how they engage with information.
  4. Be Versatile: It’s a BYOD world. Share with us how your app is compatible with various smartphones, tablets, and wearables. Describe to us which Xamarin native capabilities your beautiful app employed on different platforms.
  5. Be Descriptive: There are so many great tools available to Xamarin developers – don’t leave a single detail out. Whether you used the new Xamarin Designer for iOS, accelerated development with Xamarin Components and NuGets, or built the entire UI in Xamarin.Forms, tell us absolutely everything about it!

Category winners, as well as a Grand Prize winner and a Developers’ Choice winner, will be announced live on October 10th at Xamarin Evolve 2014.

Does your app have what it takes to be recognized worldwide as a Xammy Award winner? Enter your Xamarin app to find out! Don’t miss the submission deadline of August 11, 2014.

August 5, 2014

Be More Productive with these New Xamarin Studio Features


The launch of Xamarin 3 brought a huge update to Xamarin Studio on both Mac and PC. In addition to the visual update, we added support for F#, NuGet, integration with the .NET BCL Documentation, the Xamarin Designer for iOS, and tons of other optimizations.Xamarin Studio Icon We have been listening to your feedback on the Xamarin uservoice and have added even more amazing features to increase your productivity with the latest release of Xamarin Studio, which is available right now! No time is better than now to get started with iOS and Android development in C# with Xamarin Studio with the introduction of our $25 a month pricing of Xamarin Indie. Let’s check out some of the new features:

Side-by-side Editing

When developing cross-platform apps, I have always wanted to be able to see multiple code files side-by-side. Or perhaps I have an iOS storyboard open and would like the ViewController to be editable at the same time. Xamarin Studio has the solution with side-by-side editing of any file inside of Xamarin Studio.

Xamarin Studio Side By Side editing

Simply drag a tab to the left or right side of the IDE to snap it into place. If you are more of a keyboard shortcut master, simply use the “2 columns” command (Command+Option+2 on Mac, Control+Shift+2 on Windows). It gets even better as you can fully detach any tab, which is perfect if you are running a multi-monitor setup.

Xamarin Studio Floating Editor

NuGet Enhancements

Xamarin 3 brought support for adding and managing NuGet packages right from Xamarin Studio, and it has only gotten better with new support for:

  • Framework Retargeting – to automatically update packages when a project’s framework or PCL profile has changed
  • Automatic Package Update Check – checks for package updates when opening a solution
  • Custom Package Repository Paths – configure where you would like your packages to be saved to

Debugger Updates

Create a breakpoint Adding onto the great debugging experience you have today in Xamarin Studio is the brand new unified exception, function, and location breakpoints dialog. You can add a breakpoint like you always have, or right click and select Create a Breakpoint to bring up this new dialog. This will easily enable you to configure the breakpoint however you like. This includes specifying what causes the breakpoint action, when to take the action, and even advanced conditions such as if the breakpoint has been hit X number of times.

Get it today!

The latest version of Xamarin Studio with all of these features and more is available right now in the stable channel. Simply open Xamarin Studio and “check for updates” to start enjoying all of these productivity boosts. For a full list of enhancements and updates please be sure to browse the release notes. If you are looking to get started with Xamarin be sure to check out our new Xamarin Indie $25 a month pricing where you can develop native iOS and Android apps in C# with Xamarin Studio.

August 4, 2014

Xamarin Acquires Petzold


Win Autographed Copies of Code and The Annotated Turing!

PetzoldHeadShotXamarin is pleased to announce the acquisition of Petzold, a hardware/software package that converts APIs into books. The Petzold engine is Turing complete and currently processing the Xamarin.Forms API to generate nearly bug-free pages at the approximate rate of five pages per day.

Petzold Book

The resulting book,
Creating Mobile Apps with Xamarin.Forms
will be released in the spring of 2015, but all Evolve 2014 attendees will get a special printed Preview Edition of the book in progress.

The book is aimed at beginner and proficient Xamarin.Forms developers alike. It begins with an introduction to Xamarin.Forms and then goes on to give comprehensive coverage on Xamarin.Forms including XAML, Animation, Platform-Specific Rendering, and more.

Evolve 2014 Talks

In addition to the book, Charles will be giving two talks at Evolve 2014:

XAML for Xamarin.Forms covers the basics of XAML syntax, including resources, property elements, attached properties, and markup extensions, how to integrate custom views and custom markup extensions into XAML, and the relationship between XAML and MVVM.

Xamarin.Forms is Cooler than You Think goes beyond the surface to explore some of the less obvious features of Xamarin.Forms, including the more obscure layout mechanisms, the power of data bindings and behaviors, and the flexible animation infrastructure.

Win Signed Copies of Code and The Annotated Turing

In celebration of the Petzold acquisition, we’re giving away signed copies of two unique books by Petzold that explore the foundations of digital computing: Code: The Hidden Language of Computer Hardware and Software and The Annotated Turing: A Guided Tour through Alan Turing’s Historic Paper on Computability and the Turing Machine!

Code CoverAnnotatedTuringCover100

How to Enter

And here’s the fun part. To enter you must download and try out Solitaire - a Xamarin.Forms app featuring the encryption algorithm written for the book Cryptonomicon (in which Alan Turing was a fictionalized character). Use the app to encrypt your twitter handle (without the ‘@’) using the key PETZOLD and tweet the following text:

Tell me more about XAML #Petzold at #XamarinEvolve XXXXX;

where XXXXX is your encrypted twitter handle.

Solitaire EncryptionWe’ll choose a random tweeter on August 22nd, 2014. The tweet must contain the two hashtags #XamarinEvolve and #Petzold, and the ciphertext must decrypt your twitter handle successfully.


Mobile .NET and Xamarin Meetups in August


The last month of summer is upon us, so why not cool off at an August .NET or Xamarin user group meetup? Check out the announced events for the month of August and remember to follow @XamarinEvents to stay informed on newly added Xamarin events.


Here are some upcoming Xamarin developer group meetups:

Seattle Mobile .NET Developers Group us

  • Seattle, WA: Tuesday, August 5th 6:00PM
  • What’s coming for device and services developers next year in .NET

That Conference  us

  • Wisconsin Dells, WI: August 11 – 13
  • Making 2D Games that Run Everywhere using C#, with Xamarin’s Mike Bluestein 

Philly Area Xamarin Group  us

  • Philadelphia, PA: Tuesday, August 12 7:00PM
  • Back to Class

Sydney Mobile .NET Developers  au

  • Sydney, Australia: Tuesday, August 12 6:30PM
  • “What’s New in iOS8 and Xamarin?” plus “.NET MVC and Xamarin.Forms Mashups”

Northern Virginia/DC  in

  • Tyson’s Corner, VA: Wednesday, August 13th 7:00PM
  • Xamarin 3 and Xamarin.Forms

Chicago .NET Mobile Developers  in

  • Chicago, IL: Thursday, August 14th 5:45PM
  • Implementing & Accessing Backend Services using Azure Mobile Services & Xamarin

Madison Xamarin User Meetup us

  • Madison, WI: Wednesday, August 20th 6:00PM
  • Developing iOS Apps with Xamarin for Visual Studio

Boston Mobile C# Developers Group us

  • Cambridge, MA: Thursday, August 21st 6:00PM
  • Making 2D Games with C#, with Xamarin’s Mike Bluestein 

Cape Town Xamarin Users Group za

  • Cape Town, South Africa: Thursday, August 21st 5:30PM
  • Second Screen – From Mobile to the Lounge (or Boardroom)

New York ALT.NET Software Development Group us

  • New York, NY: Wednesday, August 27th 6:30PM
  • Developing iOS and Android Apps in Visual Studio with Xamarin

Chicago .NET Mobile Developers  in

  • Chicago, IL: Thursday, August 28th 5:45PM
  • Developing Cross Platform iBeacon Applications in C# using Xamarin

Xamarin events are always happening around the world, so if you don’t see your city listed above, be sure to also check out the Xamarin Events forum where new meetups are being added all the time. Additionally, don’t forget to follow our brand new @XamarinEvents Twitter account to make sure you never miss an upcoming Xamarin event.

Don’t see a developer group in your area and want to get one started? We’re here to help! We have a tips and tricks guide on starting a developer group, our introduction to Xamarin slide deck, and of course our community sponsorship program to get you on your way. We also want to hear from you, so please feel free to send us an email or tweet @XamarinHQ so we can help spread the word and continue to grow the Xamarin community.

August 1, 2014

Xamarin Indie Now $25/Month


We are very excited to announce that we are now offering Xamarin Indie edition as a month-to-month subscription for just $25/month. As always, Xamarin Indie edition is available to companies with fewer than five employees.

At just $25 per month for iOS or Android, Xamarin Indie makes it incredibly easy to build and ship native mobile apps written in C#, with an extremely affordable price point accessible to anyone.

This offer is available as an experiment through August 31, 2014. We’ll decide whether to extend this offering to new customers depending on what happens in August, but if you sign up for a subscription in August, you can stay on a month-to-month plan as long as you like.

Go get yours today!

Some quick FAQs:

Who is eligible for a monthly Xamarin Indie subscription?
Developers at companies or organizations with up to 5 employees may purchase Xamarin Indie. Companies with more than 5 employees must purchase a Xamarin Business or Enterprise subscription.

Can I continue to use Xamarin after my monthly Indie subscription expires?
Monthly Xamarin Indie subscriptions renew automatically each month. If you allow your subscription to expire, you will no longer be able to use Xamarin to build mobile apps. Your existing mobile apps will continue to work.

Can I still buy Xamarin Indie edition as an annual subscription?
Yes! Xamarin Indie edition is still available as an annual subscription at the normal price of $299/platform/year.

I already have an annual subscription of Xamarin Business or Xamarin Enterprise. Can I add on a monthly Xamarin Indie subscription?
No. You must purchase the same type of subscription for all platforms. For example, if you already have an annual subscription of Xamarin Indie iOS, you cannot add a month-to-month subscription of Xamarin Indie Android.

Can I purchase a month-to-month subscription of Xamarin Business or Xamarin Enterprise?
No. Xamarin Business and Enterprise editions are only available as an annual subscription, and we do not foresee ever offering those as a monthly subscription.

What happens if I sign up for a monthly Xamarin Indie subscription and you decide to stop offering it?
If you subscribe to a monthly Xamarin Indie subscription prior to August 31, 2014, you’ll continue to pay just $25 per month until you choose to cancel your subscription.

How can I pay for a Xamarin Indie monthly subscription?
Dogecoin! Just kidding. We can only accept credit card payments for monthly subscriptions.

Discuss this post in the Xamarin forums.

July 30, 2014

Put Some Office 365 in Your Apps


Office 365 is Microsoft’s cloud-based solution providing access to services like Mail, Calendar, Contacts (using Exchange Online), Storage (using OneDrive) and Collaboration tools (using SharePoint Online). These services are backed by Azure’s robust infrastructure and use Microsoft Azure Active Directory (AD) to authenticate, authorize and grant access to users. Office 365 LogoHowever, developers like us have always want to extend these services in some way. For this reason, Microsoft has released Client Libraries for Office 365 and, good news, they are Portable Class Libraries! This means these libraries can be used in Xamarin.Android and Xamarin.iOS applications. You can read more in the official post from Microsoft.

In this post, we’ll build a Xamarin.Android app, which will connect to the Office 365 service. We’ll extend this app to show data from our Office 365 subscription. The app will talk to our Office 365 Exchange Inbox and fetch mails from there. The overall app will look similar to the screenshots shown below:


Step 1: Get the Tooling

To build apps that can connect with Office 365, we need to install the necessary tooling support. For Visual Studio:

  • On the Visual Studio menu, click Tools->Extensions and Updates->Updates.
  • You should see the update available for Office 365 API Tools.
  • Click Update to update to the latest version.


  • Download the extension and install it manually.

Step 2: Create Xamarin.Android Application

For this sample, we’ll choose the default Android app template and extend this app to use Office 365 libraries.

  • In Visual Studio, File > New > Project
  • Select C# > Android and Blank App (Android) project template
  • Give project a name (in my case O365Client) and click ‘OK’


This will create a default “Hello World” app, which shows the incremental number of clicks of a button.

Step 3: Add Office 365 Connected Service

To use Office 365 Services from this app, we need to add libraries and reference the services. Simply right click the project in the Solution Explorer and add a connected service.


On the next screen, sign in with your Office 365 Account:


Now, select the service which you want to access and give it a permission and click “OK”:


Step 4: Using the Services

In the Solution Explorer, you’ll find that the tooling has added the required assemblies as well as some C# files with sample code:


public class MyGlobalDeclaration : Android.App.Application
  public MyGlobalDeclaration (IntPtr handle, JniHandleOwnership transfer) : base(handle, transfer)
  public static List Messages { get; set;}
  public override void OnCreate()
    Messages = new List ();

To show data in a specific format (Inbox layout) we need to add a custom adapter, which will populate this view. Add a new class to the project and modify it as displayed below:

public class HomeScreenAdapter : BaseAdapter
  List items; Activity context;
  public HomeScreenAdapter(Activity context, IEnumerable items) : base()
     this.context = context;
     this.items = items.ToList();
  public override long GetItemId(int position)
    return position;
  public override IMessage this[int position]
    get { return items[position]; }
  public override int Count
    get { return items.Count; }
  public override View GetView(int position, View convertView, ViewGroup parent)
    View view = convertView; // re-use an existing view, if one is available
    if (view == null) // otherwise create a new one
    view = context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItem2, null);
    view.FindViewById(Android.Resource.Id.Text1).Text = items[position].Subject;
    view.FindViewById(Android.Resource.Id.Text2).Text = items[position].From.Address;
    view.Tag = items [position].Id;
    return view;

Now, let’s modify ‘MainActivity.CS’ to show our Inbox.First, the activity needs to inherit from ListActivity to display records in a list mode:

public class MainActivity : ListActivity

To authenticate against the Inbox in Office 365 i.e. Exchange, we’ll declare two endpoints:

const string ExchangeResourceId = "";
const string ExchangeServiceRoot = "";

This is the perfect time to authenticate, we’ll write the EnsureClientCreated method, which will create an Office365 client that we can use to call the services. To execute this method we’ll pass the current activity as the context.

private async Task EnsureClientCreated(Context context)
  Authenticator authenticator = new Authenticator(context);
  var authInfo = await authenticator.AuthenticateAsync(ExchangeResourceId);
  return new ExchangeClient(new Uri(ExchangeServiceRoot), authInfo.GetAccessToken);

Once the client is ready we can call GetMessages, which gets messages from our Office 365 Inbox.

public async Task GetMessages(Context context)
  var client = await EnsureClientCreated(context);
  var messageResults = await (from i in client.Me.Inbox.Messages
      orderby i.DateTimeSent descending
      select i).ExecuteAsync();
  MyGlobalDeclaration.Messages = messageResults.CurrentPage.ToList ();
  ListAdapter = new HomeScreenAdapter(this, MyGlobalDeclaration.Messages);
  return messageResults.CurrentPage;

However, we’re yet to call GetMessages method in our code. Modify the OnCreate method as shown below to call this method and fetch messages.

protected override void OnCreate(Bundle bundle)
  GetMessages (this);

When the user clicks on a particular email message, we want to show that message. First, add an OnListItemClick method, which, when clicked, will pass the Email’s ID to next activity, which we’ll add later.

protected override void OnListItemClick (ListView l, View v, int position, long id)
  var bodyActivity = new Intent (this, typeof(MessageBodyActivity));
  bodyActivity.PutExtra ("Id", v.Tag.ToString());
  StartActivity (bodyActivity);

Now, we’ll add a new layout and activity for the detailed message. To do this, go to Resources > Layouts and add a new Android Layout. I’ve given it a name “Message.axml”.
Modify this file as shown below to include our view.

<!--?xml version="1.0" encoding="utf-8"?-->

Here, add a new Android Activity to the project and modify it with following code to display the message and sender’s email ID.

[Activity (Label = "Email:")]
public class MessageBodyActivity : Activity
  protected override void OnCreate (Bundle bundle)
    base.OnCreate (bundle);
    var id = Intent.GetStringExtra ("Id");
    var message = MyGlobalDeclaration.Messages.FirstOrDefault (m => m.Id == id);
    if(message == null)
    SetContentView (Resource.Layout.Message);
    var fromText = FindViewById (Resource.Id.fromText);
    var bodyText = FindViewById (Resource.Id.bodyText);
    fromText.Text = message.From.Address;
    bodyText.SetText(Html.FromHtml(message.Body.Content), TextView.BufferType.Spannable);

This completes our amazing Office 365-enabled mobile app! Debug the application, and login with your Office 365 account. This should show all the mails in your inbox, and, if you click on any mail item, it should take you to its detailed view.

I want to reiterate here that you are not just limited to fetching mails from the inbox like we did in this example, but you can fetch calendar events, get files from OneDrive for Business, or even browse through sites available under SharePoint Online.

I hope that this was a great introduction on how you can use the brand new Office365 API in your Xamarin.iOS and Xamarin.Android applications. You can download the full source code for this sample on my GitHub.

Discuss this blog post in the Xamarin Forums

July 28, 2014

Image Detection in iOS 8


Prior to iOS 8, Core Image included facial recognition, allowing applications to easily detect facial features such as mouth and eye positions. This is covered in the Introduction to Core Image article in our Developer Center. In iOS 8, Apple has added additional image recognizers for detecting rectangles as well as QR codes.


All of the image detectors from Core Image are available in the CIDetector class. This makes the API for doing image recognition the same regardless of which type of detector you are using. You can create an image detector via factory methods on CIDetector as listed below:

  • CIDetector.CreateRectangleDetector
  • CIDetector.CreateQRDetector
  • CIDetector.CreateFaceDetector

These methods take CIContext and CIDetectorOptions instances respectively. A CIContext orchestrates everything that happens when working with Core Image, such as applying filters and performing image detection.

CIDetectorOptions, as the name implies, allows various options to be set. For example you could set the accuracy the detector should use.

Rectangle Detector

With the CIContext and CIDetectorOptions, you can create a CIDetector, as the following code does to create a rectangle detector:

var detector = CIDetector.CreateRectangleDetector (context, options);

Any image features recognized by the detector are returned in an array of CIFeature objects when calling FeaturesInImage for a given CIImage:

var ciImage = CIImage.FromCGImage (imageIn.CGImage);
var features = detector.FeaturesInImage (ciImage);

Each feature has a Bounds property containing a rectangle that encloses the particular feature. This can be used to perform imaging operations on the detected feature. For example, say you want to highlight a feature on an image when it is recognized. You could use the Bounds to create an overlay over the original image:

var overlay = CIImage.ImageWithColor (CIColor.FromRgba (1.0f, 0.0f, 0.0f, 0.7f));
overlay = overlay.ImageByCroppingToRect (features [0].Bounds);
var ciImageWithOverlay = overlay.CreateByCompositingOverImage (ciImage);

This results in a semi-transparent overlay as shown below:

rectangle image detector

QR Code Detector

Core Image previously included the ability to generate QR codes. Now it allows QR code detection as well.

Using a QR code detector is similar to a rectangle detector. Simply create the detector, this time by calling CreateQRDetector, and proceed in a similar fashion to retrieve a CIFeature array.

var detector = CIDetector.CreateQRDetector (context, options);

The following screenshot shows a QR code being detected:

qr code detector

One thing to be aware of, as of iOS 8 beta 4, the QR code detector only works on a device. Calling CreateQRDetector in the simulator returns null.

The addition of new detectors in Core Image, with its high-performance, easy to use API, allows for new scenarios that previously required third party imaging libraries. Combined with the extensive filtering support of Core Image, it’s very easy to create imaging applications in iOS.

The code from this post is available here.

Discuss this blog post in the Xamarin Forums

July 25, 2014

Contest: Code Monkeys in the Wild


We’ve shipped Xamarin Monkeys to every corner of the world, and it’s time for them to check in.  

For this contest, all you need to do is take a picture of your plush Xamarin monkey doing something awesome! Whether it be your favorite part of your town, on a trip to an exotic paradise, or simply hanging with your dog in your backyard, help show the world how far the Xamarin community reaches.

Looking for some inspiration? Check out our well-traveled friends on @ConceptMonkeys and @MotzMonkeys.

Monkeys in Seattle

How to Enter

  1. Take a picture of your monkey doing something amazing.
  2. Tweet your picture with the hashtag #xamarin #codemonkey

Don’t have a monkey yet? No problem.  Step into our Virtual Monkey Photo Booth by running our excellent “Working with Images” Xamarin.Forms tutorial on your phone for a stand-in monkey.



  • Best Monkey: Exclusive Xamarin Swag Bag
  • Best Virtual Monkey: Exclusive Xamarin Swag Bag + plush Xamarin monkey

All submissions must be made by August 4th at 8am EDT. A valid entry consists of a tweet with monkey(s). We will evaluate each photo and choose a winner based on novelty, photo quality, and reliability. Winners will be announced on Twitter. Contestants should follow @XamarinHQ to enable us to DM you for private follow-up. There is no purchase necessary to enter the Code Monkeys in the Wild contest.


Build Your First F# Mobile App Contest Winners


The launch of Xamarin 3 at the end of May brought Xamarin developers access to first-class support for F#, enabling succinct, expressive and functional mobile apps for iOS and Android. We received many great entries, making it difficult to select just two winners.

First place goes to Bernard Hsu for his app Evolution! Evolution is, “a mobile app (iOS written in Xamarin) that demos Evolutionary situations in-silico.” Bernard ported the C# version of Evolution to utilize all of the functional power of F# and will be rewarded with a new Apple Mac Mini for the valiant effort. Congratulations!

Evolution App by Bernard Shoe

Second place goes to Peter Klima’s TripDiary app. TripDiary allows you to track your, “trips to nature, for culture or wherever you want, to go take pictures and make notes during your journey.” TripDiary shows off how to interact with a SQLite database in F#, as well as how to build up a complete user interface with maps, photos, and more. Congratulations, Peter, you’ll soon be sporting a new Samsung Gear Live Watch!


Thank you to everyone who participated in the F# contest! Once again, we are amazed to have such a strong and inspiring community following Xamarin. To show our thanks, everyone who submitted a valid entry to the contest will be receiving a plush Xamarin monkey. If you didn’t manage to get an entry submitted this time, no worries; keep an eye on the Xamarin Blog for future contest announcements!