windows 8 ストア アプリ 開発 tips

97
Windows 8 ススス ススス スス Tips スス ススス VSUG DAY 2012 Winter 2012.12.15

Upload: fujio-kojima

Post on 12-Nov-2014

9.311 views

Category:

Technology


1 download

DESCRIPTION

VSUG DAY 2012 Winter (2012.12.15) http://vsug.jp/tabid/228/EventID/22/Default.aspx

TRANSCRIPT

Page 1: Windows 8 ストア アプリ 開発 Tips

Windows 8 ストア アプリ開発 Tips

小島 富治雄

VSUG DAY 2012 Winter ( 2012.12.15 )

Page 2: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

自己紹介

• 小島 富治雄• @Fujiwo• 福井コンピュータアーキテクト株式会社

• Microsoft MVP C# (2005-2013)

2

Page 3: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

アジェンダ

1. Windows ストア アプリとは

5. 単体テスト

2. Bing Map を使ってみよう

6. ポータブルライブラリ

3. カメラを使ってみよう

7. Windows ストアへの提出

4. ViewModel

8. お役立ち サイト

Page 4: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

• http://www.slideshare.net/Fujiwo/windows-8-15634919

• http://slidesha.re/W3SrsK

本日の資料

Page 5: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

1. Windows ストア アプリとは

Page 6: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Windows ストア アプリ

Page 7: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

二本立て !• Windows ストア アプリ• デスクトップ アプリ

Windows 8

Page 8: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

デスクトップ アプリ Windows ストア アプリ

Windows 8x86/x64

• 従来通りWin32 API

• .NET• Silverlight• ほとんどそのまま動作

• 全画面• 新 API “WinRT”• C#/VB+XAML• JavaScript+HTML5• C++ + XAML で

ネイティブ アプリも可• Windows Store で配布 ( 原

則 )• 審査あり

Windows RTARM

×

Windows 8 のアプリ

Page 9: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

マイクロソフト スタイル

Page 10: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

タッチ & マウス / キーボード基本フルスクリーン

カスケード ウィンドウじゃないタイトルバー、従来のメニューがない

横長横スクロール

Windows ストア アプリの特徴

Page 11: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

新たな GUI への対応ライブタイル

バッチチャームアプリ バートースト通知セマンティック ズーム

Windows ストア アプリ

Page 12: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

WinRT

Page 13: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Win32 API とは別のWindows RunTime

Win32 API を置き換えるマイクロソフト スタイル アプリ

(≒Windows ストア アプリ ) 用

WinRT とは何か ?

Page 14: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

COM ベースの API.NET ではないWin32 API よりはオブジェクト指向C++ で書かれている

WinRT とは何か ?

Page 15: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Page 16: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Windows ストア アプリ開発

C#/VB + XAML

CLR

C++ + XAML

ネイティブ

JavaScript + HTML

Chakra

WinRT

Page 17: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

言語プロジェクション

C++( ネイティブ )

C#/VB( マネージ )

CLR

JavaScriptChakr

a

WinMDWindows MetaData( 型情報 )

WinRT(COM ベースネイティブ )

Page 18: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

• WinRT が使える• WinRT 仕様のクラス ライブラリも

• .NET が使える• .NET for Windows Store apps• .NET for Windows Store apps を使った

クラス ライブラリも• ポータブルクラスライブラリ ( 後述 ) も

C#/VB では

Page 19: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

• 非同期呼び出しだらけ• タブレット等のデバイスで有効• 50ms 以上掛かる可能性がある API は非同期版のみ

• 非同期呼び出し ?• APIの機能リクエストと結果受け取りが別

※ これまでのプログラミング方法では複雑なコードに → async/await が有効

WinRT では多くの API が非同期に

var client = new SyndicationClient();var feed = await client.RetrieveFeedAsync(new Uri(feedUri));

Page 20: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

開発の例

Page 21: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Logicool Wireless Rechargeable Touchpad t650

私の開発環境

Page 22: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

私の開発環境

Page 23: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2. Bing Map を使ってみよう

Page 25: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Bing Maps SDK for Windows Store apps

既存のアプリに NuGet で入れることも出来る

Page 26: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Bing Maps Account Centerhttp://www.bingmapsportal.com

Page 27: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Bing Maps Account Center

Page 28: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Bing Maps Account Center

Page 29: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Bing Maps Application

Page 30: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Bing Map アプリの構成

