For the past few months I have been working on an Android application that collects automotive CAN bus data – ultimately for analysis with BigData technologies such as Hadoop. I have already described some aspects of this project here and here.
In this post I would like to recount my experience of using F# with Xamarin for a real-world mobile application.
Recently launched an OpenXC (http://www.openxcplatform.com) based app for internal use. The app connects to the OpenXC dongle and collects CAN data for analytics. It is interesting to note that daily capture is in 100 megabyte range (depending on the vehicle and how long it is driven). The app is based on the Xamarin platform and written entirely in F# (also see this post). Here are some screen shots:
Message Frequency Histogram
Performance of the same LoopFinder F# code over time. 3X better since 2010 and 2x better since 2011. The program was just recompiled to target the latest .Net version, each time.
Virtually all vehicles today operate an internal network called the CAN bus. Different modules (or ECUs – electronic control units) in the car communicate with each other via this network (e.g. engine, transmission, dashboard, etc.). In this post I reference a CAN bus reader built with F# and Xamarin.Android based on the OpenXC platform (http://openxcplatform.com/).
Update: Also see this post.
ClickOnce is very useful technology for delivering applications. Applications are published to the server but run on the client. If a new version is published to the server, the clients can easily upgrade to the new version via a single click. Such applications are sometimes called ‘smart clients’ because they fall somewhere between traditional rich clients and web applications.
In this post I share a build script for packaging F# projects for ClickOnce deployment.
Here is a very simple encryption / decryption code snippet using symmetric keys.
It’s ok for some low security usages.
Code is here: http://fssnip.net/iv
SimpleCrypt.encr "data to be encrypted"
SimpleCrypt.decr "... encrypted data ...."
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:
Running sample: http://mdd.apphb.com
(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.