Preface

In the fall of 2013, when Packt Publishing first approached me about writing this book, it was a no brainer; of course I would. Why? Why not? A book about mobile development using Xamarin.Android; I'm in! I have to admit, I didn't start here; it was a journey for me.

I've always been keen on cross-platform development environments. I'm not really fond of learning new ways to do the same thing using a different syntax unless there is significant productivity gains associated with it. Ten years ago, the foregone conclusion for most was that cross-platform development belonged to Java; I was on board with that. Had anyone told me that in 2013, with the rise of mobile computing, I would be doing all my cross-platform mobile development with C#, I would have laughed. So, how did I get here?

It started in 2010. I was struggling with Objective-C, trying to get an iOS prototype up and running. One day, I described the prototype to a colleague, Ed Tighe. Ed suggested that I look into MonoTouch. As I recall, the conversation went something as follows:

Me: MonoTouch? What is that?

Ed: A Mono-based development environment for iOS.

Me: Mono… you mean Mono; as in the open source cross-platform C# thing?

Ed: That's the one.

Me: Is that still around? Who would trust Mono with a mission critical solution? What's the likelihood they will be around in four to five years?

Sometimes Ed says funny things; I chalked this one up to that. I was completely dismissive of the idea. It wasn't that I didn't respect what the Mono project and contributors had achieved; it was more about the overriding belief that at some point Microsoft would decide Mono did not need to exist and would work against its continued progress. I also had serious reservations about whether support and long term commercial viability was there. However, the one thing Mono had in its favor was a mass of C# developers that could adopt their platform with minimal investment.

In early 2012, I was approached by Andy LaBrunda, VP of IT, for a telecom-based on Guam, about developing mobile apps for prepaid customers. I knew they were a .NET shop and were looking for both iOS and Android apps with the possibility of a Windows Phone app in the future. I also knew they had a relatively small set of developers, who would be tasked with supporting the apps, and they already knew C#, .NET, and rich client development using WPF.

With all this in mind, it only made sense to consider MonoTouch and Mono for Android. The GTA staff would not have to learn Objective-C and Java, and we would achieve some level of reuse between the two apps, so we framed up a small proof of concept effort, the goal being to build two apps with only a few screens, hook the apps up to RESTful services, and share some code between the apps. As always, when I get to play with new technology, I am excited so I approached this effort with great optimism. I wasn't disappointed; the Xamarin products delivered on everything we set out to prove. I was sold and have never looked back. We built out the two prepaid apps and moved on to build out two postpaid apps.

Since then, I have spent significant time and energy building out my Xamarin practice, including writing this book. I've also taken what we learned at GTA and I'm now working with a company in the Dallas area in the entertainment industry building customer facing apps. With the recent strengthening of the relationship between Xamarin and Microsoft, I believe that Mono and the Xamarin product line have a bright future.

The idea behind this book was to bring the base set of knowledge required to build Android apps with Xamarin.Android together in a convenient, concise, productive format that could be used by those looking to get started with the product. I have always been a fan of learning experiences structured around building solutions, or examples, incrementally throughout the book so that the approach we settled on for this book. We begin with two chapters of general Android and Xamarin architecture and then step through building a Point of Interest app that demonstrates the basics of building Android apps, including some of the more interesting features such as integration with location services, the map app, and the camera app. Our goal has been to provide you with a productive learning experience; I hope we have achieved that and I thank you for taking the time to read it.

Oh! And one more thing on this topic; Ed, you were right.

What this book covers

Chapter 1, The Anatomy of an Android App, provides an overview of the Android platform and what Android apps are composed of.

Chapter 2, Xamarin.Android Architecture, describes the use of Mono, describes how Mono and the Dalvik runtime work together, and the Android platform coexist and allow developers to build Android apps using C#.

Chapter 3, Creating the Points of Interest App, walks the reader through creating a new app and running the app within the Android emulator.

Chapter 4, Creating a Data Storage Mechanism, presents a number of options for storing data on an Android device and steps the reader through creating a JSON-based solution.

Chapter 5, Adding a List View, describes Android's AdapterView architecture and steps the reader through using ListView and creating a custom adapter.

Chapter 6, Adding a Detail View, walks the reader through creating a detail view to view a point of interest, adding navigation from the list view, and adding actions for saving and deleting information.

Chapter 7, Making POIApp Location Aware, presents the various options that developers have to make their apps location aware and walks the reader through adding logic to determine a device's location and the address of a location, and displaying a location within the map app.

Chapter 8, Adding Camera App Integration, presents the various options that developers have to add integration with the device camera and walks the reader through adding integration with camera apps on device.

Chapter 9, Deploying Your App, discusses the various options for distributing Android apps and walks the reader through preparing a Xamarin.Android app for distribution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.202.187