Page 31: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Bing Map アプリの Package.appxmanifest

Page 32: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

<Page x:Class="ShoPhotoInfo.MainPage" IsTabStop="false" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:ShoPhotoInfo" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:bm="using:Bing.Maps"><Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

<bm:Map x:Name="map" Credentials=“ 自分の Bing Maps Key" ZoomLevel="16" /></Grid></Page>

Bing Map アプリ - XAML

Page 33: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public sealed partial class MainPage : Page{ protected async override void OnNavigatedTo(NavigationEventArgs e) { map.Center = await GetCurrentLocation(); }

Bing Map アプリ - C#

Page 34: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

static async Task<Geoposition> GetCurrentPosition() { var geolocator = new Geolocator(); geolocator.DesiredAccuracy = PositionAccuracy.High; return await geolocator.GetGeopositionAsync(); }

static async Task<Location> GetCurrentLocation() { var currentPosition = await GetCurrentPosition(); return new Location { Latitude = currentPosition.Coordinate.Latitude, Longitude = currentPosition.Coordinate.Longitude }; }

Bing Map アプリ - C# 続き

Page 35: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

DEMO

Page 36: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

3. カメラを使ってみよう

Page 37: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

カメラ アプリの Package.appxmanifest

Page 38: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

<Page x:Class="ShoPhotoInfo.MainPage" IsTabStop="false" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:ShoPhotoInfo" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:bm="using:Bing.Maps"><Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

<Image x:Name="image" /></Grid></Page>

カメラ アプリ - XAML

Page 39: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public static async Task<StorageFile> TakePhoto(){ var capture = new CameraCaptureUI(); var file = await capture.CaptureFileAsync(CameraCaptureUIMode.Photo); return file;}

写真撮影 - C#

Page 40: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public static async Task<WriteableBitmap> CreateBitmapAsync(StorageFile file) { var pixelSize = default(Size); var bytes = default(byte[]); using (var stream = await file.OpenReadAsync()) { var decoder = await BitmapDecoder.CreateAsync(stream); pixelSize = new Size { Width = decoder.PixelWidth, Height = decoder.PixelHeight }; var pixelData = await decoder.GetPixelDataAsync(); bytes = pixelData.DetachPixelData(); } var bitmap = new WriteableBitmap((int)pixelSize.Width, (int)pixelSize.Height); using (var pixelStream = bitmap.PixelBuffer.AsStream()) { await pixelStream.WriteAsync(bytes, 0, bytes.Length); } return bitmap;}

写真の表示 - C#

要 using System.Runtime.InteropServices.WindowsRuntime;

Page 41: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

async Task SetImageSource(StorageFile file){ var bitmap = await CreateBitmapAsync(file); image.Source = bitmap;}

写真の表示 - C#

Page 42: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public static async Task<StorageFile> GetStorageFileAsync() { var picker = new FileOpenPicker(); picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; picker.ViewMode = PickerViewMode.Thumbnail;

picker.FileTypeFilter.Add(".jpg"); picker.FileTypeFilter.Add(".jpeg"); picker.FileTypeFilter.Add(".png"); picker.FileTypeFilter.Add(".bmp");

return await picker.PickSingleFileAsync(); }

写真のファイルオープン - C#

Page 43: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public static async Task SavePhoto(WriteableBitmap bitmap, string fileName){ var picker = new FileSavePicker(); picker.FileTypeChoices.Add("JPEG ファイル ", new List<string> { ".jpg", ".jpeg" }); picker.DefaultFileExtension = ".jpg"; picker.SuggestedFileName = fileName; picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; var file = await picker.PickSaveFileAsync(); if (file != null) await bitmap.WriteAsync(file);}

写真のファイル保存 - C#

Page 44: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public static async Task<ImageProperties>GetImagePropertiesAsync(StorageFile file)

{ var imageProperties = await

file.Properties.GetImagePropertiesAsync(); return imageProperties;}

写真のプロパティ (Exif) - C#

Page 45: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

DEMO

Page 46: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

4. ViewModel

Page 47: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

ViewModel のサンプル

C#XAML

Page 48: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

<Grid> <TextBox x:Name=“titleTextBox“ LostFocus="titleTextBox_LostFocus" /> <TextBlock x:Name=“bookTextBlock" /> <Button x:Name="addButton" Content=" 追加 " /></Grid>

コード ビハインド - XAML

Page 49: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public class Book{ string title = string.Empty;

public string Title { get { return title; } set { title = value; } }

public bool IsValid { get { return !string.IsNullOrWhiteSpace(Title) && Price >= 0; } }

public override string ToString() { return Title; }}

コードビハインド – C#

Page 50: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public sealed partial class BookPage : Page{ Book book = new Book();

public BookPage() { InitializeComponent(); titleTextBox.Text = book.Title; bookTextBlock.Text = book.ToString(); }

void titleTextBox_LostFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e) { book.Title = titleTextBox.Text; titleTextBox.Text = book.Title; bookTextBlock.Text = book.ToString(); addButton.IsEnabled = book.IsValid; }}

