Throughout my journey as a mobile developer, I have worked with many different development paradigms and techniques. I have built mobile applications in Java, objective-C, Swift (2 and 3), and C# across all mobile platforms. I’ve even built entire servers for my mobile applications.
I'm not standing here to brag, or to say that I'm an expert. But I do believe that I have encountered a ton of problems, and built solutions that a lot of mobile developers will require.
My latest work has been around building cross-platform solutions with Xamarin using both native and Xamarin.Forms. I have spent a lot of time narrowing down, what I believe are the best approaches in building any cross-platform mobile application. Building good architecture, structure, and a smooth user experience, whilst sharing as much code as possible.
Enjoy.
Chapter 1, Building a Gallery Application, provides you a walkthrough for native development with Xamarin by building an iOS and Android application that will read from your local gallery files and display them into a UITableView and ListView.
Chapter 2, Build a SpeechTalk Application, provides you a walkthrough of Xamarin.Forms development by building an iOS, Android and Windows Phone application that will use platform speech services to talk text typed into a text field.
Chapter 3, Building a GPS Locator Application, shows you how to build a Xamarin.Forms application that integrates native GPS location services and Google Maps APIs. We will cover more content on IoC containers, the Xamarin.Forms.Maps library, and techniques for C# async and background tasks.
Chapter 4, Building an Audio Player Application, in this chapter, we will integrate native audio functions for processing a sound file using the AVFramework in iOS, and MediaPlayer framework in Android.
Chapter 5, Building a Stocklist Application, in this chapter we look at detailing our XAML interfaces using CustomRenderers, Styles, and ControlTemplates. We also build a simple web service and setup a JSON feed for our mobile application.
Chapter 6, Building a Chat Application, in this chapter our user interface will move away from MVVM design and follow a new paradigm called MVP (Model-View-Presenter). We take another step further into the backend and set up a SignalR hub and client to simulate a chat service, where data will be sent between the server and clients instantly as the messages become available. Another key topic of focus is the project architecture, spending time on separating the project into modules, and creating a nicely tiered structure that will maximize code sharing across different platforms.
Chapter 7, Building a File Storage Application, in this chapter we walk through more development using Xamarin.Forms. We look at Behaviors and their use with user interfaces. We also build a custom layout using the Layout <View> framework and build our first SQLite database for storing text files.
Chapter 8, Building a Camera Application, our last chapter, will introduce Effects and Triggers. We learn how to apply them to user interfaces and use them with Styles. We also build multiple complex CustomRenderers for native platform cameras, tinting images and receiving touch events.
Xamarin Studio
To install a copy of Xamarin Studio visit the following link:
https://www.xamarin.com/download
Building Windows Phone Applications
In order to build windows phone applications, you will need a computer with Windows, Microsoft Visual Studio, and the Universal Windows Platform SDK installed.
Running solutions
You will also need an iOS, android and windows phone device for testing. If you don’t have access to devices, you will have to install simulators for each platform.
iOS
Simulators can be installed via XCode. If you haven’t got XCode installed, you will need to install a fresh copy.
Android
Please install a copy of Geny Motion from the link below:
Windows Phone
The UWP SDK comes with simulators for Microsoft Visual Studio.
If you are a mobile developer looking to create interesting and fully featured apps for different platforms, then this book is the ideal solution for you. A basic knowledge of Xamarin and C# programming is assumed.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Yes, it is our AppDelegate
file; notice the .cs
on the end."
A block of code is set as follows:
private void handleAssetsLoaded (object sender, EventArgs e) { _source.UpdateGalleryItems (_imageHandler.CreateGalleryItems()); _tableView.ReloadData (); }
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "To do so, we simply select File | New | Solution and select an iOS Single View App."
Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
Log in or register to our website using your e-mail address and password.
Hover the mouse pointer on the SUPPORT tab at the top.
Click on Code Downloads & Errata.
Enter the name of the book in the Search box.
Select the book for which you're looking to download the code files.
Choose from the drop-down menu where you purchased this book from.
Click on Code Download.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR / 7-Zip for Windows
Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Xamarin-Blueprints. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.