53
Azure MobileService in WindowsStoreApps Overview がががが

Azure mobile service in windowsstoreapps overview

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Azure mobile service in windowsstoreapps overview

Azure MobileService in WindowsStoreApps Overview

がりっち

Page 2: Azure mobile service in windowsstoreapps overview

自己紹介

栂井良太 (Ryota Togai @garicchi)

浜松のとある大学に通っています ( 学生 )

Windows ストアアプリとかクライアント開発 とか全般的に好き

http://garicchi.com

http://garicchi.hatenablog.jp

Page 3: Azure mobile service in windowsstoreapps overview

Microsoft Student Partners って?

Microsoft の技術関連で活動したい学生が集まっています

エヴァンジェリスト職やテクニカル職、営業職などさまざまな部門分け

BizSpark アカウントと交通費もらえます

技術がなくてもはいれます!

Page 4: Azure mobile service in windowsstoreapps overview

ストアアプリの Twitter クライアントをつくりました

http://neuronia.garicchi.com

Page 5: Azure mobile service in windowsstoreapps overview

※ このセッションは初心者向けです

Page 6: Azure mobile service in windowsstoreapps overview

このセッションの目標

AzureMobileService の概略を知ってもらう

AzureMobileService の使い方を学んでもらう ( 初心者向け )

AzureMobileService とストアアプリの連携方法を学ぶ

大学 3 年時編入のつらさを知ってもらう

Page 7: Azure mobile service in windowsstoreapps overview

今日はなすこと

私の大学の履修状況のつらさWindowsAzureMobileService とはMobileService とストアアプリDataServiceUser 認証サービスプッシュ通知サービススケジュールサービスカスタム API

Page 8: Azure mobile service in windowsstoreapps overview

WindowsAzureMobileService とは

多くのモバイルプラットフォームに対応した BaaS(Backend as a Service)

iOS,Android,WindowsPhone,WindowsStore,HTML etc.. に対応

柔軟な自動スケーリング→ 基本モードと標準モードはロールインスタンス数に応じて課金

Page 9: Azure mobile service in windowsstoreapps overview

どんな機能があるのか

データベース ユーザー認証

プッシュ通知 カスタム API

スケジューラー

etc..

Page 10: Azure mobile service in windowsstoreapps overview

BasS でないと

例えばスマホアプリのデータ管理やバックエンドは

Server

Request

Response

サーバー設置コスト

サーバーインフラ整備

モバイルとの通信の仕組みを構築するコスト

サーバーとの通信プログラムの開発コスト

サーバー運用コスト

Page 11: Azure mobile service in windowsstoreapps overview

MobileService なら

バックエンドはクラウドに任せる事によって開発者はモバイルアプリの開発に専念できる。

Server

Request

Response

Azure

Page 12: Azure mobile service in windowsstoreapps overview

MobileService の料金形態個人開発で遊んだりするぐらいなら無料でおk本格的に利益を求めたいとかなら基本プラン or 標準プラン

http://azure.microsoft.com/ja-jp/pricing/details/mobile-services/

Page 13: Azure mobile service in windowsstoreapps overview

ここまでのまとめ

WindowsAzureMobileService はスゴイ

モバイル・アプリのバックエンドを簡単実装で開発者の負荷軽減

無料で利用できるよ !

Page 14: Azure mobile service in windowsstoreapps overview

今日はなすこと

私の大学の履修状況のつらさWindowsAzureMobileService とはMobileService とストアアプリDataServiceUser 認証サービスプッシュ通知サービススケジュールサービスカスタム API

Page 15: Azure mobile service in windowsstoreapps overview

ストアアプリとモバイルサービス

アプリを簡単にオンライン化

カンタンプッシュ通知

アプリデータ収集

ユーザー管理

etc...

Page 16: Azure mobile service in windowsstoreapps overview

アルパカ牧場

モバイルサービスでユーザー情報とレベル情報を集計オンラインランキング化→ わずか 45 分で実装完了

Page 17: Azure mobile service in windowsstoreapps overview

ランキング集計

Azure

アプリ Twitterユーザー認証

データサービスInsert

データサービスGet

ランキングデータ取得アプリ

・ TwitterID・レベル情報

Page 18: Azure mobile service in windowsstoreapps overview

Neuronia

バグ情報のオンライン収集Rss2LivetileAPI によるライブタイル更新

Page 19: Azure mobile service in windowsstoreapps overview

オンラインバグ収集

UnhandledException イベントでモバイルサービスに送信

Page 20: Azure mobile service in windowsstoreapps overview

Rss2livetileAPI

IE のスタート画面ピン止めを Azure で

Page 21: Azure mobile service in windowsstoreapps overview

Rss2livetileAPIストアアプリ用ライブタイル更新 API

http://garicchi.hatenablog.jp/entry/2014/02/04/091133

Page 22: Azure mobile service in windowsstoreapps overview

ストアアプリとモバイルサービスはアプリを簡単にオフライン化→ オフラインでは実現できなかったことがいろいろできる

将来的にオフラインで完結するアプリはほとんど無い

アプリのオンライン化は必須

MobileSrvice で簡単に

Page 23: Azure mobile service in windowsstoreapps overview

今日はなすこと

私の大学の履修状況のつらさWindowsAzureMobileService とはMobileService とストアアプリDataServiceUser 認証サービスプッシュ通知サービススケジュールサービスカスタム API

Page 24: Azure mobile service in windowsstoreapps overview

DataService

モバイルサービス上のデータベースに任意のテーブルを作成可能

アプリからデータの取得、更新、削除などが可能

サーバーサイドスクリプトによるデータ検証