コードビハインド – C#

Page 51: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public class Book : INotifyPropertyChanged{ public event PropertyChangedEventHandler PropertyChanged; string title = string.Empty;

public string Title { get { return title; } set { if (value != title) { title = value; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Title")); } } }

public bool IsValid { get { return !string.IsNullOrWhiteSpace(Title) && Price >= 0; } } public AddBookCommand AddBook { get { return new AddBookCommand(this); } } public override string ToString() { return Title; }}

ViewModel – C#

Page 52: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public class AddBookCommand : ICommand{ public event EventHandler CanExecuteChanged;

readonly Book book;

public AddBookCommand(Book book) { this.book = book; book.PropertyChanged += delegate { if (CanExecuteChanged != null) CanExecuteChanged(this, EventArgs.Empty); }; }

public bool CanExecute(object parameter) { return book.IsValid; }}

ViewModel – C#

Page 53: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

<Grid DataContext="{Binding Source={StaticResource book}}" > <TextBox Text="{Binding Path=Title, Mode=TwoWay}" /> <TextBlock Text="{Binding}" /> <Button Content=" 追加 " Command="{Binding Path=AddBook}" CommandParameter="{Binding}" /></Grid>

ViewModel - XAML <Page.Resources> <viewModel:Book x:Key="book" /></Page.Resources>

Page 54: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public class ViewModelBase : INotifyPropertyChanged{ public event PropertyChangedEventHandler PropertyChanged;

protected void RaisePropertyChanged<PropertyType>( Expression<Func<PropertyType>> propertyExpression) { var propertyName = ((MemberExpression)propertyExpression.Body).Member.Name; RaisePropertyChanged(propertyName); }

void RaisePropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); }}

ViewModel その 2 – C#

Page 55: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

public class Book : ViewModelBase{ // public event PropertyChangedEventHandler PropertyChanged; string title = string.Empty;

public string Title { get { return title; } set { if (value != title) { title = value; //if (PropertyChanged != null) // PropertyChanged(this, new PropertyChangedEventArgs("Title")); RaisePropertyChanged(() => Title); } } } public bool IsValid { get { return !string.IsNullOrWhiteSpace(Title) && Price >= 0; } } public AddBookCommand AddBook { get { return new AddBookCommand(this); } } public override string ToString() { return Title; }}

ViewModel その 2 – C#

Page 56: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

DEMO

Page 57: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

5. 単体テスト

Page 58: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

単体テスト ライブラリ

Page 59: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

[TestClass]public class UnitTest1{ Book book; AddBookCommand addCommand;

[TestInitialize] public void Setup() { book = new Book(); addCommand = new AddBookCommand(book); }

単体テスト

Page 60: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

[TestMethod] public void AddCommand の CanExecute が変化するか () { Assert.IsFalse(addCommand.CanExecute(null));

book.Title = "Windows 8 入門 "; book.Price = 2980; Assert.IsTrue(addCommand.CanExecute(null));

book.Title = ""; book.Price = 1000; Assert.IsFalse(addCommand.CanExecute(null));

book.Title = "WinRT 入門 "; book.Price = -1; Assert.IsFalse(addCommand.CanExecute(null)); }}

単体テスト

Page 61: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

DEMO

Page 62: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

6. ポータブル ライブラリ

Page 63: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

XAML ファミリーでコードを共通化できないか ?• Windows Store アプリ• Windows Phone アプリ• Silverlight アプリ• WPF アプリ

XAML ファミリー

Page 64: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

WPF と Silverlight の .NET

Page 65: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Phone と Store の .NET

Page 66: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

ポータブル ライブラリ

Page 67: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

ポータブル ライブラリ

Page 68: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

class Super { } class Sub : Super { public int Number { get; set; } public string Name { get; set; } }

class Program { static void Main() { var sub = new Sub();

bool result1 = typeof(Sub).IsSubclassOf(typeof(Super)); bool result2 = sub.GetType().IsSubclassOf(typeof(Super)); bool result3 = sub.GetType().IsAssignableFrom(typeof(Super)); bool result4 = sub is Super;

var properties1 = typeof(Sub).GetProperties(); } }

ポータブル ライブラリ

Page 69: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

DEMO

Page 70: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

7. Windows ストアへの提出

Page 71: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Windows ストア アプリ デベロッパー センター

• http://msdn.microsoft.com/ja-JP/windows/apps• https://appdev.microsoft.com/StorePortals/

Page 72: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Windows ストア アプリ デベロッパー センター

Page 73: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

アプリ名の予約

Page 74: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

アプリ名の予約

Page 75: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

アプリ名の予約

Page 76: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Windows ストア アプリ 登録の手引きWindows 8 アプリ開発体験テンプレートhttp://msdn.microsoft.com/ja-jp/jj556277

参考資料Windows ストア アプリ 登録の手引き本自習書では、 Microsoft アカウントの取得から Windows ストア アプリの審査登録までの手順を紹介します。Windows ストア アプリ開発のためのポイントより効率的にアプリのストア登録をしていただくためのヒントをまとめました。是非ご参照ください。アイコン作成用テンプレートストア申請のために必要となるサイズのアイコンを、より簡単につくっていただくためのテンプレートをご用意しました。

Page 77: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

リジェクトの理由と対策

Page 78: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2012/09/24

お客様のアプリは、要件 4.1 を満たしていません。 審査担当者からのコメント :There is no privacy policy in metadata regarding internet connection.No privacy policy in Settings Charm

リジェクト理由

Page 79: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

プライバシーポリシーはじめにSho's Software ( 以下「本サービス」 ) は、本サービスを利用する 全ての方 ( 以下「利用者」といいます ) のプライバシーを尊重するために、 利用者の個人情報を以下の定義に従い、個人情報の適切な取り扱いに取り組んでまいります。■個人情報の定義個人情報とは、本サービスを通じて利用者から取得する氏名、年齢、メールアドレス、その他の利用者個人を特定できる情報のことを指します。 収集する個人情報は、利用者から本サービスにてご登録いただく情報に限られます。■個人情報の利用目的について本サービスは、利用者の個人情報を以下の目的で利用することができるものとします。本サービスならびにその他本サービスに関連する情報の提供のため 利用者の本人確認のため本サービスの運営上必要な事項の通知 (電子メールによるものを含むものとします )本サービス上で、個人を特定できない範囲においての統計情報の作成および利用本サービスの新規開発に必要なデータの解析や分析 契約や法律等に基づく権利の行使や義務の履行•アフターサービス、各種問い合わせ対応のため 利用規約に反する態様でのご利用を防止するため•■統計データの利用当社は、ユーザーの個人情報をもとに、個人を識別できないように加工した統計データを作成することがあります。個人を識別できない統計データについては、個人情報には当たらず、当社は何ら制限なく利用することができるものとします。 ■個人情報の共有ならびに利用制限について本サービスは、以下に定める場合を除いて、事前に利用者本人の同意を得ず、利用目的の達成に必要な範囲を超えて個人情報を利用または共有することはありません。法令により認められた場合利用者の皆様の同意があった場合人の生命、身体または財産の保護のために必要があり、さらに利用者の同意を得るのが困難な場合裁判所、検察庁、警察、税務署、弁護士会またはこれらに準じた権限を持つ機関から、個人情報の開示を求められた場合合併、営業譲渡その他の事由による事業の承継の際に、事業を承継する者に対して開示する場合 ■個人情報の安全管理について本サービスでは、個人情報の漏洩または毀損の防止ならびにその他個人情報の安全管理が行われるよう、個人情報の適切な監督を行います。 本サービスでは、業務遂行に必要な範囲内で、権限を与えられた者のみが個人情報を取り扱います。 個人情報の取扱いを外部に委託する場合には、機密保持契約を締結のうえ委託先を監督します。■個人情報の開示、訂正、削除について本サービスは、個人情報保護法その他の法令等に基づき、個人情報の開示、訂正、追加、削除、利用停止、消去、第三者提供の停止、利用目的の 通知の請求に対応いたします。 請求が本人確認不可能な場合や、個人情報保護法の定める要件を満たさない場合、ご希望に添えない場合があります。 なお、アクセスログなどの個人情報以外の情報については、原則として開示等はいたしません。■プライバシーポリシーの更新について本サービスは、個人情報保護を図るため、法令等の変更や必要に応じて、本プライバシーポリシーを改訂することがあります。 その際は、最新のプライバシーポリシーを本サービスに掲載いたします。本ページを都度ご確認の上、本サービスのプライバシーポリシーをご理解いただくよう お願いします。■プライバシーポリシーに関するお問い合わせ本サービスのプライバシーポリシーに関するお問い合わせは、下記までご連絡お願い致します。

対処 : プライバシーポリシー

Page 80: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2012/09/27

お客様のアプリは、要件 2.4 を満たしていません。

アプリがこの要件を満たしていないと見なされる一般的な理由は、アプリの主要なシナリオの 1 つに該当する部分を完了するために、ユーザーが Web ブラウザーにリダイレクトされることです。

リジェクト理由

Page 81: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

対処 : …

• Windows 8 アプリ開発体験テンプレートhttp://msdn.microsoft.com/ja-jp/jj556277「 NewsReader テンプレート XAML/C# 用」で作ったアプリから、「Web ブラウザーで開く」機能を削除

Page 82: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2012/09/25

お客様のアプリは、要件 4.1 を満たしていません。

リジェクト理由

Page 83: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Privacy PolicySho's Software takes the privacy of its users very respectfully. We also comply fully with the Act on the Protection of Personal Information.Sho's Software does not collect personally identifiable information (e.g., name, address, telephone number, e-mail address) unless you provide it to us.

対処 : プライバシーポリシー

Page 84: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

対処 : Package.appxmanifest

Page 85: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2012/09/25

お客様のアプリは、要件 6.5 を満たしていません。アプリがこの要件を満たしていないと見なされる一般的な理由 :アプリが、 1 つ以上の認定言語をサポートしていない。提出時に指定された言語の一部ではアプリが動作するが、すべての言語では動作しない。アプリの [説明 ] ページに記載されている情報 (説明、機能、スクリーンショットなど ) が、アプリのローカライズ量を反映していない。

リジェクト理由

Page 86: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

  <Resources>    <Resource Language="x-generate" />  </Resources>

対処 : Package.appxmanifest

  <Resources>    <Resource Language=“en" />  </Resources>

対処 :

Page 87: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2012/09/25

お客様のアプリは、要件 6.8 を満たしていません。アプリがこの要件を満たしていないと見なされる一般的な理由は、 1 つ以上のスクリーンショットに、実際より良く見えるようなグラフィック処理が施されていることです。

リジェクト理由

審査担当者へのコメントBackground image will be choosen from 6 images randomly.

対処 :

Page 88: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2012/10/04お客様のアプリは、要件 1.2 を満たしていません。審査担当者からのコメント :You should add more detail to your app description, it read too generic or vague to adequately represent the app's unique value.

リジェクト理由

対処 :

「説明」をより詳細に

Page 89: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

2012/09/28

お客様のアプリは、要件 2.3 を満たしていません。 詳細情報アプリがこの要件を満たしていないと見なされる一般的な理由は、アプリ タイル、アプリ バー、設定チャーム ([ バージョン情報 ] リンクを含む ) が、プロモーション資料に使用されていることです。

リジェクト理由

対処 :

アプリの中の “Die Hard” を別の表現に変更。

Page 90: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

Windows 8 Clinic

• http://msdn.microsoft.com/ja-jp/jj820154

Page 91: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

8. お役立ちサイト

Page 92: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

参考資料 : 開発を始めるとき• デベロッパー センター - Windows ストア アプリ

http://msdn.microsoft.com/ja-JP/windows/appsWindows ストア アプリ開発は先ずここから

• Windows ストア アプリ プログラミングの開発者向け ダウンロード -  デベロッパー センター - Windows ストア アプリhttp://msdn.microsoft.com/ja-jp/windows/apps/br229516.aspx

• Windows 8 アプリ開発体験テンプレートhttp://msdn.microsoft.com/ja-jp/jj556277

• Windows アプリ アート ギャラリー -  アプリに組み込めるイメージ素材集http://msdn.microsoft.com/ja-jp/windowsphone/hh544699

• Developer Camp 2012 Japan Fall - Channel 9http://channel9.msdn.com/Events/Windows-Azure-DevCamps/Developer-Camp-2012-Japan-Fall

動画と資料• Windows Store app samples -  デベロッパー センター - Windows ストア アプリ

http://code.msdn.microsoft.com/windowsapps/• MSDN マガジン Windows 8 Special Issue 2012

http://msdn.microsoft.com/ja-jp/magazine/jj660298.aspx

Page 93: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

• Windows ストアアプリ - 田中達彦のブログ - MSDN Blogshttp://blogs.msdn.com/b/ttanaka/archive/tags/windows_b930c830a230a230d730ea30_/

• windows - Akira Onishi's weblog - MSDN Blogshttp://blogs.msdn.com/b/aonishi/archive/tags/windows/

• WinRT - 荒井省三の Blog - MSDN Blogshttp://blogs.msdn.com/b/shozoa/archive/tags/winrt/

• Windows Store 開発者向けブログ - MSDN Blogshttp://blogs.msdn.com/b/windowsstore_ja/

• Windows8 - 眠るシーラカンスと水底のプログラマーhttp://coelacanth.heteml.jp/blog/category/windows8/

• プログラミング ( Metro スタイル ) - biac の それさえもおそらくは幸せな日々@niftyhttp://bluewatersoft.cocolog-nifty.com/blog/metro/

• [WinRT] - かずきの Blog@Hatenahttp://d.hatena.ne.jp/okazuki/searchdiary?word=%2A%5BWinRT%5D

参考資料 : ブログ

Page 94: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

• 速習 Windows ストアアプリケーション - CodeZinehttp://codezine.jp/article/corner/471

• WinRT/Metro TIPS - Insider.NET - @IThttp://www.atmarkit.co.jp/ait/subtop/features/da/ap_winrttips_index.html

• Windows 8 API の基礎 - ITprohttp://itpro.nikkeibp.co.jp/article/COLUMN/20121206/442473/

参考資料 : 連載記事

Page 95: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

• [Windows Store アプリ ][XAML] Windows Store アプリと Windows Phone アプリ、 Silverlight アプリ、 WPF アプリでソースコードを共通化する方法に関する記事http://blog.shos.info/archives/2012/11/windows_store_windows_phone_si.html

• Windows ストアアプリで利用できるライブラリの種類 - もりひろゆきの日々是勉強http://moriblog.kit-eng.com/2012/12/08/windows%E3%82%B9%E3%83%88%E3%82%A2%E3%82%A2%E3%83%97%E3%83%AA%E3%81%A7%E5%88%A9%E7%94%A8%E3%81%A7%E3%81%8D%E3%82%8B%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E3%81%AE%E7%A8%AE%E9%A1%9E/

• Win8 ストア・アプリ WP8 アプリ、両面撃破作戦 - slidesharehttp://www.slideshare.net/yasuhikoy/2520121201-win8-wp8

参考資料 : ポータブル ライブラリ

Page 96: Windows 8 ストア アプリ 開発 Tips

VSUG DAY 2012 Winter 2012.12.15

• Metro アプリをテストファーストするときのポイント - slidesharehttp://www.slideshare.net/yasuhikoy/2520121201-tdd13

• Windows 8 で MVVM パターンを使用する ( 機械翻訳 ) - MSDN マガジンhttp://msdn.microsoft.com/ja-jp/magazine/jj651572.aspxMVVM Light Toolkit http://mvvmlight.codeplex.com  を使ったサンプル。

• WinRT/Metro TIPS: 多言語化対応を楽に行うには ?[Win 8] - @IThttp://www.atmarkit.co.jp/ait/articles/1211/08/news025.html

• WinRT/Metro TIPS:文字列を多言語化対応するには ?[Win 8] - @IThttp://www.atmarkit.co.jp/ait/articles/1211/01/news069.html

• WinRT/Metro TIPS:文字列リソースを使うには ?[Win 8] - @IThttp://www.atmarkit.co.jp/ait/articles/1210/25/news026.html固定文字列を、多言語化対応などのために、文字列リソースとして別のファイルに分けておく方法

参考資料 : 単体テスト、 ViewModel 、その他

Page 97: Windows 8 ストア アプリ 開発 Tips

Windows 8 ストア アプリ開発 Tips

小島 富治雄

VSUG DAY 2012 Winter ( 2012.12.15 )