Xamarin Mobile Development for Android Cookbook
eBook - ePub

Xamarin Mobile Development for Android Cookbook

  1. 456 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Xamarin Mobile Development for Android Cookbook

About this book

Over 80 hands-on recipes to unleash full potential for Xamarin in development and monetization of feature-packed, real-world Android apps

About This Book

  • Create a number of Android applications using the Xamarin Android platform
  • Extensively integrate your Android devices with other Android devices to enhance your app creation experience
  • A comprehensive guide packed with real-world scenarios and pro-level practices and techniques to help you build successful Android apps

Who This Book Is For

If you are a Xamarin developer who wants to create complete Android applications with Xamarin, then this book is ideal for you. No prior knowledge of Android development is needed, however a basic knowledge of C# and.NET would be useful.

What You Will Learn

  • Install and use Xamarin.Android with Xamarin Studio and Visual Studio
  • Design an app's user interface for multiple device configurations
  • Store and protect data in databases, files, and on the cloud
  • Utilize lists and collections to present data to the user
  • Communicate across the network using NFC or Bluetooth
  • Perform tasks in the background and update the user with notifications
  • Capture and play multimedia, such as video and audio, with the camera
  • Implement In-App Billing and Expansion Files and deploy to the store

In Detail

Xamarin is used by developers to write native iOS, Android, and Windows apps with native user interfaces and share code across multiple platforms not just on mobile devices, but on Windows, Mac OS X, and Linux.

Developing apps with Xamarin.Android allows you to use and re-use your code and your skills on different platforms, making you more productive in any development. Although it's not a write-once-run-anywhere framework, Xamarin provides native platform integration and optimizations. There is no middleware; Xamarin.Android talks directly to the system, taking your C# and F# code directly to the low levels.

This book will provide you with the necessary knowledge and skills to be part of the mobile development era using C#. Covering a wide range of recipes such as creating a simple application and using device features effectively, it will be your companion to the complete application development cycle.

Starting with installing the necessary tools, you will be guided on everything you need to develop an application ready to be deployed. You will learn the best practices for interacting with the device hardware, such as GPS, NFC, and Bluetooth. Furthermore, you will be able to manage multimedia resources such as photos and videos captured with the device camera, and so much more! By the end of this book, you will be able to create Android apps as a result of learning and implementing pro-level practices, techniques, and solutions. This book will ascertain a seamless and successful app building experience.

Style and approach

This book employs a step-by-step approach to Android app creation, explained in a conversational and easy-to-follow style. A wide range of examples are listed to ensure a complete understanding of how to deploy competent apps on the Android market.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Xamarin Mobile Development for Android Cookbook


Table of Contents

Xamarin Mobile Development for Android Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Working with Xamarin.Android
Introduction
Creating Xamarin.Android projects
Getting ready
How to do it...
How it works...
Creating user interface layouts
How to do it...
How it works...
There's more...
See also
Creating an options menu
How to do it...
How it works...
Supporting previous Android versions
How to do it...
How it works...
There's more...
Adding an action bar
How to do it...
How it works...
There's more...
See also
Navigating with the action bar
How to do it...
How it works...
There's more...
See also
Adding action bar action items
How to do it...
How it works...
Creating contextual action mode menu
How to do it...
How it works...
There's more...
See also
Creating contextual action mode menus
How to do it...
How it works...
There's more...
See also
Sharing code with other platforms
How to do it...
How it works...
2. Showing Views and Handling Fragments
Introduction
Using custom views with layouts
How to do it...
How it works...
There's more...
See also
Creating and using fragments
Getting ready
How to do it...
How it works...
See also
Preserving view and fragment state
How to do it...
How it works...
There's more...
See also
Navigating between fragments
How to do it...
How it works...
See also
Fragments and the action bar
How to do it...
How it works...
See also
Animating fragment navigation
How to do it...
How it works...
See also
Animating view and object properties
How to do it...
How it works...
There's more...
See also
Animating views on the UI
How to do it...
How it works...
There's more...
Adding a navigation drawer with fragments
How to do it...
How it works...
See also
Applying local styles and global themes
How to do it...
How it works...
3. Managing App Data
Introduction
Storing data with SharedPreferences
How to do it...
How it works...
There's more...
Using files and the filesystem
How to do it...
How it works...
There's more...
Reading bundled assets and resources
How to do it...
How it works...
See also
Parsing, processing, and generating XML
Getting ready
How to do it...
How it works...
There's more...
See also
Accessing data with ADO.NET
Getting ready...
How to do it...
How it works...
See also
Accessing data with SQLite.NET
How to do it...
How it works...
There's more...
See also
Encrypting databases with SQLCipher
How to do it...
How it works...
See also
Consuming content providers
Getting ready...
How to do it...
How it works...
There's more...
See also
Creating content providers
How to do it...
How it works...
See also
Backing up preferences and files to the cloud
How to do it...
How it works...
There's more...
See also
Backing up data to the cloud
Getting ready...
How to do it...
How it works...
There's more...
See also
4. Presenting App Data
Introduction
Implementing a ListView
How to do it...
How it works...
There's more...
See also
Using a SimpleAdapter
How to do it...
How it works...
There's more...
See also
Using custom ListView items
How to do it...
How it works...
There's more...
See also
Using a BaseAdapter with arbitrary data
How to do it...
How it works...
There's more...
See also
Using a CursorAdapter
How to do it...
How it works...
There's more...
See also
Optimizing the ListView
How to do it...
How it works...
There's more...
See also
Enabling fast scrolling
How to do it...
How it works...
There's more...
See also
Using section indexes
How to do it...
How it works...
There's more...
See also
Integrating app searchability
How to do it...
How it works...
There's more...
5. Communicating with the Outside World
Introduction
Consuming REST services with HttpClient
Getting ready
How to do it...
How it works...
See also
Obtaining a network state
How to do it...
How it works...
There's more...
See also
Handling network state changes
How to do it...
How it works...
There's more...
See also
Using DownloadManager
How to do it...
How it works...
See also
Accessing Bluetooth
How to do it...
How it works...
There's more...
See also
Transferring data via Bluetooth
How to do it...
How it works...
There's more...
See also
Receiving NFC events
Getting ready
How to do it…
How it works...
There's more...
See also
Writing NFC tags
How to do it...
How it works...
There's more...
See also
Transferring data via NFC
How to do it...
How it works...
Obtaining location coordinates and addresses
How to do it...
How it works...
There's more...
6. Using Background Tasks
Introduction
Asynchronous tasks
How to do it...
How it works...
There's more...
See also
Starting services
How to do it...
How it works...
There's more...
See also
Stopping services
How to do it...
How it works...
See also
Handling simultaneous service requests
How to do it...
How it works...
See also
Starting services automatically
How to do it...
How it works...
See also
Communicating with running services
How to do it...
How it works...
There's more...
See also
Critical services
How to do it...
How it works...
There's more...
7. Notifying Users
Introduction
Toasts
How to do it...
How it works...
There's more...
Alert dialogs
How to do it...
How it works...
There's more...
Alert fragments
Getting ready
How to do it...
How it works...
There's more...
See also
Embedded alert fragments
Getting ready
How to do it...
How it works...
There's more...
Selection alerts
How to do it...
How it works...
The notification builder
Getting ready
How to do it...
How it works...
There's more...
Ongoing notifications
Getting ready...

Table of contents

  1. Xamarin Mobile Development for Android Cookbook

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Xamarin Mobile Development for Android Cookbook by Matthew Leibowitz in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Languages. We have over one million books available in our catalogue for you to explore.