Windows azure mobile services を使った windows ストアアプリ開発 1027

32
Windows Azure Mobile Services ををを Windows をををををををを をを ををを ををををををををををををを を MTC をををををを ををををををををををををを http://blogs.msdn.com/b/shosuz/

description

技術ひろば 10/27 Windows Azure Mobile Services 資料はこちらです!ソースコードは私のBlog等を参照してください。http://blogs.msdn.com/b/shosuz/

Transcript of Windows azure mobile services を使った windows ストアアプリ開発 1027

Page 1: Windows azure mobile services を使った windows ストアアプリ開発 1027

Windows Azure Mobile Services を使った Windows ストアアプリ開発

鈴木 章太郎テクニカルエバンジェリスト 兼 MTC アーキテクト日本マイクロソフト株式会社http://blogs.msdn.com/b/shosuz/

Page 2: Windows azure mobile services を使った windows ストアアプリ開発 1027

テクニカルエバンジェリストhttp://blogs.msdn.com/b/shosuz

MTC アーキテクトhttp://www.microsoft.com/ja-jp/business/mtc/ads.aspx

呟きネタは主に、 Windows Azure, Windows 、Windows Phone, RIA, HTML5, MVVM, iOS/Android x Windows Azure 連携 , Guitar … 等趣味はバンド活動、 E.Guitar 演奏等全般ASPIC 執行役員 (‘05 ~)

Wipse モバイル x クラウド部会長(’ 11 ~)2005-2012 早稲田大学大学院非常勤講師、 2008-2010 中央大学非常勤講師

Page 3: Windows azure mobile services を使った windows ストアアプリ開発 1027

優れた Windows ストアアプリ 8 つの特徴

Windows ストア

スタイルデザイン

速くて滑らか

きれいなスケーリングと使いやすい

スナップ

適切なコントラクト

の実装

タイルの有効活用

いつでも繋がっている

クラウドとの連携

( ローミング )

Windows ストアの

原則に準拠

Page 4: Windows azure mobile services を使った windows ストアアプリ開発 1027

モバイルアプリの従来の実装パターン• データベース接続• Web アプリケーション• jQuery Mobile

• PC 用、 Mobile 用 、 すべての HTML 5 対応 ブラウザーで稼働

http://claudiamobile.cloudapp.net/ http://msdn.microsoft.com/ja-jp/windowsazure/hh965702

• Windows ストアアプリの場合• WCF (SOAP/REST)• WCF Data Services (REST, JSON)• WCF Data Services for Windows Store Apps …(REST, Odata)

Page 5: Windows azure mobile services を使った windows ストアアプリ開発 1027

Windows Azure Mobile Services とは

データ

通知

認証

サーバー ロジック

拡張

ログ

診断

モバイル対応の

アプリを簡単に実装

ユーザー認証機能

プッシュ通知機能

Windows 8,       iOS, Android,     Windows Phone 8 をサポート予定

必要に応じて     機能を追加可能

瞬時にデプロイ可能 

マルチテナント環境 から専用環境に   必要に応じて変更可能

http://www.windowsazure.com/mobile

Page 6: Windows azure mobile services を使った windows ストアアプリ開発 1027

主なシナリオWindows Azure Mobile Services は次の場合に最適です。

最新のモバイル アプリユーザー認証、プッシュ通知、構造化ストレージなど、一般的なタスクの繰り返しに関連した摩擦を減らします。

迅速な開発時は金なり。 Mobile Services を使用して 5 分足らずで単純で安全なバックエンドを構成するとすぐにアプリが稼働します。

構造化データが必要なアプリデータ管理を簡単にするための Windows Azure SQL データベースと動的に作成されたテーブルにシームレスに接続します。簡単にアクセス許可を設定および管理できます。

Page 7: Windows azure mobile services を使った windows ストアアプリ開発 1027

最新の 10 月 17 日更新版の内容

