Xamarin Blueprints

Author: Michael Williams  

Publisher: Packt Publishing‎

Publication year: 2016

E-ISBN: 9781785889486

P-ISBN(Paperback): 9781785887444

Subject: TP301.6 algorithm theory;TP31 computer software;TP312 程序语言、算法语言

Keyword: 程序语言、算法语言,自动化技术、计算机技术,算法理论,计算机软件

Language: ENG

Access to resources Favorite

Disclaimer: Any content in publications that violate the sovereignty, the constitution or regulations of the PRC is not accepted or approved by CNPIEC.

Chapter

Create an iOS project

Creating a UIViewController and UITableView

Customizing a cell's appearance

Creating an Android project

Creating an XML interface and ListView

Shared projects

Custom row appearance

Bitmap functions

The ALAssetLibrary

Adding the iOS photo screen

Adding the Android photo screen

Summary

Chapter 2: Building a SpeechTalk Application

Cross-platform development with Xamarin.Forms

So how would this look in Xamarin.Forms?

Setting up platform projects

So what is happening here?

Setting up the SpeechTalk.iOS project

Setting up the SpeechTalk.Droid project

Xamarin.Forms, Windows Phone, and Visual Studio

What can we see here?

Inversion of Control (IoC) with Xamarin.Forms

So why should we use it?

So how do we benefit from this?

Autofac

iOS text-to-speech implementation

Bindings

Android text-to-speech implementation

Setting up IoC with Android

WinPhone text-to-speech implementation

IoC with Windows Phone

Platform independent styling

Summary

Chapter 3: Building a GPS Locator Application

Core location and GPS

Project setup

Navigation with Xamarin.Forms

Why would we do this?

Building the navigation control

View model navigation

Integrating Google Maps using Xamarin.Forms.Maps

Reactive Extensions

Core location with iOS and the CLLocationManager library

Handling location updates

Android and the LocationManager

Creating an exit point

Creating an API key for Android

Creating our Windows project

Core Location Services with Windows Phone

The Application class

Web services and data contracts

What about data contracts?

Creating another API key for geocoding

Creating GeocodingWebServiceController

Newtonsoft.Json and Microsoft HTTP client libraries

ModernHttpClient and client message handlers

Feeding JSON data into the IObservable framework

More Reactive Extensions

Resource (RESX) files

Using GeocodingWebServiceController

OnNavigatedTo and OnShow

Pythagoras equirectangular projection

How are we going to calculate the closest position?

Summary

Chapter 4: Building an Audio Player Application

Solution setup

Inversion of control with MVVMCross

View-models with Xamarin native

Creating the bindings

NSLayoutContraints

MVVMCross setup inside the PCL

Setting up MVVMCross with iOS

Setting up MVVMCross with Android

The SoundHandler interface

Implementing the iOS SoundHandler using the AVAudioPlayer framework

The Mvx IoC container

The audio player

A cleaner code approach to NSLayout

Creating AudioPlayerPageViewModel

Implementing the Android SoundHandler using the MediaPlayer framework

XML and Mvx bindings

MvxActivities

Summary

Chapter 5: Building a Stocklist Application

Understanding the backend

Creating an ASP.Net Web API 2 project

Building an API controller

Setting up the mobile projects

Building core mobile projects

Improving app performance

Creating a global App.xaml

Theming with ControlTemplates

Updating the MainPageViewModel

Creating the Stocklist web service controller

ListViews and ObservableCollections

Value converters

Adding a DataTemplate to the global resource dictionary

Styles

Further optimization with XAML

Creating StockItemDetailsPage

Custom renderers

Adding styles for custom elements

Creating StockItemDetailsPageViewModel

Setting up the native platform projects

Hosting the Web API project locally

Summary

Chapter 6: Building a Chat Application

The Model-View-Presenter (MVP) pattern

So why bother with this approach?

Architecture

How do we determine which layers our project needs?

SignalR

Starting with Open Web Interface for .NET (OWIN)

Creating an authorization server using OWIN OAuth 2.0

OAuthAuthorizationServerProvider

Use OAuthBearerAuthentication

Setting up the AuthenticationRepository

Configuring the Web API

Building the AccountController

Configuring OAuth Authentication with our Web API

Building the SignalR Hub

Setting up mobile projects

Creating the SignalRClient

Building the WebApiAccess layer

Application state

Setting up the navigation service

Building the iOS navigation service

Building the Android navigation service

Building the iOS interface

Handling Hub proxy callbacks

Implementing the LoginPresenter

Creating the connection between Presenter and View

Building the LoginActivity

Implementing the ClientsListPresenter

Creating ClientListViewController

The TaskCompletionSource framework

Creating the ClientsListActivity

Overriding the OnBackPressed activity

Building the ListAdapter

Building the ChatPresenter

Building the iOS ChatView

Extending the UIColor framework

Android TableLayouts

Building the Android ChatActivity

Running the server and clients

Summary

Chapter 7: Building a File Storage Application

Project structure setup

Building a data access layer using SQLite

Building the ISQLiteStorage interface

Adding additional threading techniques

How do we solve this problem?

Creating the AsyncSemaphore

Creating the AsyncLock

Implementing native setup requirements for SQLite

Implementing the IoC container and modules

Implementing cross-platform logging

Implementing the SQLiteStorage class

Introduction to C# 6.0 syntax

Handling alerts in view-models

Building the IMethods interface

Building the ExtendedContentPage

Why are we implementing two different techniques for showing alerts?

Building a CarouselView using custom layouts

Adding scroll control to the CarouselView

Building a CustomRenderer for native gestures

Building the user interface

Using a SynchronizationContext

How do we know this context is from the main UI thread?

Building the EditFilePage

Behaviours

Challenge

Building the Windows Phone version

Summary

Chapter 8: Building a Camera Application

Solution setup

Building the MainPageViewModel class

Improving the INotifiedPropertyChanged implementation

Creating the custom UI objects

Building the FocusView

Xamarin.Forms animations

Xamarin.Forms compound animations

Building the CameraView

Building a control for the iOS camera

Building the iOS CameraRenderer

Integrating the Android Camera2 framework

Building the CameraViewRenderer in Android

Handling native touch events through the FocusView

Using RX to handle events

Building a VisualElementRenderer for iOS

Building the CustomImageRenderers

Building the UIImageEffects class

Building the CustomImageRenderer for Android

Triggers

Easing.SinIn

Easing.SinOut

Platform effects

Building the CameraPage

Adding native orientation events

Challenge

Summary

Index

The users who browse this book also browse