iOS Background Transfer – what about uploads?

Downloading files in the background is easy with iOS since the introduction of the NSUrlSession background transfer APIs. There are plenty of examples and instructions around for ObjectiveC but also for Xamarin.iOS.

Documentation about the APIs is pretty exhaustive over at Apple and covers everything you have to know to get started.

And then, you start asking yourself: what about uploading data? And it turns out there aren’t so many working examples and in fact it can be quite tricky to get things up and running. I was in contact with Apple support and they helped me to find answers to many of my questions. This blog post is trying to conserve to essence of my mail communication as it can help others who are challenged with implementing background upload.

Continue reading

Xamarin.iOS, the garbage collector and me

A lot has been written about the Garbage Collector and Xamarin.iOS. Lately, I’ve been hit by some surprises and I want to share my findings. Let me say that there is not a single bug involved! All the issues I describe are either documented or show standard behavior of the .NET runtime. The fact that Xamarin.iOS lives on top of a reference counted world makes things a bit more difficult.

Many thanks to Rolf Bjarne Kvinge for his patience, Marek Safar for sharing the secrets of Mono compiler with me, Rodrigo Moya for helping me with the Xamarin Profiler, James Clancey for his drawings about native reference cycles 🙂 and Chris van Wyk for supporting me in these moments of “good god, this cannot be!”Âť

Continue reading

Fix too small iOS Simulator on Retina Macs

Recently I received my MacBook Pro. It’s the 13″ model with Retina Display. I run it in the 1680×1050 HiDPI mode to get more content on the screen (I use the nice little tool called QuickRes to conveniently switch resolutions).

Before I had the MacBook Pro I was working on a MacBook Air with significantly lower resolution and when testing my iOS apps in the Simulator, I had to scale the Simulator down to fit on my screen. This can easily be done by pressing CMD+1 (100%), CMD+2 (75%) and CMD+3 (50%) or via the Window -> Scale options.

Now with the MacBook Pro it is the other way round: an iPhone 5 is simply too small even at 100%. See the screenshot below.

Continue reading

My iOS8 adventure as a Xamarin developer

With this post I sum up my experiences with iOS8 as a developer. If possible I will provide solutions and workarounds.

The release of iOS8 is really unfortunate for me. A lot of my demos have stopped working and it seems like there are some really annoying bugs in iOS8.

Update: Added working example for reachability

Update: Apple confirms bug in iOS8 Simulator regarding backgrounding.

Update: explanation for the NSUrlSession issue found!

Continue reading

iOS8 is draining your iPhone’s battery? Maybe here’s why.

If you like me are an early adoptor of iOS8 – be it because you’re just or curious about the new feature, or did it for work – you might have noticed that your device’s battery life might have decreased a lot. Yesterday I talked to some developer-friends and they told me: “You know what’s cool, iOS8 keeps on running threads even if applications have been backgrounded!” I was baffled.

UPDATE: This post has been moved and is now part of…arin-developer/ ‎

Visual Studio fails to connect to Xamarin Build Host

Is it one of those rainy days where you sit in front of  your Mac and would like to try out the latest and greatest Xamarin features like Xamarin.Forms and then Visual Studio refuses to connect to the Xamarin Build Host?

Xamarin Build Host

You did not change anything of course. It just stopped working over night. That’s what computers do to keep us busy. Your options: Xamarin support? Takes to long, so let’s resolve this all by ourselves.

Continue reading