・ iOS 対応( Xcode 、 Objective-C )・ Facebook / Twitter / Google ID 対応・ Sendgrid による e-mail 送信対応・ Twilio による SMS 対応・ Blob Storage 利用可能・ Services Bus 利用可能、・他…http://weblogs.asp.net/scottgu/archive/2012/10/16/windows-azure-mobile-services-new-support-for-ios-apps-facebook-twitter-google-identity-emails-sms-blobs-service-bus-and-more.aspx

多くの機能追加が発表

Page 8: Windows azure mobile services を使った windows ストアアプリ開発 1027

サービスの作成簡単なモバイル アプリ用バックエンド デモ

Page 9: Windows azure mobile services を使った windows ストアアプリ開発 1027

構造化ストレージSQL データベースを使用した構造化ストレージ1 つのデータベースを使用している場合はアプリをスキーマ別に区分

AppX.TodoitemAppY.Todoitem

データの管理場所ポータルSQL ポータルSQL Management StudioREST API…

Page 10: Windows azure mobile services を使った windows ストアアプリ開発 1027

サーバー ロジックストレージ用に生成された自動サービス REST API動的スキーマのオン / オフCRUD 操作パイプラインを遮断するサーバー ロジックを記述する機能優れたクエリ機能

Page 11: Windows azure mobile services を使った windows ストアアプリ開発 1027

サーバー ロジックSupported Modules + Globals

mssqlrequestconsolepushtablesstatusCodes

mssql.query('select top 1 * from statusupdates', { success: function(results) { console.log(results);

} }

);

Page 12: Windows azure mobile services を使った windows ストアアプリ開発 1027

REST API と SQL 型のマッピングJSON 値 T-SQL 型数値 ( 整数、 10 進数、浮動小数点数 )

Float(53)

ブール値 Bit

DateTime DateTimeOffset(3)

文字列 Nvarchar(max)

Page 13: Windows azure mobile services を使った windows ストアアプリ開発 1027

サーバー ロジックCRUD 操作に関するサーバー ロジックの追加 デモ

Page 14: Windows azure mobile services を使った windows ストアアプリ開発 1027

プッシュ通知ライフサイクルの概要1. チャネル URI を要求する2. クラウド サービスに

登録する3. 認証とプッシュ通知

Windows 8

(1)

(2)

(3)

(3)

Page 15: Windows azure mobile services を使った windows ストアアプリ開発 1027

プッシュ通知WNS と統合してトースト、タイル、バッジ、および直接通知を提供するポータルで WNS のクライアント シークレットとパッケージ SID を取得するpush.wns.* の機能 :

通知を構成する簡単なクリーン オブジェクト モデルWNS に対する認証の実行

Page 17: Windows azure mobile services を使った windows ストアアプリ開発 1027

プッシュ通知デモ

Page 18: Windows azure mobile services を使った windows ストアアプリ開発 1027

認証 *Windows Live に対する認証

Twitter / Facebook もOK各 CRUD 操作のテーブル レベルのアクセス許可

・すべてのユーザー・アプリケーション キーを持つ

 ユーザー

・認証されたユーザーのみ・スクリプトと管理者のみ

サーバー側スクリプトを使用 したよりきめ細かい制御

http://msdn.microsoft.com/en-US/live/ff621310

Page 19: Windows azure mobile services を使った windows ストアアプリ開発 1027

認証の追加迅速な Windows Live への接続 デモ

Page 20: Windows azure mobile services を使った windows ストアアプリ開発 1027

診断、ログ、および拡張

診断API 呼び出しCPU 時間送信データ

ログconsole.error(…)console.log(…)

拡張 – コンピューティングインスタンス数のスケール アウトVM サイズのスケール アップ

拡張 - ストレージ専用 SQL DB へのモバイル サービス テナントのスケール アウトSQL DB のスケール アップ

Page 21: Windows azure mobile services を使った windows ストアアプリ開発 1027

診断、ログ、拡張デモ

