20

20140419 xamarin zumo

  • Upload
    -

  • View
    141

  • Download
    1

Embed Size (px)

DESCRIPTION

C# で全部書こう!XamarinでZUMO (Azure Mobile Services)

Citation preview

Page 1: 20140419 xamarin zumo
Page 2: 20140419 xamarin zumo

仕事

個人活動

http://bit.ly/metrotokyo4

http://tech.tanaka733.net

Page 3: 20140419 xamarin zumo
Page 4: 20140419 xamarin zumo
Page 5: 20140419 xamarin zumo
Page 6: 20140419 xamarin zumo

Microsoft

Page 7: 20140419 xamarin zumo

• 基本無料プラン

Page 8: 20140419 xamarin zumo
Page 9: 20140419 xamarin zumo
Page 10: 20140419 xamarin zumo
Page 11: 20140419 xamarin zumo

WindowsAzure.MobileServices

PCLとして共通化

• プラットフォームごとのライブラリ

Page 12: 20140419 xamarin zumo

public static MobileServiceClient MobileService = new MobileServiceClient("https://xamarinazure.azure-mobile.net/",“HogeMogeApplcationKey"

);

private async Task TestAsync(){

var res = await MobileService.InvokeApiAsync<string>("test");// textBox.Text = res;

}

Page 13: 20140419 xamarin zumo
Page 14: 20140419 xamarin zumo
Page 15: 20140419 xamarin zumo

ブログ記事

public class TodoItemController : TableController<TodoItem>{

protected override void Initialize(HttpControllerContext controllerContext){

base.Initialize(controllerContext);var context = new XamarinAzureServiceContext(Services.Settings.Schema);DomainManager = new EntityDomainManager<TodoItem>(context, Request, Services);

}

// GET tables/TodoItempublic IQueryable<TodoItem> GetAllTodoItems(){

return Query();}

Page 16: 20140419 xamarin zumo

AuthorizeLevel 属性で認証レベルを制御

public class TestController : ApiController{

public ApiServices Services { get; set; }

// GET api/Test[AuthorizeLevel(AuthorizationLevel.Anonymous)] public string Get(){

Services.Log.Info("Hello from custom controller!");return "Hello";

}

}

Page 17: 20140419 xamarin zumo

public class SampleJob : ScheduledJob{

public override Task ExecuteAsync(){

Services.Log.Info("Hello from scheduled job!");return Task.FromResult(true);

}}

Page 18: 20140419 xamarin zumo
Page 19: 20140419 xamarin zumo
Page 20: 20140419 xamarin zumo