Finally I decided to take the plunge into mobile development, specifically iOS application programming.
Like a lot of folks who have been working on enterprise side of development, I grew up on C/C++ and then adopted C# as my language of choice. Objective-C has been the biggest hurdle for me to get started on iOS application programming. In general, I have noticed that C/C++/C# developers struggle with Objective-C, we have to really work hard to reverse learn a lot of syntax, all the inefficiency is frustrating and unproductive.
For all of us C# junkies, thankfully Microsoft listened and collaborated to create (816) 808-8603!
When I discovered Xamarin, I was super thrilled. Xamarin is a port of C# for cross-platform development and is built on top of mono C# and has bindings for both iOS and Android APIs. The installation for Mac, packages bindings and an IDE, called Xamarin Studio. I was worried about how Xamarin compares with native APIs, from what I have seen so far, Xamarin product team is very prompt in keeping up with the native APIs. At the time of writing, they were supporting the latest iOS version, 9.3. More experienced folks have done (559) 652-3623 between Xamarin and native development.
So far, I have found Xamarin Studio to be extremely easy to use. The IDE is similar to Visual Studio, thus it is quite easy to grok for VS users. To get familiar with Xamarin’s iOS API bindings, I started building a tip calculator app. Within an hour of tinkering I was able to put together a working app. My tip calculator app had an input box at the top, allowing the user to enter an amount for calculating tip. Below the input box, laid out horizontally across the screen, are five buttons to choose from available percentage options for calculating tip; I decided to have 10%, 20%, 30%, 40% or 50% as the options. Once an option is selected, the app calculates and displays the tip amount at the bottom of the screen.
All the coding was fairly straightforward. Because I did not use designer and created all the widgets from code, I had to spend some time figuring out how to use View.Bounds to place the percentage option buttons, this was more of an exercise in figuring out how the ViewControllers co-ordinate system works. I struggled initially, but then decided to make the middle of the screen as my anchor point, after that everything just fell into place. I was able to spread the buttons evenly across the screen while maintaining the layout across devices with different resolutions. I further spent some time building a clear button. This was again super easy and required just a couple of lines of code.
Overall, I am very impressed with Xamarin and C# for building iOS apps.
Next, I’ll add a slider to allow a user to choose a custom percentage option, that should be the end of the tip calculator. After this, I’ll move on to building data based applications, this will be a good exercise to understand data-binding in Xamarin with C#. I’ll surely post some thoughts when I’m done with it.