windows windows phone azure … and more! @shahedc wakeupandcode.com

53
By Shahed Chowdhuri Sr. Technical Evangelist Azure Mobile Services (+ Universal Apps) Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Upload: blanca-jensen

Post on 13-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

By Shahed ChowdhuriSr. Technical Evangelist

Azure Mobile Services (+ Universal Apps)Windows Windows Phone Azure … and more!

@shahedC

WakeUpAndCode.com

Page 2: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Agenda

Intro: Cloud + Universal Apps

> Creating a Mobile Service> Consuming the Service> Publishing the Service

Q&A

Page 3: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Tools & Technologies

Page 4: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Introduction: The Cloud

Page 5: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

What is the Cloud?

“No one understandsthe Cloud!!!”

Page 6: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Cloud Services: IaaS, PaaS and SaaS    Host Build Consume

  Packaged Software

IaaS: infrastructure as a service

PaaS: Platform as a service

Saas: software as a service

Applications     Self-Managed

  Self-Managed

 Self-Managed

   ManagedBy Vendor

Data

Runtime    ManagedBy Vendor

Middleware

O/S

Virtualization  ManagedBy Vendor

Servers

Storage

Networking

Source: Bret Stateham, Windows Azure evangelist

Page 7: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

In Line with Microsoft’s Vision

“… mobile first, cloud first… ”

Microsoft CEO Satya Nadella

Page 8: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Universal Apps

Page 9: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

What is a Universal App?

"Apps that are tailored to people with disabilities"

"Apps that are automatically multi-lingual and culture adherent"

"Apps that can run on all platforms (iOS, Android, Windows)"

"A single app package that will work across Microsoft devices“

None of the Above?

Page 10: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Universal Apps for Windows

Universal Apps for Windows• 1 solution

• 1 shared project (no binary output)• 1 project per platform (separate binary output per platform)

• Windows, Windows Phone, Xbox One (coming soon!)

Ref: http://dev.windows.com/en-us/develop/Building-universal-Windows-apps

Page 11: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Benefits of Universal Apps• Pricing structure – Match Windows Phone pricing on Windows 8

• Shared in-app purchases – Buy IAPs only once, on either platform.

• Install across devices – Buy app only once, own across platforms

• Shared revenue model – Keep 70% of revenue

• Unified ad-units for Windows Phone and Windows apps

Ref: http://www.wpcentral.com/what-is-a-universal-windows-app

Page 12: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Streamlined Development

Page 13: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

“The platform enables a new class of Windows universal apps – apps that are truly written once, with one set of business logic and one UI. Apps that are delivered to one Store within one package.”

Universal Apps in Windows 10

More Info: http://www.windowscentral.com/microsoft-reveals-its-windows-10-universal-apps-plans-developers-mwc-2015

Page 14: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Visual Studio

Page 15: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

VS 2013 Update 2+

• C# and XAML• HTML5 & JavaScript• C++ and DirectX

Page 16: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Creating a Universal Project

Page 17: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

New Project

Windows 8.1 project

Windows Phone 8.1 project

Shared project

Page 18: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Existing Project

Windows 8.1 project?

Right-click Add Windows Phone 8.1…

Windows Phone 8.1 project?

Right-click Add Windows 8.1…

Page 21: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Sharing Code Across Universal Apps

Reference:• http://marcominerva.wordpress.com/2014/04/22/how-to-share-code-among-different-universal-windows-apps/

“This type of project has been improved in Visual Studio 2013 Update 2 and now, if we target Windows 8.1 and Windows Phone 8.1, we’ll be able to use all the common APIs.

However, PCL produces a single binary that works as is in all the supported projects. Handling divergent APIs requires using higher-level abstractions, such as dependency injection or IoC containers. We can’t simply use conditional if to define platform specific code.”

How about using a Portable Class Library (PCL)?

Page 22: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Shared Reference Project

2. Add Project to Solution:

1. Download & Install “Shared Project Reference Manager” from MSDN:• http://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450

3. Add Class Library for each platform (Win 8.1 & WP 8.1)4. Add Shared Project Reference to each Class Library.

Ref: http://marcominerva.wordpress.com/2014/04/22/how-to-share-code-among-different-universal-windows-apps/

Page 23: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Shared References in Solution Explorer

Class Library for Windows 8.1with reference to Shared project

Class Library for Windows Phone 8.1with reference to Shared project

Shared project for Class Libraries

Page 25: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Agenda

Intro: Cloud + Universal Apps

> Creating a Mobile Service> Consuming the Service> Publishing the Service

Q&A

Page 26: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Creating a Mobile Service

Page 28: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Create a Mobile Service

Page 29: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Specify Mobile Service Details

Name for the URL (not the full URL)

Page 30: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Specify Database Settings

Page 31: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Verify Status of Mobile Service

Page 32: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Get Tools & Download Your Solution

Page 33: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Consuming the Service

Page 34: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Build Your Solution (update NuGet packages). . .

Page 35: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Run the Service Locally

Page 36: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Verify the Service Locally

Page 37: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Try it out…

Page 38: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Run Windows Phone App Locally

Page 39: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Verify Windows Phone App

Page 40: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Run Windows App Locally

Page 41: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Verify Windows App Locally

Page 42: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Publishing the Service

Page 43: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Publish Your Mobile Service

Page 44: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Sign In and Select Existing Service

Page 45: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Complete the Publishing Process

Page 46: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Verify the Service is Running

Page 47: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Update App.Xaml.cs (Shared project)

AFTER:• Comment out local

settings• Uncomment server

settings, including key

BEFORE:

Page 48: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Run Windows Phone Project

Enter a value to test it

Page 49: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Run Windows project

Enter a value to test it

Page 50: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Agenda

Intro: Cloud + Universal Apps

> Creating a Mobile Service> Consuming the Service> Publishing the Service

Q&A

Page 51: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Questions?

Page 52: Windows Windows Phone Azure … and more! @shahedC WakeUpAndCode.com

Agenda

Intro: Cloud + Universal Apps

> Creating a Mobile Service> Consuming the Service> Publishing the Service

Q&A