Android Wear Starter Project – F# + Xamarin

Wearable computing is undeniably a hot topic currently, what with all the major mobile players (Apple, Google and Microsoft) having entered the market. There is also a plethora of smaller players such as Timex, Nike, Pebble, etc.

Cheap, ubiquitous wearable computers – along with Internet-of-things – may be the next big wave in technology. As they say, “possibilities are endless…”.

As this blog is dedicated to F# and functional programming, here is a starter barebones Android Wear project for Xamarin – written entirely in F# :

Please go through the repository documentation (“” file). It will give you an overview of the Android Wear app deployment process. There you will also find a list of potential ‘gotchas’ to avoid and tips on debugging and troubleshooting.


Sample Mobile Web App Presented at #mobidevday

Yesterday I attended my first MobiDevDay conference and presented a talk titled “Functional Programming for the Rich Mobile Web with F#.

The scenario for the demo’ed sample app is that a central website receives orders for flowers from all across the US. Local florists can look at the orders in their area and choose to fill the ones they can – with the help of the sample app. The app has only two screens as shown below:

Screen1 Screen2

Running sample: (needs HTML5 browser and location access). Allow upto 20 seconds for the first page to load. The sample is running is on the free version of AppHarbor which probably provisions some parts on demand. The total data downloaded (including all scripts) is only 250K for the first page.


Continue reading

Rich / Mobile Web Development – Without Losing Your Sanity

Web development is so different today than what it was even a few years ago. Web 1.0 (if we can call it that) is fading fast. Web 2.0 is in full swing. HTML 5 + CSS 3 and JavaScript are in.

There are two issues:

1) JavaScript is being asked to do what it was never designed to do.

2) Rich and mobile web development is becoming more like client-server development but the client side and the server side are two different worlds; lacking is a way of developing in a cohesive way for both.

Fortunately there is F# and WebSharper!

Recently I rolled up the sleeves and jumped in with both feet to build a mobile web application in WebSharper and JQuery mobile – as a learning exercise.

The end result is quite effective. I did not have to write a single line of JavaScript! Most of the time was spent learning the intricacies of JQuery Mobile.


Sample application is online here: (needs an HTML5 capable browser). The full source code is here:

FsJson – a Reasonably Complete JSON Parser in F#

A while ago I created a JSON parser in F# just to understand F# Active Patterns. Over the course of a year, I have updated the parser as needed and now it seems fairly complete.

I will take this blog entry to document the major features of “FsJson” in case anyone wants to use it for any purpose.

You can download the F# source from here:
Continue reading

F# Push Notification; 33K Concurrent Clients; 1 Relaxed Server

This post is about maximizing the number of concurrent connections to a single server using F# Async and Async IO. A perfect use case is for ‘push notification’ type services which exist for all the major smartphone platforms (iPhone, Android, Windows Phone).

Note: This post is about 33000 concurrent push notification clients. However in a separate test I achieved 5000 concurrent connections to a single server under load. Each client connection continually sent requests to the server with random data and no “think time” between subsequent requests. Here again I ran out of client resources to scale up. The server could handle more as it was mostly IO bound (AppFabric cache calls and SQL Server Async IO queries)

Continue reading