Visually Located

XAML and GIS

My first days with Xamarin iOS

I recently started a project in which I wanted to create an iOS app using Xamarin. This project will require me to create a binding to a third party iOS SDK, overcome a complex corporate network and prove to myself that Xmarin is a stable platform for development. I’ve only just begun this adventure, and I have already had a fare share of roadblocks to overcome. Here is a short description of the adventure that I chose.

I was very fortunate to talk with Xamarin while at the Microsoft Build conference in June. I was invited to a private dinner and was able to speak with Anuj Bhatia, Erik Polzin, and Xamarin’s own CEO and cofounder, Nat Friedman. Every one of them had heard of Schneider Electric and were excited to hear about how Xamarin could help us out. I’m glad that I also had Daniel Rouleau along with me as he has been helping lead up the development effort of our latest mobile platform.

I’ve done a bit of research on Mono/Xamarin before. I attended a Mono meetup at last years (2012) Build conference but never played around with it. After talking with these guys I was jazzed to start playing. I downloaded and installed Xamarin Studio and the Xamarin plugin for Visual Studio. Let’s me honest here. No one wants to use Xamarin Studio when they have been using Visual Studio for many years. Xamarin knows this and charges more (three times more) for their Visual Studio plugin. Building iOS apps on a Windows machine requires a Mac for compiling and deploying. Fortunately, my team recently got a new Mac Mini.

This Mac was still in it’s box, so I was able to do the unboxing and setup of the device.

Disclaimer: I’m not a Mac person. I’m not an iPhone person. The last time I used a Mac was in college when all of the PCs were already being used.

This Mac would be setup in a room and put on our “non corporate” network. We have a somewhat complex network at my work. We have two internal networks and domains. Anything corporate is within one network while anything we use/purchase is on another network. Communication between these is not ideal. The unboxing and setup was pretty smooth. I did need help from a fellow developer to download xCode from iTunes as I do not have an account.

The install of Xamarin on the Mac went pretty smooth by following the documentation although the docs do need some updated screen shots as it seems their installer has been updated. There were some confusing points like whether I needed to setup a proxy on the machine or not. After the installation on the Mac I went to my machine and attempted to connect to the build host (my Mac Mini) but it failed to connect.

image

Turns out that the Mac, like normal PCs, must have a static route configured to allow for communication between our two networks. Unlike Windows machines, you cannot easily configure a static route. You must create a script that gets run every time the machine boots up and then run that script. Once I did that (and entered the IP address rather than the machine name) I was able to access the machine!

image

I was able to successfully create and deploy Xamarin’s “HelloWorld” app as well as their “Master-Detail” app. My next steps are building out the bindings for the ArcGIS iOS SDK. If anyone out there already has something, please let me know.

blog comments powered by Disqus