Creating Mobile Apps with Xamarin.Forms

Total Page:16

File Type:pdf, Size:1020Kb

Creating Mobile Apps with Xamarin.Forms Creating Mobile Apps with Xamarin.Forms 2 Cross-platform C# programming for iOS, Android, and Windows Phone CHARLES PETZOLD PREVIEW EDITION This excerpt provides early content from a book currently in development and is still in draft format. See additional notice below. PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2015 Xamarin, Inc. All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. ISBN: 978-0-7356-9723-2 Microsoft Press books are available through booksellers and distributors worldwide. Please tell us what you think of this book at http://aka.ms/tellpress. This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document, including URL and other Internet website references, is subject to change without notice. The entire risk of the use or the results from the use of this document remains with the user. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distrib- utors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under cop- yright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty/ Trade- marks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their re- spective owners. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distrib- utors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions and Project Editor: Devon Musgrave Editorial production: John Pierce, Flying Squirrel Press Cover illustration: Serena Zhang Table of contents Introduction ....................................................................................................................... viii Who should read this book ...................................................................................................................................................... viii Conventions and features in this book ................................................................................................................................ viii The 1st and 2nd Preview Editions ............................................................................................................................................... ix System requirements ..................................................................................................................................................................... ix Downloads: Code samples ............................................................................................................................................................ x Updating the code samples ..................................................................................................................................................... x Big changes coming for Windows Phone ........................................................................................................................ xi Acknowledgments .......................................................................................................................................................................... xi Free ebooks from Microsoft Press ........................................................................................................................................... xii We want to hear from you ......................................................................................................................................................... xii Chapter 1 How does Xamarin.Forms fit in? .............................................................. 1 Cross-platform mobile development ....................................................................................................................................... 2 The mobile landscape................................................................................................................................................................ 2 Problem 1: Different user-interface paradigms .............................................................................................................. 2 Problem 2: Different development environments ......................................................................................................... 3 Problem 3: Different programming interfaces ................................................................................................................ 3 Problem 4: Different programming languages ............................................................................................................... 3 The C# and .NET solution ............................................................................................................................................................. 4 A single language for all platforms ...................................................................................................................................... 5 Sharing code ................................................................................................................................................................................. 6 Introducing Xamarin.Forms ......................................................................................................................................................... 8 The Xamarin.Forms option ...................................................................................................................................................... 8 XAML support ............................................................................................................................................................................. 10 Platform specificity ................................................................................................................................................................... 12 A cross-platform panacea? .................................................................................................................................................... 12 Your development environment ............................................................................................................................................. 13 Table of contents iii Machines and IDEs ................................................................................................................................................................... 13 Devices and emulators ............................................................................................................................................................ 14 Installation ........................................................................................................................................................................................ 14 Creating an iOS app ................................................................................................................................................................. 15 Creating an Android app ....................................................................................................................................................... 15 Creating a Windows Phone app ......................................................................................................................................... 16 All ready? ...................................................................................................................................................................................... 16 Chapter 2 Anatomy of an app .................................................................................... 17 Say hello ............................................................................................................................................................................................ 17 Inside the files ................................................................................................................................................................................. 20 The iOS Project .........................................................................................................................................................................
Recommended publications
  • Volume 2014, No. 1 Law Office Computing Page Puritas Springs Software Law Office Computing
    Volume 2014, No. 1 Law Office Computing Page Puritas Springs Software Law Office Computing VOLUME 2014 NO. 1 $ 7 . 9 9 PURITAS SPRINGS SOFTWARE Best Home Pages We think the importance of the through which you accessed INSIDE THIS ISSUE: home page has been greatly the world wide web. Once 1-3 reduced due to the invention of tabbed browsers arrived on the tabbed browsers. Although scene it was possible to create 1,4,5 conceived a group of 4 earlier in 1988, home pages Digital Inklings 6,7 tabbed brows- with each page Child Support 8 ing didn’t go being able to Spousal Support 10 mainstream “specialize” in a Uniform DR Forms 12 until the re- specific area of lease of Micro- your interest. Family Law Documents 13 soft’s Windows Take the Probate Forms 14 Internet Ex- weather for Ohio Estate Tax 16 plorer 7 in example. Every U.S. Income Tax (1041) 18 2006. Until then, your Home good home page should have Ohio Fiduciary Tax 19 page was the sole portal a minimal weather information; (Continued on page 2) Ohio Adoption Forms 20 OH Guardianship Forms 21 OH Wrongful Death 22 Loan Amortizer 23 # More Law Office Tech Tips Advanced Techniques 24 Deed & Document Pro 25 Bankruptcy Forms 26 XX. Quick Launch. The patch the application that you’re Law Office Management 28 of little icons to the right of the working in is maximized. If OH Business Forms 30 Start button is called the Quick you’re interested, take a look Launch toolbar. Sure, you can at the sidebar on page XX of Business Dissolutions 31 put much-used shortcuts on this issue.
    [Show full text]
  • Surface Pro Et Surface Pro 2 Guide De L'utilisateur
    Surface Pro et Surface Pro 2 Guide de l’utilisateur Avec Windows 8.1 Professionnel Date de publication : Octobre 2013 Version 2.0 © 2013 Microsoft. Tous droits réservés. BlueTrack Technology, ClearType, Excel, Hotmail, Internet Explorer, Microsoft, OneNote, Outlook, PowerPoint, SkyDrive, Windows, Xbox et Xbox Live sont des marques déposées de Microsoft Corporation. Surface, Skype et Wedge sont des marques commerciales de Microsoft Corporation. Bluetooth est une marque déposée de Bluetooth SIG, Inc. Dolby et le symbole double-D sont des marques déposées de Dolby Laboratories. Ce document est fourni « en l’état ». Les informations contenues dans ce document, y compris les URL et d’autres références à des sites Web Internet, sont susceptibles d’être modifiées sans préavis. © 2013 Microsoft Page ii Sommaire DECOUVREZ SURFACE PRO ............................................................................................................................................1 À PROPOS DE CE GUIDE ........................................................................................................................................................................................ 1 CARACTERISTIQUES DE SURFACE PRO ................................................................................................................................................................ 2 CONFIGURATION DE VOTRE SURFACE PRO ................................................................................................................5 BRANCHEMENT ET ALLUMAGE ............................................................................................................................................................................
    [Show full text]
  • Security Policy for FIPS 140-2 Validation
    Cryptographic Primitives Library Security Policy for FIPS 140-2 Validation Cryptographic Primitives Library (bcryptprimitives.dll and ncryptsslp.dll) in Microsoft Windows 8.1 Enterprise Windows Server 2012 R2 Windows Storage Server 2012 R2 Surface Pro 3 Surface Pro 2 Surface Pro Surface 2 Surface Windows RT 8.1 Windows Phone 8.1 Windows Embedded 8.1 Industry Enterprise StorSimple 8000 Series Azure StorSimple Virtual Array Windows Server 2012 R2 DOCUMENT INFORMATION Version Number 2.1 Updated On April 20, 2017 30 March 2017 © 2017 Microsoft. All Rights Reserved Page 1 of 45 This Security Policy is non-proprietary and may be reproduced only in its original entirety (without revision). Cryptographic Primitives Library The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. This work is licensed under the Creative Commons Attribution-NoDerivs- NonCommercial License (which allows redistribution of the work). To view a copy of this license, visit http://creativecommons.org/licenses/by-nd-nc/1.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document.
    [Show full text]
  • Surface Pro 3 Fact Sheet May 2014
    Surface Pro 3 Fact sheet May 2014 Meet Surface Pro 3, the tablet that can replace your laptop. Wrapped in magnesium and loaded with a 12-inch ClearType Full HD display, 4th-generation Intel® Core™ processor and up to 8 GB of RAM in a sleek frame — just 0.36 inches thin and 1.76 pounds — with up to nine hours of Web-browsing battery life, Surface Pro 3 has all the power, performance and mobility of a laptop in an incredibly lightweight, versatile form. The thinnest and lightest member of the Surface Pro family, Surface Pro 3 features a large and beautiful 2160x1440 2K color-calibrated screen and 3:2 aspect ratio with multitouch input, so you can swipe, pinch and drag whenever you need. The improved optional Surface Pro Type Cover and more adjustable, continuous kickstand will transform your device experience from tablet to laptop in a snap. Surface Pro Type Cover features a double-fold hinge enabling you to magnetically lock it to the display’s lower bezel, keeping everything steady so you can work just as comfortably on your lap as you do at your desk. With a full-size USB 3.0 port, microSD card reader and Mini DisplayPort, you can quickly transfer files and easily connect peripherals like external displays. And with the optional Surface Ethernet Adapter, you can instantly connect your Surface to a wired Ethernet network with transfer rates of up to 1 Gbps1. The custom Surface Pen, crafted with a solid, polished aluminum finish, was designed to look and feel like an actual fountain pen to give you a natural writing experience.
    [Show full text]
  • 70-347.Microsoft
    70-347.microsoft Number : 70-347 Passing Score : 800 Time Limit : 120 min https://www.gratisexam.com/ Sections 1. Manage clients and end-user devices 2. Provision SharePoint Online site collections 3. Configure Exchange Online and Lync Online for end users 4. Plan for Exchange Online and Lync Online https://www.gratisexam.com/ Exam A QUESTION 1 DRAG DROP You are the Office 365 administrator for a company. Employees are allowed to purchase a desktop computer of their choosing. The company’s owner has one desktop computer, two laptop computers, one Surface RT device, and 2 Surface Pro 2 devices. You plan to deploy Office ProPlus. You provide each user with an Office 365 ProPlus license. You need to deploy Office 365 ProPlus to the unlicensed devices using the fewest number of licenses possible. https://www.gratisexam.com/ What should you do? To answer, move the appropriate license to the correct device. Each license may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. Select and Place: https://www.gratisexam.com/ Correct Answer: https://www.gratisexam.com/ Section: Manage clients and end-user devices Explanation Explanation/Reference: Explanation: Each Office 365 ProPlus license allows a user to install Office on up to five computers. If the user decides to install Office 365 ProPlus on a sixth computer, she will need to deactivate one of the first five. References: https://technet.microsoft.com/en-us/library/gg982959.aspx QUESTION 2 HOTSPOT https://www.gratisexam.com/ Contoso, Ltd., has an Office 365 tenant.
    [Show full text]
  • Surface Pro X Fact Sheet October 2020
    Surface Pro X Fact Sheet October 2020 Meet the future of always-connected productivity. Wherever life leads you, be ready for anything with Surface Pro X. With blazing-fast Gigabit LTE connectivity,1 our thinnest Surface Pro features two USB-C® ports and a stunning, virtually edge-to-edge 13” touchscreen, plus choice of a new platinum finish and keyboard colors.2 What’s new? • Surface Pro X introduces the Microsoft SQ®2, the second generation of our custom chip on our premium configurations, building on the innovation of the Microsoft SQ® 1, delivering even more multi-tasking power for true connected productivity. • Surface Pro X is now available in a new Platinum finish in addition to Matte Black, and Surface Pro X Keyboards are now available in three new colors2: Ice Blue, Poppy Red, and Platinum, in addition to Black. • In addition to refreshing our top-end SKUs, additional software improvements will benefit all customers of Surface Pro X: o Increased battery life that now delivers up to 15 hours of typical usage.3 o Increasing number of key app partners are embracing Windows on ARM and taking advantage of the power and performance benefits of Microsoft SQ® 1 and Microsoft SQ® 2 and bringing new experiences for all Surface Pro X customers – current and new, including new Microsoft 365 applications4 optimized for Windows on ARM such as Microsoft Edge and Microsoft Teams which provides improved performance and reliability. o For developers, Visual Studio Code4 has updated and optimized for Windows on ARM. The new VS Code, paired with WSL2 and the Windows Terminal make Surface Pro X the ideal modern dev box.
    [Show full text]
  • The New Surface Pro
    The new Surface Pro The most versatile laptop Discover the new Surface Pro A device with the versatility to let you work on your own terms. Uncompromising mobility The new Surface Pro gives you everything you need in terms Now supported by LTE connectivity2, up to 50% more battery life3 of performance, mobility, security and reliability. A best-in- than Surface Pro 4, and an ultra-light design, the new Surface class laptop with the creative freedom of a studio, and the Pro redefines mobile working. Work from virtually anywhere. convenience of a tablet. All in one. Exceptional power and performance The new Surface Pro gives you the power to run all the applications you rely on. Experience up to 20% more performance What it means for your business than Surface Pro 4 thanks to the latest, powerful Intel® Core™ processor and bring your ideas to life with the stunningly Modernize your business responsive PixelSense™ Display. With a core, connected device that will enable digital-first workflows, streamline tasks, and help you project a modern The best of Microsoft at your fingertips face to your customers. Surface is easy to deploy and manage, Choose the laptop with all of your familiar Office 3654 applications and comes standard with enterprise-grade security. and Windows 10 security you and your customers can depend on. Enjoy fast, secured, password-free sign-in with Windows Hello. Empower your employees Surface Pen4 and Surface Dial4 help you make the most of the full, Seize the power of the group with superior collaboration interactive Windows experience.
    [Show full text]
  • 2-In-1 Accessory Kit for Surface and Surface Pro
    2-in-1 Accessory Kit for Surface and Surface Pro Product ID: MSTS3MDPUGBK Get more from your Microsoft Surface™ Pro 4 or Surface Book (backward compatible with Surface Pro 3, Surface 3 and Surface Pro 2) by adding HDMI® and VGA video compatibility as well as wired network connectivity. Connect your Surface to virtually any display You can maximize the versatility of your Microsoft Surface by ensuring that you can connect to virtually any monitor, projector or television. This accessory kit ensures that you're ready to connect to any HDMI or VGA display using the Mini DisplayPort output on your Surface Pro 4, Surface Pro 3 or Surface 3 making it the perfect solution when you're traveling between boardrooms, home and remote offices, trade-shows, hotels and conference centers. Hard-wire your network connection Get the speed and reliability of a hardwired Ethernet connection with your Surface Pro 4. This Surface accessory kit includes a reliable USB 3.0 to Gigabit Ethernet adapter, which adds wired network support that's ideal for BYOD hot-desking, or use as an on-the-go dock solution to enhance your workstation. www.startech.com 1 800 265 1844 The adapter also includes an extra USB 3.0 port built-in, so you can add a USB peripheral device, such as a flash drive for added storage, or a mouse for increased control. Maximize portability Your Microsoft Surface is one of the most versatile and portable computers in the world. Don't be tied down by accessories that require an external power adapter, or a bulky housing.
    [Show full text]
  • Surface Pro User Guide
    Surface Pro y Surface Pro 2 Manual del usuario Con el software Windows 8.1 Pro Fecha de publicación: enero de 2014 Versión 2.0 © 2014 Microsoft. Todos los derechos reservados. BlueTrack Technology, ClearType, Excel, Hotmail, Internet Explorer, Microsoft, OneNote, Outlook, PowerPoint, SkyDrive, Windows, Xbox y Xbox Live son marcas registradas de Microsoft Corporation. Surface, Skype y Wedge son marcas comerciales de Microsoft Corporation. Bluetooth es una marca comercial registrada de Bluetooth SIG, Inc. Dolby y el símbolo de doble D son marcas comerciales registradas de Dolby Laboratories. Este documento se proporciona "tal cual". La información que contiene este documento, incluidas las direcciones URL y otras referencias de sitios web de Internet, puede cambiar sin previo aviso. © 2014 Microsoft Página ii Contenido INTRODUCCIÓN A SURFACE PRO .................................................................................................................................1 ACERCA DE ESTE MANUAL .................................................................................................................................................................................... 1 CARACTERÍSTICAS DE SURFACE PRO ................................................................................................................................................................... 2 CONFIGURACIÓN DE SURFACE PRO .............................................................................................................................5 CONEXIÓN Y ENCENDIDO
    [Show full text]
  • Surface Pro User Guide
    Surface Pro User Guide Published: April 30, 2013 Version 1.01 © 2013 Microsoft. All rights reserved. BlueTrack Technology, ClearType, Excel, Hotmail, Internet Explorer, Microsoft, OneNote, Outlook, PowerPoint, SkyDrive, Windows, Xbox, and Xbox Live are registered trademarks of Microsoft Corporation. Surface, VaporMg, Skype, and Wedge are trademarks of Microsoft Corporation. Bluetooth is a registered trademark of Bluetooth SIG, Inc. This document is provided “as-is.” Information in this document, including URL and other Internet Web site references, may change without notice. © 2013 Microsoft Page ii Contents Meet Surface Pro ............................................................................................................................... 1 About this guide ........................................................................................................................... 1 Highlights ........................................................................................................................................ 2 What is Windows 8 Pro? ............................................................................................................ 4 Surface accessories ...................................................................................................................... 4 Setup ...................................................................................................................................................... 6 Plug in and turn on ....................................................................................................................
    [Show full text]
  • Surface Pro and Surface Pro 2 User Guide with Windows 8.1 Pro Software
    Surface Pro and Surface Pro 2 User Guide With Windows 8.1 Pro Software Published: March 2014 Version 2.0 © 2014 Microsoft. All rights reserved. BlueTrack Technology, ClearType, Excel, Hotmail, Internet Explorer, Microsoft, OneNote, Outlook, PowerPoint, OneDrive, Windows, Xbox, and Xbox Live are registered trademarks of Microsoft Corporation. Surface, Skype, and Wedge are trademarks of Microsoft Corporation. Bluetooth is a registered trademark of Bluetooth SIG, Inc. Dolby and the double-D symbol are registered trademarks of Dolby Laboratories. This document is provided “as-is.” Information in this document, including URL and other Internet Web site references, may change without notice. © 2014 Microsoft Page ii Contents MEET SURFACE PRO ........................................................................................................................................................1 ABOUT THIS GUIDE ................................................................................................................................................................................................ 1 SURFACE PRO FEATURES ....................................................................................................................................................................................... 2 SET UP YOUR SURFACE PRO ..........................................................................................................................................5 PLUG IN AND TURN ON .......................................................................................................................................................................................
    [Show full text]
  • Creating Mobile Apps with Xamarin.Forms
    PREVIEW EDITION This excerpt provides early content from a book currently in development and is still in draft format. See additional notice below. PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2014 Xamarin, Inc. All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. ISBN: 978-0-7356-9725-6 Microsoft Press books are available through booksellers and distributors worldwide. Please tell us what you think of this book at http://aka.ms/tellpress. This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document, including URL and other Internet website references, is subject to change without notice. The entire risk of the use or the results from the use of this document remains with the user. This ERRNH[SUHVVHVWKHDXWKRU·s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
    [Show full text]