マイクロソフト エバンジェリストのブログ

日本マイクロソフトのエバンジェリストが、技術情報を発信するブログです!

iOS / Android / Windows すべてに対応したアプリを作るには [ MSC 2013 ]

みなさん、こんにちは。

マイクロソフトの渡辺です。

この記事では、The Microsoft Conference 2013 のセッション「 iOS / Android / Windows すべてに対応したアプリを作るには 」の関連情報をご紹介します。

 

お知らせ ( 最優更新 :2013/12/16 22:30 )

セッション資料を公開しました!

 

お知らせ(最終更新:2013/11/28 18:20 )

セッション資料の公開は、12/16を予定しています。また、12/6のセミナーを受けた追加情報も更新予定です。

 

参考情報を追加(最終更新:2013/11/22 18:20 )

セッション資料の公開および、短縮版動画の公開を準備しております。

 

最新情報は随時アップデートされます!(最終更新:2013/11/21 5:45 )

 

お知らせ

Windows 8.1 や iOS, Android , Windows に対応したアプリ開発についてのセミナー開催!

  Developer Camp「Windows 8.1 アプリ開発集中講座」

12/3(火) 10:00-18:00 日本マイクロソフト 品川オフィス

ストアアプリ開発について、開発概要からクラウド連携まで、5セッションをお届けします。詳細はこちら。

Developer Camp 「iOS, Android, Windowsに対応したアプリを開発する方法 - Xamarin + Visual Studio 最新情報」

12/6(金) 19:00-21:00 日本マイクロソフト 品川オフィス

話題のXamarinについて、2セッションを提供します。 日本マイクロソフトからは、Visual Studio 2013からXamarinを利用する方法、Windows Azure Mobile Servicesを利用する方法をご紹介する予定です。詳細はこちら。

セッション内でご紹介した内容の参照情報

Web の技術を使う

ネイティブ言語を使う

その他参考情報

Surface 2 アプリ開発入門 [MSC 2013]

マイクロソフトの田中達彦です。

2013年11月21日、22日に東京にて開催される The Microsoft Conference 2013 (MSC) で、

Surface 2 アプリ開発入門 ~ C# で始める Windows ストア アプリ ~

というセッションを担当します。

本セッションでは、Surface 2対応アプリ (といってもWindowsストア アプリですが) の開発に興味があるという方に対して、開発に必要な環境や、どのようにアプリを作っていけばよいのかなどを説明します。

セッションでは、実際に簡単なアプリを作りながらWindowsストア アプリの特徴を説明していきます。

セッションでデモをする予定のアプリをちょっと進化させ、自分の名刺アプリを作ってみました。

f:id:ms_eva:20131120104508p:plain

 

上のスクリーンショットは、アプリのトップ画面です。

例えばプロフィールの部分をタップすると、以下のような画面が表示されます。

f:id:ms_eva:20131120104635p:plain

 

このアプリは「田中達彦」という名前で、現在Windowsストアに申請中です。

無事審査に通れば、Windowsストアからインストールできるようになります。

f:id:ms_eva:20131120104804p:plain

 

MSCでのセッションは50分です。

50分のセッションを見ていただいてポイントをつかんでいただけたら、後日僕のブログに詳細な記事を書きますので、参考にしてください。

MSCに参加されない方でも、ブログを読めば分かるような記事にします。

MSCに参加される方で興味がある方は、ぜひ本セッションにご参加ください。

セッションの日時は、2013年11月21日(木) 13:30-14:20です。

 

日本マイクロソフト

田中達彦

 

iOS, Android, Windows それぞれにアプリを出したい

こんにちは。

マイクロソフトの渡辺です。

iOS、Android、Windows それぞれにアプリを出すために、フレームワークやライブラリ等を探した経験のある方は多いのではないでしょうか?

先日そんな開発者の皆様向けに「iOS/Android/Windows――すべてに対応するアプリを開発するには?」という記事を、gihyo.jp様にて公開させていただきました。読了およそ2分ですので、ぜひご覧ください。

また、デモも含めたクロスプラットフォーム開発のアプローチ方法については、11/21(木), 11/22(金)に行われる The Microsoft Conference 2013 でのセッション「iOS / Android / Windows すべてに対応したアプリを作るには」にて、デモも交えながらご紹介させていただきます。

f:id:ms_eva:20131116143920p:plain

この機会にぜひ、The Microsoft Conference にご来場いただき、アプリ開発を含めた情報満載のDeveloper 向けセッションをお楽しみください!

The Microsoft Conference 2013

Unity 4.3 がリリースされました。Windows ストアアプリ向けの改良にご注目!!

f:id:ms_eva:20131113172337p:plain

エバンジェリスト 大西です。
Unity 4.3がリリースされました。拍手 (^-^)/8888
公式のリリースノートは、次の URL にあります。

What's New - Unity 4.3
http://unity3d.com/unity/whats-new/unity-4.3

結構たくさんあるので、Windows ストアアプリに関するところだけを抜き出してみました。Windows 8.1への対応、UnityScript (JS) / Boo のサポートが特にうれしいですね。Unity 4.2でWindows ストアアプリへの対応を見送ったみなさん、これからがチャンスですよ。

 

