Windows10-development-store

提供:Dev Guides
移動先:案内検索

Windows 10開発-ストア

開発者にとってのWindowsストアの利点は、アプリケーションを販売できることです。 すべてのデバイスファミリに対して単一のアプリケーションを送信できます。

  • ユーザーがアプリケーションを見つけることができるように、Windows 10ストアはアプリケーションが送信される場所です。
  • Windows 8では、ストアはアプリケーションのみに制限され、マイクロソフトは多くのストアを提供しています。 Xbox Music Store、Xbox Game Storeなど。

Windows 8

  • Windows 8ではこれらはすべて異なるストアでしたが、Windows 10ではWindowsストアと呼ばれます。 ユーザーがすべてのWindows 10デバイス用に1か所でアプリ、ゲーム、曲、映画、ソフトウェア、サービスの全範囲を見つけることができるように設計されています。

Windowsストア

収益化

収益化とは、デスクトップ、モバイル、タブレット、その他のデバイスでアプリを販売することです。 Windowsストアでアプリケーションやサービスを販売してお金を稼ぐには、さまざまな方法があります。

次の方法のいずれかを選択できます-

  • 最も簡単な方法は、有料ダウンロードオプションを使用してストアにアプリを送信することです。
  • ユーザーが機能を制限して購入する前にアプリケーションを試すことができるTrailsオプション。
  • Microsoft Advertisingを使用して、アプリに広告を追加します。

マイクロソフト広告

広告をアプリケーションに追加し、ユーザーがその特定の広告をクリックすると、広告主がお金を支払います。 Microsoft Advertisingを使用すると、開発者はMicrosoft Advertising Networkから広告を受信できます。

  • ユニバーサルWindowsアプリ用のMicrosoft Advertising SDKは、Visual Studio 2015によってインストールされるライブラリに含まれています。

  • visualstudiogalleryからインストールすることもできます。

  • これで、動画広告とバナー広告をアプリに簡単に統合できます。

    *AdControl* を使用してアプリケーションにバナー広告を追加する、XAMLの簡単な例を見てみましょう。
  • UWPBannerAd という名前の新しいユニバーサルWindows空アプリプロジェクトを作成します。

  • Solution Explorer で、 References を右クリックします。

UWP Banner Add

  • [参照の追加]を選択すると、[参照マネージャー]ダイアログが開きます。
  • 左側のウィンドウから、[ユニバーサルWindows]オプションの下にある[拡張機能]を選択し、 *Microsoft Advertising SDK for XAML をチェックします。

参照マネージャー

  • [OK]をクリックして続行します。
  • 以下に、 AdControl がいくつかのプロパティとともに追加されたXAMLコードを示します。
<Page
   x:Class = "UWPBannerAd.MainPage"
   xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:local = "using:UWPBannerAd"
   xmlns:d = "http://schemas.microsoft.com/expression/blend/2008"
   xmlns:mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"
   xmlns:UI = "using:Microsoft.Advertising.WinRT.UI"
   mc:Ignorable = "d">

   <Grid Background = "{ThemeResource ApplicationPageBackgroundThemeBrush}">
      <StackPanel HorizontalAlignment = "Center">
         <UI:AdControl ApplicationId = "d25517cb-12d4-4699-8bdc-52040c712cab"
            AdUnitId = "10043121" HorizontalAlignment = "Left" Height = "580"
            VerticalAlignment = "Top" Width = "800"/>
      </StackPanel>
   </Grid>

</Page>

上記のコードをコンパイルしてローカルマシンで実行すると、MSNバナーが表示された次のウィンドウが表示されます。 このバナーをクリックすると、MSNサイトが開きます。

MSNバナー

アプリケーションに*ビデオバナー*を追加することもできます。 [広告を表示]ボタンをクリックすると、Xbox Oneのビデオ広告が再生される別の例を考えてみましょう。

以下に示すのは、ボタンがいくつかのプロパティとイベントとともに追加される方法を示すXAMLコードです。

<Page
   x:Class = "UWPBannerAd.MainPage"
   xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:local = "using:UWPBannerAd"
   xmlns:d = "http://schemas.microsoft.com/expression/blend/2008"
   xmlns:mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"
   xmlns:UI = "using:Microsoft.Advertising.WinRT.UI"
   mc:Ignorable = "d">

   <Grid Background = "{ThemeResource ApplicationPageBackgroundThemeBrush}">
      <StackPanel HorizontalAlignment = "Center">
         <Button x:Name = "showAd" Content = "Show Ad" HorizontalAlignment = "Left"
            Margin = "138,296,0,0" VerticalAlignment = "Top" FontSize = "48"
            Click = "showAd_Click"/>
      </StackPanel>
   </Grid>

</Page>

以下に、C#でのクリックイベントの実装を示します。

using Microsoft.Advertising.WinRT.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

//The Blank Page item template is documented at
   http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace UWPBannerAd {

  ///<summary>
     ///An empty page that can be used on its own or navigated to within a Frame.
  ///</summary>

   public sealed partial class MainPage : Page {
      InterstitialAd videoAd = new InterstitialAd();

      public MainPage() {
         this.InitializeComponent();
      }

      private void showAd_Click(object sender, RoutedEventArgs e) {
         var MyAppId = "d25517cb-12d4-4699-8bdc-52040c712cab";
         var MyAdUnitId = "11388823";
         videoAd.AdReady += videoAd_AdReady;
         videoAd.RequestAd(AdType.Video, MyAppId, MyAdUnitId);
      }

      void videoAd_AdReady(object sender, object e){
         if ((InterstitialAdState.Ready) == (videoAd.State)) {
            videoAd.Show();
         }
      }

   }

}

上記のコードをコンパイルしてローカルマシンで実行すると、次のウィンドウが表示されます。このウィンドウには、[広告の表示]ボタンがあります。

追加を表示

これで、[広告を表示]ボタンをクリックすると、アプリで動画が再生されます。

追加ボタンを表示