Page 25: Azure mobile service in windowsstoreapps overview

モバイルサービスを作成

http://garicchi.com/?p=8221

Page 26: Azure mobile service in windowsstoreapps overview

テーブルを作る

http://garicchi.com/?p=8341

Page 27: Azure mobile service in windowsstoreapps overview

MobileServiceSDK の追加

http://garicchi.com/?p=8291

Page 28: Azure mobile service in windowsstoreapps overview

テーブルと同じ名前のクラスを作る

String 型の Idメンバ必須 !

Page 29: Azure mobile service in windowsstoreapps overview

データを挿入、取得

GetTable<T>  InsertAsync  ToListAsync

Page 30: Azure mobile service in windowsstoreapps overview

サーバーサイドスクリプトによる制御

request.execute() で実行 request.respond() でレスポンスを返すItem はテーブルのレコードhttp://garicchi.com/?p=8431

Page 31: Azure mobile service in windowsstoreapps overview

サーバーサイドスクリプトによるユーザー認証

User オブジェクト認証レベルによる判断http://garicchi.com/?p=8541

Page 32: Azure mobile service in windowsstoreapps overview

今日はなすこと

私の大学の履修状況のつらさWindowsAzureMobileService とはMobileService とストアアプリDataServiceUser 認証サービスプッシュ通知サービススケジュールサービスカスタム API

Page 33: Azure mobile service in windowsstoreapps overview

ユーザー認証サービス

Microsoft アカウント、 Facebook アカウント、 Twitter アカウント、

Google アカウントでユーザー認証可能ClientID と ClientSecret の設定が必要

Application Azureユーザー認証

Page 34: Azure mobile service in windowsstoreapps overview

Twitter アカウントの場合

クライアント ID とクライアントシークレットを取得http://garicchi.com/?p=8711

Page 35: Azure mobile service in windowsstoreapps overview

Microsoft アカウントの場合

先にストアにアプリを関連付けてからLiveConnect デベロッパーセンターにてクライアント ID と

クライアントシークレットを取得http://garicchi.com/?p=8571

Page 36: Azure mobile service in windowsstoreapps overview

クライアント ID とクライアントシークレットを設定

管理ポータルの ID欄

Page 37: Azure mobile service in windowsstoreapps overview

ログイン

あとはデータベースを操作するなりすると認証済みアカウント情報が付属される

アカウントの種類

Page 38: Azure mobile service in windowsstoreapps overview

ユーザー ID

ログインするとレスポンスとしてユーザー ID がかえってくるユーザー管理

Page 39: Azure mobile service in windowsstoreapps overview

今日はなすこと

私の大学の履修状況のつらさWindowsAzureMobileService とはMobileService とストアアプリDataServiceUser 認証サービスプッシュ通知サービススケジュールサービスカスタム API

Page 40: Azure mobile service in windowsstoreapps overview

プッシュ通知サービス

http://garicchi.com/?p=9431

Page 41: Azure mobile service in windowsstoreapps overview

パッケージ SID とクライアントシークレットを取得

アプリをストアと関連付けるパッケージ SID とクライアントシークレットを取得Azure 管理ポータルのプッシュ通知に貼り付け

Page 42: Azure mobile service in windowsstoreapps overview

チャンネル Uri を取得データベースに挿入

取得したチャンネル Uri→ データーベースに挿入

Page 43: Azure mobile service in windowsstoreapps overview

サーバーサイドスクリプトで WNS にプッシュ通知要求

チャンネル Uri→WNS に送る

Page 44: Azure mobile service in windowsstoreapps overview

今日はなすこと

私の大学の履修状況のつらさWindowsAzureMobileService とはMobileService とストアアプリDataServiceUser 認証サービスプッシュ通知サービススケジュールサービスカスタム API

Page 45: Azure mobile service in windowsstoreapps overview

スケジュールサービス

定期的なスケジュールでスクリプトを実行最短 15 分間隔http://garicchi.com/?p=9771

Page 46: Azure mobile service in windowsstoreapps overview

今日はなすこと

私の大学の履修状況のつらさWindowsAzureMobileService とはMobileService とストアアプリDataServiceUser 認証サービスプッシュ通知サービススケジュールサービスカスタム API

Page 47: Azure mobile service in windowsstoreapps overview

カスタム API

簡単な WebAPI を作成可能クライアントからの Http リクエストで応答を返すhttps://<service_name>.azure-mobile.net/api/<api_name>http://garicchi.com/?p=9591

AzureApplication

Request

Response

Page 48: Azure mobile service in windowsstoreapps overview

Get リクエスト

クエリ引数の取得http://(url)?query1=hogehoge主にデータの取得

Page 49: Azure mobile service in windowsstoreapps overview

Post リクエスト

Post コンテンツの取得データの送信に使用

Page 50: Azure mobile service in windowsstoreapps overview

モバイルサービスとストアアプリのこれからもはやオフラインで完結するアプリはあまり役に立たない時代になった

いつでもインターネットにつながる今だからこそのモバイルサービスによるアプリのオンライン化

アプリバックエンドはより簡単に

Page 51: Azure mobile service in windowsstoreapps overview

モバイルサービスをどこで学べばいい?

Azure公式ドキュメントhttp://azure.microsoft.com/ja-jp/documentation/英語…

Page 52: Azure mobile service in windowsstoreapps overview

そこで garicchi.com

MobileService 入門サイトを作りましたhttp://garicchi.com/?page_id=8131日本語!!

Page 53: Azure mobile service in windowsstoreapps overview

まとめ

モバイルバックエンドは Azure!

様々なサービスを組み合わせてストアアプリをオンラインに拡張

Let’s Azure!