Features
•Implemented Screen.lockCursor API in Windows Store Apps
•Windows Store Apps: added API to get application activation arguments sent by secondary tile, toast notification now can send activation arguments.
•Windows Store Apps: implemented API to update tiles and show notifications
•Windows Store Apps: support for UnityScript / Boo

Changes
•Windows Phone 8/+ Windows Store Apps: Transferred Trial API from UnityEngine.Application to UnityEngine.Windows.LicenseInformation class.

Improvements
•Windows Phone/+ Windows Store Apps: Exposed application trial API.
•Windows Store Apps: background color override support in extended splash screen on Windows 8.1
•Windows Store Apps: Support rendering in non-native resolutions on Metro 8.1
•Windows Store Apps - Windows 8.1: Input callbacks will now be processed on application thread instead of UI thread, thus reducing input lag.
•Windows Store Apps - Windows 8.1: Will use Direct3D low-latency presentation API http://msdn.microsoft.com/en-us/library/windows/apps/bg182880.aspx#five, this should improve input latency.
•Windows Store Apps & + Windows Phone: Windows 8 requirement to build for Windows Phone/Windows Store Apps is always listed in build settings if it isn't met.
•Windows Store Apps: Added Master configuration to the exported solution, so now there will be three - Debug, Release, Master like on Windows Phone 8. Master configuration should be used when releasing the game. Release configuration is the same as Master, but has Profiler enabled, that's the only difference.
•Windows Store Apps: Animator.GetCurrentAnimationClipState, Animator.GetNextAnimationClipState should work now.
•Windows Store Apps: Added UnityEngine.WSA.Application.windowsActivated event, which can be used for capturing events when snapping begins and ends.
•Windows Store Apps: Implemented Screen.sleepTimeout
•Windows Store Apps: Fixed some of the issues with external plugins, for ex., Facebook.dll, EasyRoads3D.dll
•Windows Store Apps: Windows 8.1 support.
•Windows Store Apps: Cloth is supported now.
•Windows Store Apps: Editor will check if plugins used by Editor and Windows Store Apps are compatible, for ex., it will check if assembly version matches.
•Windows Store Apps: Editor will perform a check if user is running under Windows 8 or higher, if not Build buttons will be disabled.
•Windows Store Apps: Unity splash screen will be shown if user doesn't have a Pro license.
•Windows Store Apps: Added UnityEngine.WSA.Application.windowSizeChanged event, which will be invoked when user resizes the window, for ex., when performing snaping.
•Windows Store Apps: Implemented LocationService and Compass.
•Windows Store Apps: Compilation Overrides will only affect C# files not located in "Standard Assets", "Pro Standard Assets" or "Plugins" folders.
•Windows Store Apps: Managed-To-Native functions now use Platform Invoke to perform interop, performance should be better now.
•Windows Store Apps: New APIs. UnityEngine.Windows.File, UnityEngine.Windows.Directory for accessing directories and files. UnityEngine.WSA.Application for invoking calls on different threads.
•Windows Store Apps: Resources.UnloadUnusedAssets should work correctly now.
•Windows Store Apps: When generating C+/C# solution, Mixed Mode debugging will be enabled by default.
•Windows Store Apps: Make sure gui password field is drawing mask char, even though os keyboard returns clear text.

Fixes
•Fix error messages in Windows Store Apps and WP8 when checking for location capability
•Fix errors when snapping on Windows Store Apps
•Fix F10 and Shift keys in Windows Store Apps
•Windows Phone/+ Windows Store Apps: Fixed unity player crashing if fields in user scripts were emitted with #if UNITY_EDITOR precessor flag.
•Windows Phone/+ Windows Store Apps: Reference ReWriter will now correctly find replacement method with param arguments if original is not available in the target framework.
•Windows Store Apps: fixed GUI events via touches when cursor is locked
•Windows Store Apps: fixed LocationService DesiredAccuracy usage on Windows 8.1
•Windows Store Apps: Fixed out of bounds error while batching 2D sprites.
•Windows Store Apps: fixed parameter marshaling of type 'char' in UnityEngine API, this fixes following Unity functions - Event.character, Font::HasCharacter, Font::GetCharacterInfo. Because of this bug chinese, russian texts in some cases were being displayed incorrectly.
•Windows Store Apps: fixed starting coroutines with arguments of wrong but compatible tipe
•Windows Store Apps: PlayerPrefs will be loaded before calling OnEnable function.
•Windows Store Apps: fix crash in mesh
•Windows Store Apps: fix freeze on Windows 8.1 when waiting for input
•Windows Store Apps: Screen.orientation will work correctly (was fixed in 4.3 a1).
•Windows Store Apps / Windows 8.1: Fixed regression from 4.3 b3, any touch or mouse input won't longer hang the application.
•Windows Store Apps / Windows 8.1: IDXGIDevice3::Trim will be called on application suspend event, WACK requirement.
•Windows Store Apps: fix cursor move when Screen.showCursor is set to false
•Windows Store Apps: Fix AssemblyResolutionException during game postprocess when code references members from Windows namespace.
•Windows Store Apps: Show "Not applicable" for icon in player settings
•Windows Store Apps: Allow to unfold and show "Not applicable" for splash in player settings
•Windows Store Apps & + Windows Phone: Fixed constructor injection, improved error reporting
•Windows Store App/+ Windows Phone: String with unicode symbols (for ex., Chinese) will be correctly serialized.
•Windows Store Apps: WWW will correctly load files via file:/// protocol, and won't require internet capability to be enabled.
•Windows Store Apps: C# files located in Plugins, Standard Assets or Pro Standard Assets won't be compiled against .NET Core even if player setting are set to compile against .NET Core. This way js/boo will be able to access classes from C# files, C# files in other locations can be compiled against .NET Core depending on Player Settings.
•Windows Store Apps: RequireComponent works now.
•WSA / WP8: Better error message when UnityScript code calls Eva() function on platforms that don't support it

