Book Image

Cross-platform UI Development with Xamarin.Forms

By : Paul Johnson
Book Image

Cross-platform UI Development with Xamarin.Forms

By: Paul Johnson

Overview of this book

Table of Contents (22 chapters)
Cross-platform UI Development with Xamarin.Forms
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
In the Beginning…
Index

Preface

One of the pleasures of working in the mobile arena is the speed of development and the improvement in the toolchains. Being at the forefront of allowing the "write once, deploy many times" paradigm, Xamarin never sits still in making life easier for the developer.

Although having C# as the basis of writing code made the business logic (consider anything not to do with the user interface as the business logic) of an app much easier to cater to, it did leave a terrible chunk missing: to employ specialized developers for the UI. Then, the game changed.

There was a new technology out there, an uncharted territory, and that territory was Xamarin Forms. Instead of just one platform, with Xamarin Forms, we have three platforms. The dream of one language for all mobile devices comes another step closer. With Xamarin Forms, the mythical 100 percent code-sharing nirvana for the user interface and program is within reach.

What this book covers

Chapter 1, In the Beginning…, talks about planning your app from the backend to the frontend.

Chapter 2, Let's Get the Party Started, discusses views and gadgets. It teaches you how to add a Forms project to your current project in addition to the application life cycle, inversion of control, web views, and maps.

Chapter 3, Making It Look Pretty and Logging In, focusses on the UI abstraction. It shows you how to style your UI, custom renderers, triggers, and positioning.

Chapter 4, Making Your Application Portable, discusses the considerations for a PCL. It provides information on how to move code from a nonPCL to a PCL.

Chapter 5, Data, Generics, and Making Sense of Information, talks about everything you ever wanted to know about generics, but were too afraid to ask. This involves reflection and how to use LINQ to make the manipulation of data much simpler.

Chapter 6, A View to a Kill, takes the UI to the next level. This chapter demonstrates how to bring the Android application to Xamarin Forms in order to produce a universal app.

Chapter 7, Connect Me to Your Other Services, focusses on Azure, REST, and WCF.

Chapter 8, What a Bind! talks about the power behind a data-driven application.

Chapter 9, Addressing the Issue, discusses how to use the device address book.

Chapter 10, This is the World Calling…, focuses on how to use the device hardware with your Xamarin forms application using GPS and maps.

Chapter 11, A Portable Settings Class, talks about the different strategies to implement a settings system that will work on all platforms.

Chapter 12, Xamarin Forms Labs, takes a quick glimpse at how to extend the UI through the Xamarin Forms Labs community project.

Chapter 13, Social Media into the Mix, teaches you how to add Twitter and Facebook to your app.

Chapter 14, Bringing It All Together, brings all the parts of the app together, enabling you to create your own app.

What you need for this book

  • To make the best use of this book, you will need at least the indie version of Xamarin.

  • To compile for iOS, you will need a Mac or Mac in the cloud service.

  • The instructions for this can be found in the book for Windows users. You can also find the information on how to include the Xamarin.Forms libraries and how to add Xamarin.Forms for the Windows Phone project to your existing Xamarin.Forms project created under Xamarin Studio for Mac.

  • You can get a copy of the Xamarin installer at www.xamarin.com; follow the download links and download it for your preferred environment.

  • For Visual Studio users, you will need to install either VS 2013 or VS 2015 community editions. Both contain the required components that can be used with Xamarin.

Who this book is for

This book is for developers who no longer wish to be restricted to a single platform, but would rather be able to create once and deploy thrice. It is intended for those who don't wish to waste their time having to reinvent the wheel every time they wish to create an app for another platform.

Most of all, it's meant for those who just wish to write good apps.

Conventions

In this book, you will find a number of styles of text 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: " Click on upload, and upload the .p12 file you have just exported from the keychain tool."

A block of code is set as follows:

[<key>NSLocationAlwaysUsageDescription</key>
  <string>Can we use your location</string>
<key>NSLocationWhenInUseUsageDescription</key>
  <string>We are using your location</string>

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Select File | Export and give the file a name."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via 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 on www.packtpub.com/authors.

Customer support

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.

Downloading the example code

You can download the example code files for all Packt books you have purchased 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.

Errata

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 would 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 on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright 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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.