In part two of this series, I describe the first cross platform mobile app I developed using Xamarin, and the big surprise that was in store for me when I profiled what I thought was the finished “ready to submit to the App Store” iOS version of that app.
NOTE: Just a quick reminder that the presentation this series is based on was created in September, 2013. Things have improved since then. I will occasionally add notes with updates when appropriate.
After completing my certification, I began work on my first commercial cross-platform mobile app using Xamarin. The app is called “XNotes for XTrends”, and it was being developed for my previously-mentioned long time friend and customer. XNotes is a vertical market app for the broadcast radio industry. I created both iOS and Android versions of the app.
The XNotes mobile app is a fairly simple companion app for use with the client’s existing Windows desktop application. The Windows app allows radio station management to review Arbitron ratings data for their markets on a weekly basis. If you’re not familiar with how the broadcast industries work, their advertising rates are based on their ratings. The ratings are literally the life blood for these companies.
The XNote mobile app allows users to annotate the ratings data with comments. The comments typically describe events that occur during a specific period of time. When the ratings data becomes available in the next 7 to 90 days depending on the market size, the notes provide reminders of the events that may have affected the numbers either positively or negatively.
Entering notes with the mobile apps require users to specify the market (city), station, a date range and one or more descriptive tags that can be used for filtering when the user adds a note.
Fast forward to August 24th. I’ve completed development of the iOS version along with basic testing by myself and the client’s customer support resources. We think the app is ready to submit to the App Store. It seems to be working great without crashes, and its a pretty simple app after all.
I have used profilers on a variety of platforms in the past, usually during the development process instead of after it, but time constraints and the simplicity of this app had convinced me to make it a low priority in this case. Still, I decided I should give the app a quick run through the Xcode Instruments profiler as a final sanity check before submitting the app.
Before we proceed, I want to make it clear that I will be critical of what I consider to be failings on Xamarin’s efforts thus far [as of September, 2013]. However, even after considering everything I will share with you in this series, I still believe Xamarin is a great platform to use, and frankly the best solution for cross-platform mobile app development available in the market today.
So, what did I find? The app’s memory consumption was on a constant increase as I used it! This was not good. Even worse, I now realized that Xamarin is a black box as far as Apple’s development tools are concerned. All you’ll see in Instruments is literally thousands of small (less than 256 bytes) heap memory allocations. There is no context provided as to which classes’ instances are being leaked.
I have to be honest and say the next part of this story gave Xamarin a black eye as far as I’m concerned. At this point, I was working as a one man shop on this project. I initially purchased the Xamarin “Indie” iOS and Android licenses, which were $250 each. When I ran into this issue, I discovered that Xamarin had their own profiler that shows the managed C# class instances being leaked, but you have to own a “Business” or “Enterprise” license to have access to it. In my opinion, any professional developer, including us indie guys, needs profiling tools to do our job. Regardless, I had to suck it up and upgrade to the “Business” license, which set me back an additional $1400.
Xamarin is clearly targeting enterprises with their sales strategy, which unfortunately can make it hard for smaller companies and especially individuals to get in the game. Hopefully this will change in the future.
2016 UPDATE: The pricing has changed since Microsoft’s announcement that they had acquired Xamarin. Xamarin is now available in ALL versions of Visual Studio, including the free Community Edition. Xamarin has also released a free “Xamarin Studio Community Edition” for the Mac platform. Yippee!
Coming Up…
In part 3 of this series, I explain how memory management is handled in the Xamarin world, what I consider to be myths surrounding memory management, and my initial conclusions after investigating the problems. Be sure and come by soon for the continuation of the series, or sign up for it to arrive in your inbox, hot off the digital press!
Leave a Reply