- Windows 10 開發教程
- Windows 10 - 首頁
- Windows 10 - 簡介
- Windows 10 – UWP
- Windows 10 – 第一個應用
- Windows 10 - 應用商店
- Windows 10 - XAML 控制元件
- Windows 10 - 資料繫結
- Windows 10 - XAML 效能
- Windows 10 - 自適應設計
- Windows 10 - 自適應 UI
- Windows 10 - 自適應程式碼
- Windows 10 - 檔案管理
- Windows 10 - SQLite 資料庫
- Windows 10 – 通訊
- Windows 10 - 應用本地化
- Windows 10 - 應用生命週期
- Windows 10 - 後臺執行
- Windows 10 - 應用服務
- Windows 10 - Web 平臺
- Windows 10 - 連線體驗
- Windows 10 - 導航
- Windows 10 - 網路
- Windows 10 - 雲服務
- Windows 10 - 即時磁貼
- Windows 10 - 共享契約
- Windows 10 - 移植到 Windows
- Windows 10 有用資源
- Windows 10 - 快速指南
- Windows 10 - 有用資源
- Windows 10 - 討論
Windows 10 開發 - 應用商店
Windows 應用商店對開發人員的好處在於,您可以銷售您的應用程式。您可以為每個裝置系列提交您的單個應用程式。
Windows 10 應用商店是提交應用程式的地方,以便使用者可以找到您的應用程式。
在 Windows 8 中,應用商店僅限於應用程式,並且 Microsoft 提供了許多商店,例如 Xbox 音樂商店、Xbox 遊戲商店等。
在 Windows 8 中,所有這些都是不同的商店,但在 Windows 10 中,它被稱為 Windows 應用商店。它以一種使用者可以在一個地方為所有 Windows 10 裝置找到各種應用程式、遊戲、歌曲、電影、軟體和服務的方式設計。
盈利模式
盈利模式是指在桌面、移動裝置、平板電腦和其他裝置上銷售您的應用。有多種方法可以在 Windows 應用商店上銷售您的應用程式和服務以賺取一些錢。
您可以選擇以下任何一種方法 -
最簡單的方法是在商店中提交您的應用,並提供付費下載選項。
試用版選項,使用者可以在購買之前試用您的應用程式,但功能有限。
使用 Microsoft 廣告在您的應用中新增廣告。
Microsoft 廣告
當您在應用程式中新增廣告並且使用者點選該特定廣告時,廣告客戶將向您支付費用。Microsoft 廣告允許開發人員從 Microsoft 廣告網路接收廣告。
適用於通用 Windows 應用的 Microsoft 廣告 SDK 包含在 Visual Studio 2015 安裝的庫中。
您也可以從 visualstudiogallery 安裝它
現在,您可以輕鬆地將影片和橫幅廣告整合到您的應用中。
讓我們來看一下 XAML 中的一個簡單示例,以使用AdControl在您的應用程式中新增橫幅廣告。
建立一個名為UWPBannerAd的新通用 Windows 空白應用專案。
在解決方案資源管理器中,右鍵單擊引用
選擇新增引用,這將開啟引用管理器對話方塊。
在左側窗格中,選擇通用 Windows 選項下的擴充套件,然後選中適用於 XAML 的 Microsoft 廣告 SDK。
單擊確定繼續。
下面是在其中添加了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 網站。
您也可以在應用程式中新增影片橫幅。讓我們考慮另一個示例,其中當單擊顯示廣告按鈕時,它將播放 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();
}
}
}
}
當以上程式碼在本地計算機上編譯並執行時,您將看到以下視窗,其中包含一個顯示廣告按鈕。
現在,當您點選顯示廣告按鈕時,它將在您的應用上播放影片。