Book Image

Learning Xamarin studio

By : William Smith
Book Image

Learning Xamarin studio

By: William Smith

Overview of this book

Table of Contents (16 chapters)
Learning Xamarin Studio
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

There are a number of options available for the developer who wants to create cross-platform mobile applications. The most obvious solution is to go native and develop on the platform directly, and this approach has some very significant advantages. For one, nothing is going to run as fast and efficiently as a native app. Also, your applications will have full access to everything the OS and hardware have to offer. However, cross-platform native development presents a serious complication—multiple platforms mean multiple applications written in multiple languages, possibly even by multiple development teams.

This was painfully true a few years ago, but not any longer. Now we have Xamarin Studio that allows us to use one technology to create native applications for multiple platforms. All of our work can be built using .NET, so there's no need to learn Objective-C or Java, or have multiple applications and development teams.

As is the case with any new tool or technology, installing and integrating Xamarin Studio into your workflow takes time. The purpose of this book is to remove the guesswork from that process by walking through the most complex and confusing portions. We'll begin with a detailed walkthrough of installing and configuring Xamarin Studio. This walkthrough will include integrating third-party software and tools, setting up your developer accounts, setting up simulators and emulators, and preparing your physical devices for testing. Next, we'll take a detailed look at the IDE itself including basic functionality, environment variables, and user preferences. Finally, we'll look at how to use Xamarin Studio to deploy your applications. This will include a review of the various testing tools available in Xamarin Studio, and a walkthrough of the actual deployment process to several application marketplaces.

So, for the moment, please ignore the fanatics who insist that C, memory pointers, and manual memory management are the tools that define a "real" programmer. Your average users (paying customers) don't care what language or technology you built the app on; they care about more practical things. Does the app have a clean UI with a user friendly workflow? Is the app consistent and reliable? Is the app fast? Does the app meet my needs at a fair price? Apps built with Xamarin Studio can answer yes to all of these questions just as readily as an app built using a native language.

What this book covers

Chapter 1, Installing and Setting Up Xamarin Studio, begins by introducing the Xamarin licensing options available for purchase. Next, it will help you get started by walking you through the process of installing the Xamarin Studio and Xcode IDEs, setting up Apple and Google developer accounts, and installing the Android SDK Manager. Using these tools, you will walk through the process of setting up simulators, emulators, and devices for testing. Finally, this chapter will demonstrate setting up source control through Xamarin Studio.

Chapter 2, Learning and Customizing the XS Environment, will walk you through creating your first iOS and Android application using Xamarin Studio. Using the development of these applications as a context, you will learn about the various menus and features of the Xamarin Studio IDE. You will also learn about solution and project-level properties, as well as the environmental preferences you can use to customize your personal development workflow.

Chapter 3, Working with Xcode and the Android SDK, explains the key features and functions of Xcode and the Android SDK. A discussion on every aspect of these tools is beyond the scope of this book, unfortunately. Instead, this chapter will focus only on the critical functions necessary for Xamarin developers to successfully accomplish their cross-platform development goals.

Chapter 4, Plugins, Templates, Libraries, and Files, begins by introducing the Visual Studio plugin, and then explains how to connect to a networked Mac build machine. Following this, the various projects, libraries, and file types available for your applications are explained in detail. With a basic understanding of these components well in hand, you will be ready to explore how these components can be applied in your applications.

Chapter 5, Working with Xamarin.Forms, will introduce you to the Xamarin.Forms framework provided in Xamarin 3. By following the walkthroughs provided, you will build a fully functional cross-platform application in just a few minutes using XAML and the UI design API included with the framework.

Chapter 6, Application Lifecycle, details application states and application lifecycles for iOS and Android applications. This discussion might seem out of place in a book intended to introduce a development tool, but an understanding of this material is absolutely critical to successfully use Xamarin Studio to develop cross-platform mobile applications.

Chapter 7, Testing and Debugging, discusses the tools available in Xamarin Studio for testing including unit test projects, debugging tools, simulators and emulators, crash logs, TestFlight, and testing on physical devices. Additionally, two platform-specific suites of powerful testing tools are also discussed.

Chapter 8, Deployment, brings it all together by walking through the process of releasing your apps to the Apple and Google App Stores. In this chapter, you will learn how to use Xamarin Studio and other tools and utilities to create provisioning profiles and build configurations, bundle signing, and building for deployment. You will also learn about platform-specific tasks such as how to use iTunes Connect to release your application directly to the iStore.

Appendix, Images and Graphics Tables, details the specifications for images and graphics required to upload your finished applications to select marketplaces.

What you need for this book

To get the most from this book, you will need an active Internet connection to download the various components required to set up the development environment. Also, several of the examples will require an active Apple or Google Developer account.

In order to run the example code in this book, you will need, at a minimum, a PC running Windows 7 or higher and any non-Express version of Visual Studio 2010, 2012, or 2013. Additionally, if you intend to perform iOS or Mac development work, you will need a Mac running OS X Lion or higher. This Mac can be used as either a primary development environment, or can be paired with a PC to act as a networked build machine.

Who this book is for

If you are a developer who wants to get started using Xamarin Studio for cross-platform development with .NET, this is the book for you. Developers of any skill level or background will find this book useful to set up their development environment and learn to navigate the IDE. Some degree of programming knowledge, ideally in .NET languages, is assumed but not required.

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: "Open the HelloiPhoneViewController.cs file."

A block of code is set as follows:

#if DEBUG
[assembly: Application(Debuggable=true)]
#else
[assembly: Application(Debuggable=false)]
#endif

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: "The General pane allows you to define parameters, decide whether or not your app should run on an external console."

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.