Page 22: Windows azure mobile services を使った windows ストアアプリ開発 1027

Windows Azure   Mobile Services for iOS

Page 23: Windows azure mobile services を使った windows ストアアプリ開発 1027

正式版が出る前に利用可能だったリソース

Chris RisnerMicrosoft Azure Technical Evangelist構築手順他http://chrisrisner.com/

同サンプルhttps://github.com/WindowsAzure-Samples/MobileServices-iOS-Client 

XamarinMiguel Lcaza 氏率いる Mono Touch前提

同サンプルhttps://github.com/xamarin/azure-mobile-services

Page 25: Windows azure mobile services を使った windows ストアアプリ開発 1027

プレビュー時の無料提供

共有インスタンスで実行中

10 モバイル サービス 1 GB SQL

データベース

米国東部・西部の DC への展開が必要

データ転送はモバイル サービス 単位ではなくサブスクリプション単位

プレビュー期間中は SLA なし。 S インスタンスのみ使用可能。プレビュー期間中は、通常の従量課金料金から 33% 割引で予約済みインスタンスにアップグレード可能。

WA

の無

料評

価版

受信は無制限

送信は 1 日 165 MB まで

Page 26: Windows azure mobile services を使った windows ストアアプリ開発 1027

料金料金とライセンス $ サービス レベル

アグリーメントプレビューSLA は使用不可

一般公開99.9%

共有インスタンス( マルチテナント環境 )

S インスタンスのみが使用可能なサイズ。 複数購入が可能

パブリック プレビュー公開時は無料

アプリケーションは 10 個まで

予約済みインスタンス( プライベート VM)

S インスタンスのみが使用可能なサイズ。 複数購入が可能

プレビューの料金は Web サイトと同じ 割引料金になる

アプリケーションは 10 個まで

Page 27: Windows azure mobile services を使った windows ストアアプリ開発 1027

Mobile Services まとめ

データ

通知

認証

サーバー ロジック

拡張

ログ

診断

簡単、展開不要Windows 8 Client SDK 、 iPhone SDKWindows Phone 、 Android のサポートを間もなく開始

データSQL データベースを使用した構造化ストレージBlob ストレージも利用可能にストレージ用に生成された自動サービス API優れたクエリ機能

通知WNS と統合してトースト、タイル、バッジ、および直接通知を提供する通知を構成するためのクリーン オブジェクト モデル

サーバー ロジック自動 CRUD サービス API の生成CRUD 操作パイプラインを遮断するサーバー ロジックを記述する機能

認証Windows Live 、 Facebook, Twitter, Googld ID による認証コードを使用しないテーブル レベルの承認サーバー側スクリプトを使用したよりきめ細かい制御

スケール アウトとスケール アップE-mail. SMS, Service Bus, … その他利用可能に

Page 28: Windows azure mobile services を使った windows ストアアプリ開発 1027

Mobile Services リソース -1

29http://www.windowsazure.com/mobile

Mobile Services Developer Portal

Page 29: Windows azure mobile services を使った windows ストアアプリ開発 1027

Mobile Services リソース -2

30http://code.msdn.microsoft.com/doto-a-simple-social-todo-7e6ba464

Page 30: Windows azure mobile services を使った windows ストアアプリ開発 1027

Mobile Services リソース -3

31

• Windows 8 (Bing Maps for Windows Store Apps) で位置情報を取得• プッシュ通知(トースト / タイル)を当該 Windows Store App を実行中の全ユーザーに送付• Windows 8 デバイスを占有して 新規に取得した位置情報を Bing Maps 地図の中心に移動http://jkebeck.wordpress.com/2012/10/09/windows-azure-mobile-services-maps-more/

Page 31: Windows azure mobile services を使った windows ストアアプリ開発 1027

Mobile Services リソース -4

32http://channel9.msdn.com/Events/TechEd/Europe/2012/AZR310

Page 32: Windows azure mobile services を使った windows ストアアプリ開発 1027

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.