以上です。

Windows ストア アプリのビルド ターゲットについて

エバンジェリストの荒井です。
今回は、Visual Studio を使っている時にビルド時に利用する構成マネージャを解説します。最初に、言語としてC#、VB、JavaScriptを使用しているプロジェクトの構成マネージャは以下のようになっています。

f:id:ms_eva:20131112093847p:plain

ターゲットとなるプラットフォームには、Any(デフォルト)、x64、x86、ARMがあります。Anyにすると作成されるバイナリー(PEファイル)のヘッダー情報には、x86(0x14C)が書き込まれることで32ビットの実行バイナリーを示すようになります。

たとえば、BingMap SDKやSQLiteなどを使用する場合は、Anyではなく、x64、x86、ARMなどとターゲットとするCPUアーキテクチャを明示的に指定する必要があります。この理由は、BingMap SDKやSQLiteが VC++のランタイム ライブリーに依存しているからです。VC++ランタイム ライブラリーは、ターゲットCPUごとのネイティブコードを含んでいることから、Any(デフォルト)のターゲット プラットフォームを使用できなくなります。HTML/JavaScriptのストア アプリの場合は、コード自体はバイナリーではありませんが、依存するライブラリーに応じてターゲット プラットフォームを変更する必要があります。一方で、HTML/JavaScriptのストア アプリをインストールすると、JavaScriptコードがプリコンパイルされます。プリコンパイルすることで、実行時の速度がC#やVBと遜色がないようになります。

今度は、C++で作成するストア アプリのプロジェクトの構成マネージャを以下に示します。

f:id:ms_eva:20131112093822p:plain

C++/CXのターゲット プラットフォームは、Win32(デフォルト)、x64、ARMがあります。Win32が、x86のネイティブコードを出力することになります。C#やVBなどと違って、Anyが存在しないのがC++の特徴になっています。Anyという設定は、CPUアーキテクチャ非依存の開発環境だけの特別な設定になるわけです。つまり、C#とVBが出力するコードは、CPU非依存の中間言語(MSIL)であり、HTML/JavaScriptは単なるテキストなのでCPU非依存となるわけです。一方で、C++コンパイラーは、CPU依存のネイティブコードを出力するという理由から、ターゲットプラットフォームにこのような違いが存在するのです。

ストアへ提出するパッケージ

ストアへ提出する場合は、パッケージ(appxファイル)を作成する必要がありますが、この時にターゲット プラットフォームを注意する必要があります。

f:id:ms_eva:20131112100105p:plain

Neutralは、C#やVB、HTML/JavaScriptのアプリでVC++ランタイムに依存しない場合に選択することができます。Neutralで作成したパッケージは、x86/x64/ARMのプラットフォームで動作させることができます。

一方で、VC++ランタイムに依存していたり、VC++で開発したアプリの場合は、Neutralのチェックを取り、目的とするアーキテクチャに対してチェックを付けます。たとえば、x86/x64/ARMで動作させたい場合はx86/x64/ARMにチェックを付けます。

Windows 8.1向けに拡張された機能として、アプリケーション バンドルがあります。アプリケーション バンドルを使用しない場合は、同じバージョン番号で目的のアーキテクチャごとのパッケージを作成します。つまり、x86/x64/ARMという3種類のパッケージで、ストアに申請するときに3種類のパッケージをアップロードします。

アプリケーション バンドルを使用すると、x86/x64/ARMにチェックを付けても1つのアプリケーション バンドルを作成するようになります。作成されたアプリケーション バンドルの中にx86/x64/ARMのパッケージが含まれている構造となります。アプリケーション バンドルの本来の目的は、アプリケーションコードとリソースファイルの分離にあります。たとえば、複数の言語に対応するためのリソースであったり、ゲームコンテンツ向けのリソースなどが、アプリケーションコード以上に容量を必要とすることが良くありますから、このような時に容易にリソースを入れ替えできるようにするというのが、アプリケーション バンドルの目的なのです。

作成されるアプリ パッケージに応じて、適切にCPUアーキテクチャやアプリ パッケージなのか、アプリケーション バンドルなのかを選択するようにしてください。