[完全初學] 第一個 Windows Store App- 使用格線 (Grid) 應用程式

為了方便開發者能快速進入 Windows Store App 的開發,Visual Studio 2012 內建了二種模版 (templates): 格線(Grid)及分割(Split)應用程式。本篇文章將一步一步教導初學者能由此開發出一個簡單的 Windows Store App。

 

首先在 Visual Studio 2012 中「新增專案」並選擇「格線應用程式 (XAML)」:

image 

 

在還未作任何更動前,各位可以直接按 F5,或是選擇以「模擬器」方式嘗試執行:

image

 

執行結果如下,各位在畫面上會發現,這個模版含有一些 Group(s),而每個 Group 又包含了一些 Item(s):

image

 

點進 Group Title 的話可看到這個 Group 的說明:

image

 

再點入 Item:

image

 

接下來我們要作的事,就是將這些灰灰黑黑的圖片,以及如亂碼般的文字替換成我們想提供的資訊。所以我們到 Visual Studio 中的「方案總管」,打開 DataModel 下的 SampleDataSource.cs 檔案,基本上只要修改這個 SampleDataSource.cs 檔,即可改變所有的 Group 及 Item 內的所有文字及圖片。

image

 

找到 SampleDataSource(),各位可看到所有預設文字及圖片即來自此處:

image

 

我們以最簡單直覺的方式來改動它,先更改 group1 及其第一個 item 來看看成果:

image

 

在此我是以介紹阿里山景點為例,資料來源為阿里山國家風景區官網:

image 

在更動過程中有 3 點請注意:

1. 各個 Item(s) 的描述,預設是一個字串變數 ITEM_CONTENT,請逐一把它替換成您想要呈現的字串即可。如我以上的例子是把 ITEM_CONTENT 替換成:

@”大凍山脈嶺延伸緊臨於奮起湖聚落東方….”

image

 

2. 圖片的部份,可以直接使用圖片的網址連結。當然,您也可以另存為圖檔後,加入至 Assets 目錄下,然後再指定相對應的路徑及檔名 (ex: Assets/圖檔名-1.jpg)。

image

3. 我在各個字串的前方加上了‘@’,以處理逸出字元 (Escape character) 等。

 

執行看看吧! 首頁、第二層及第三層的畫面分別為:

image

image

image

依以上步驟,您就可以一步一步來填入所有 Group(s) 及 Item(s) 的資訊了。

 

Visual Studio 2012 預設的這個格線應用程式模版用了6 個 Groups,每個 Groups 有3~6個數量不等的 Items,各位如果有用不到的 Group(s) 或 Item(s),只要在前面加上註解符號 (//) 即可。

image 

如果要新增一個 Item 的話,以上面為例,只要把整個 group1.Items.Add 及至分號(;) 的整個 statement 複製至下方,然後記得把”Group-1-Item-5” 改為 “Group-1-Item-6” 即可。

 

實作至此,各位已將一個 App 的主要呈現內容完成了。當然,要成為一個完整且能上傳至 Windows Store 的 App,我們還得完成以下:

 

1. 更改 App 名稱,如改為「阿里山國家公園主題之旅賞析」: 打開 Package.appxmanifest 檔並更改「顯示名稱」及「描述」:

image

image

 

2. 更改 Page Title: 打開 GroupedItemsPage.xaml.cs 並於 GroupedItemsPage() 加上一行:

this.pageTitle.Text = "阿里山國家公園主題之旅賞析";
image

3. 更改背景 (非必須): 開啟某個 .xaml 檔 (如 GroupedItemsPage.xaml),在下方的 XAML 視窗中點選至 <GridView 的位置,然後在右側的「屬性」->「筆刷」-> Background ->在「單色筆刷」中透過調色盤選擇顏色。

image

 

4. 您應注意到我在以上是直接使用圖片的網址來顯示圖片,也就是此 App 需要用到網際網路 (Internet),故要上架 Windows Store 的話需提供隱私權宣告,詳細說明可見隱私權聲明-最常見的退件原因。在這您可直接實作如以下:

在 App.xaml.cs 檔中的 OnLaunched() 最後加上:

SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;

然後加入以下兩個新方法即可:

private void OnCommandsRequested(SettingsPane sender, 

SettingsPaneCommandsRequestedEventArgs args)
{
    UICommandInvokedHandler handler =
             new UICommandInvokedHandler(onSettingsCommand);

    SettingsCommand privacy1Command =
             new SettingsCommand("privacystatementPage", "隱私權原則", handler);

    args.Request.ApplicationCommands.Add(privacy1Command);
}
async void onSettingsCommand(IUICommand command)
{
    SettingsCommand settingsCommand = (SettingsCommand)command;
    if (settingsCommand.Id.ToString().Equals("privacystatementPage"))
    {
        var success =
             await Windows.System.Launcher.LaunchUriAsync(
                    new Uri(@http://www.您的隱私權宣告網址.com));
    }
}

5. 加入 Share contract 的支援 (非必須)。比如您想在 Item 的頁面可以分享描述文字,則可在 ItemDetailPage.xaml.cs 檔中的 LoadState() 方法的最後加上:

try
{
    // Register for DataRequested events
    DataTransferManager.GetForCurrentView().DataRequested 

        += OnDataRequested;
 }
 catch (Exception) { }

然後加入以下這個新方法:

// 實作 OnDataRequested()
void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
    try
    {
       var dataPackage = args.Request.Data;
       dataPackage.Properties.Title = 
          ((SampleDataItem)this.flipView.SelectedItem).Title;
       dataPackage.Properties.Description = 
          ((SampleDataItem)this.flipView.SelectedItem).Subtitle;
       dataPackage.SetText(
          ((SampleDataItem)this.flipView.SelectedItem).Content.ToString()
          );
    }
    catch (Exception)
    { }
}

6. 最後,當然要製作專屬於此 App 的各種 Logo 圖檔了,各位可以參考Logo 製造機- 適用於Windows Store App 及 Windows Phone 8 App 以快速製作出 Logos.

 

完成了! 這樣的一個 App 就能在 https://appdev.microsoft.com/storeportals/zh-tw 中上傳了。

 

完整程式碼下載

Windows Store Dashboard 儀表板一覽

您的 Windows Store App 成功上架之後,就可以從「儀表板」(dashboard) 中查看 App 的各種狀態,如下載次數、使用方式、crash report、已賺了多少錢等等。

 

以下就以我的儀表板為例讓大家了解有哪些功能。

登入https://appdev.microsoft.com/storeportals/zh-tw/之後,首先看到的畫面會是所有進行中或已上架的應用程式:

image

 

已上架的應用程式:

image

 

點選已上架應用程式的「報告」,就會看到「應用程式摘要」;此頁面中可以看到這個 App 的下載、In-App Purchase、使用方式、評分、品質、財務的所有細節:

image

 

點選右上角「詳細資料」後都可以就各別項目展開,展開後還能選擇不同的時間週期(1個月、3個月、6個月、1年),以及市場、年齡或性別作套用。

「下載」可以看到每一天的下載次數:

image

image

 

透過「使用方式」了解使用者平均每一天花在你的 App 上多少分鐘:

image

 

「評分」可以了解使用者的評論,作為 App 改進的參考:

image

image

 

「品質」則可以看到 App 在被執行時,發生例外或損毀的狀況:

image

image

 

「財務」能看到此 App 收益及詳細交易記錄:

image

 

官方說明文件及進一步說明可參考: 分析您在 Windows 市集中的應用程式

在 Win8 App 中閱讀 PDF 或 XPS 文件

這篇文章中提到可以使用 Adobe 或是 Foxit 元件來閱讀 PDF 文件,但對一般開發者而言最大的難處是在 $$!! 是的,這兩家廠商提供的元件雖然功能豐富,但其價格也造成一般開發者的門檻。

 

好消息! 有一個可以免費使用的 WinRT 元件已在 Git 釋出!

 

原文說明在此:

Reading PDF and XPS on your Windows 8 application using WinRT (C#)

Reading PDF and XPS on your Windows 8 application using WinRT (JavaScript)

 

Git repo: http://git.ghostscript.com/?p=user/mvrhel/mupdf.git;a=summary

 

各位也可以直接下載其 Sample Code: http://www.catuhe.com/msdn/pdfreader.zip,將 PDF 文件呈現在 FlipView 讓使用者翻動:

 

也可以一次呈現2頁:

 

使用者Zoom in and ont,即可以看到 Vector PDF 的高解析度。

Optical zoom (bitmap based):

 

Vectorized zoom:

摩登開發人員訓練營 – 投影片及範例程式下載及錄影

於2013/3/28-3/29 進行的摩登開發人員訓練營中,「Windows市集應用程式最佳實踐」這場次的投影片及範例程式可於 http://sdrv.ms/ZzMsuo 下載。

image

 

投影片同時可在SlideShare下載或線上觀看:

image

主題皆是以實作為主,包含以下這幾項:

•「分享」(Share Contract)

•「搜尋」(Search Contract)

•右側工具列 (Charms Bar)

•如何儲存使用者個人設定? (Roaming 應用)

•取得目前位置 (Geolocation)

•使用 WebView 的眉角

•取得及處理 JSON 資料

•其他:

–播放音樂或音效 (MediaElement)

–選取本地或需端檔案 (FilePicker)

–背景執行或下載 (Background Task/Transfer)

 

當天的課程內容錄影:

image 

使用 JSON 及 Geolocation- 小於 50 行程式碼的 Windows Store App 又一番

我想寫個小 App ,首先是想抓取台北市政府資料開放平台 (http://data.taipei.gov.tw) 所提供的 JSON 資料,例如溫泉業者、停車場、各區運動中心等等,然後顯示選擇場所的附近地圖,進而取得由所在位置出發的路線規劃。

 

開始 coding! (此文所用程式碼在http://sdrv.ms/ZzMsuo,請自由下載使用)

 

我們先來看看台北市提供的「OK認證-游泳場所業」的資料如以下,可以看到「資料介接」的 JSON 連結為: http://data.taipei.gov.tw/opendata/apply/json/N0JCNzMwNEYtMkRDQi00ODNFLUIzQjMtN0E0ODM4RTU4NUUz ,此連結將被作為我的資料來源。

image

接下來打開 Visual Studio 2012,開啟一空白 Windows Store App 專案,打開 MainPage.xaml 並規劃介面如以下:

image

各位可以看到畫面左邊我拉了一個 ListBox 控制項,畫面右邊拉了一個 WebView,是準備用來呈現地圖的,同時右下角有個RadioButton group 及一個 Button 按鈕。

 

以下我實作了一個 GetJSON() 方法:

private async Task GetJSON()
{
     string strURI = "http://data.taipei.gov.tw/opendata/apply/json/N0JCNzMwNEYtMkRDQi00ODNFLUIzQjMtN0E0ODM4RTU4NUUz";
     var http = new HttpClient();
     http.MaxResponseContentBufferSize = Int32.MaxValue;
     var response = await http.GetStringAsync(strURI);

     JsonValue jsonValue = JsonValue.Parse(response.ToString());
     int arraySize = jsonValue.GetArray().Count;

     this.listArray = new string[arraySize];
     this.telArray = new string[arraySize];
     this.addrArray = new string[arraySize];

     for (int i = 0; i < arraySize; i++)
     {
          IJsonValue element = jsonValue.GetArray()[i];
          string strName = element.GetObject().GetNamedString("name");
          listArray[i] = strName;
          string strTel = element.GetObject().GetNamedString("tel");
          telArray[i] = strTel;
          string strAddr = element.GetObject().GetNamedString("poi_addr");
          addrArray[i] = strAddr;
     }
}

以上程式基本上作了兩件事:

1. 把 JSON 資料抓下來:各位可以看到我只用了一個 GetStringAsync() 方法就將資料抓取下來成為一個JSON字串。

2. 接下來是要處理所得到的 JSON 字串:在處理之前我們得先了解此 JSON 字串的結構,以此資料為例,會發現此JSON字串為一包含多個物件 (objects) 之陣列 (arrays),如以下:

image

了解資料結構後,就能參考使用 JavaScript 物件標記法這篇文章,如以上的程式碼,利用一個 for 迴圈讀取陣列中的所有物件,取得所需要的值;再於以下的 OnNavigatedTo() 方法中,將所有的游泳場所名塞入位於畫面左側的 ListView:

protected async override void OnNavigatedTo(NavigationEventArgs e)
{
     await GetJSON();
     for (int i = 0; i < listArray.Length; i++)
     {
          listBox1.Items.Add(listArray[i].ToString());
     }
     // Register for DataRequested events
     DataTransferManager.GetForCurrentView().DataRequested += OnDataRequested;
}

在此請注意,GetJSON() 方法中因為至少呼叫一個非同步方法(即 GetStringAsync()),所以在方法的宣告前要加一個 async ;同時在呼叫此 GetJSON() 方法之前得加上一個 await 的關鍵字。 (這部份可參考: 使用 Async 和 Await 設計非同步程式)

跑起來會長得像這樣:

image

接下來是實作當使用者點選 ListView 裡的游泳場所後,會在右邊的 WebView 中呈現 選取所在地的 Google 地圖 (透過URI string的方式):

private void listBox1_Tapped_1(object sender, TappedRoutedEventArgs e)
{
      strSelectedList = listBox1.SelectedValue.ToString();
      strSelectedAddress = addrArray[listBox1.SelectedIndex].ToString();
      strSelectedTel = telArray[listBox1.SelectedIndex].ToString();


      webView.Source = new Uri(Uri.EscapeUriString
("https://maps.google.com/?output=embed&num=1&saddr=" + strSelectedAddress));

      listName.Text = strSelectedList;
      listTel.Text = strSelectedTel;
      listAddr.Text = strSelectedAddress;
}

使用者點選後就會長得像這樣:

image

最後,我想讓使用者能看到由目前所在位置到選取地點的規劃路線,所以實作右下角的 Button 按鈕程式如下:

private async void Button_Click_1(object sender, RoutedEventArgs e)
{
     if (strSelectedAddress.Length > 0)
     {
          if (geo == null)
          {
               geo = new Geolocator();
          }
          try
          {
               Geoposition pos = await geo.GetGeopositionAsync();
               string strSADDR = pos.Coordinate.Latitude.ToString() + "," + 

                                 pos.Coordinate.Longitude.ToString();
               webView.Source = new Uri(Uri.EscapeUriString(
                                 "https://maps.google.com/?num=1&saddr=" + 

                                 strSADDR + "&daddr=" + strSelectedAddress + 
                                 "&dirflg=" + strDirFlg));
          }
          catch (Exception)
          {
               new Windows.UI.Popups.MessageDialog(

            "您的機器沒有定位服務(GPS)或目前服務是關閉的,請透過「設定」快速鍵重新開啟。 

            nYour location services are currently turned off. 
            Use the Settings charm to turn them back on.").ShowAsync();
           }
      }
}

各位可以看到我首先取得目前所在位置的經緯度,是透過 Geolocator.GetGeopositionAsync() 這個方法來取得;接下來只是再度重組一個 URI string,透過Google Maps 規劃路線即可。取得目前所在位置細節另可參考這篇文章

 

實作之後的執行畫面:

image  

程式碼: http://sdrv.ms/ZzMsuo

 

附註: 台灣目前一些公開資訊開放平台: 行政院農委會開放資料平台台北市政府新北市政府台中市台南市教育局文化部臺灣中央政府的資料入口網站「data.gov.tw 」

關於 WebView: 10 件你需要知道的事

    Ten Things You Need to Know About WebView 是美國微軟資深工程師 Matt Small 發表的文章,我發現有幾點特別值得提出來說明,讓大家更了解 WebView 在 Windows Store App 的應用,希望對大家有幫助;其文後有他的範例程式碼供下載。
    以下是他列出的 10 點需要注意的事:
    1. WebView is not a general-purpose browser
      • WebView 這個控制項的目的,是讓你能在 App 裡,連結到某個特定的網頁,以達到此 App 所欲提供的功能;而非讓使用者能任意瀏覽任何網頁。舉例來說,如果有些特定資訊可能會時常變動 (如即時路況等),與其重新上架你的 App,將這資訊放在 WebView 當然比較適當;但如果你的 App 只是純粹作為一個入口,僅是讓使用者透過 WebView 瀏覽到某個網站首頁,再讓使用者在網站中任意點選連結的話,是非常有可能在上架審查中被退件的。
    2. WebView always renders on top of XAML
      • 這點還滿有趣的,你會發現在 XAML 中 WebView 不論放在什麼位置,程式跑起來時 WebView 一定會擋在所有的控制項之上。原因是 WebView 並非 Control object 的 subclass 的關係;原文連結裡有解法可參考。
    3. WebView doesn’t do Flash.  Or Silverlight.  Or PDF.  Or any other ActiveX control or plugin.
      • 如第1點所言, WebView 並非是一個完整的瀏覽器,為了穩定性及效能的原因並不支援 Flash, Silverlight, PDF or ActiveX,同時「目前」也不支援某些 HTML5 的功能,如 AppCache, IndexedDB, programmatic access to the Clipboard, or geolocation.
    4. How to invoke Javascript inside the displayed webpage of a Webview
      • 簡單來說 WebView 可以透過 ms-appx-web 讀取並展示已包含在你的 App 專案中的 HTML 檔案,甚至執行其中的 JavaScript 副程式。而以下的 5, 6, 8 三點都算是延伸此點的應用。
    5. How to receive information from the WebView
    6. How to inject javascript into a WebView page
    7. How to clear the WebView cache
      • 很不幸的,並無法透過程式的方式來清除 WebView cache,只能透過 command line 的方式: C:Users<username>AppDataLocalPackages<PackageName>Attrib –H –S /S /D
    8. How to embed a font into your app to be used by WebView
    9. Launching other apps from a link inside WebView
      • 如何在 WebView link 中開啟其他的 App 呢? 其實 Windows Store Apps 是沒有辦法「直接」開啟某個 App 的,但能透過 Extension handlers 的「間接」方式來開啟某特定 App,也就是設定某副檔名 (extension) 的檔案 (如:.jpeg 檔) 可以用某個 App 開啟。如以下在專案的 .appxmanifest >「宣告」>「檔案類型宣告」作設定即可:
      • image
    10. How to get rid of those annoying JavaScript exceptions when debugging
      • 在 debug 時當 WebView 瀏覽到的網頁出現 JavaScript 例外,會出現 Just-In-Time Debugger 的惱人錯誤 (如例圖),要關掉它很簡單,只要在 Visual Studio 2012 中作以下設定即可:
      • Debug > Options and Settings > Debugging > Just-In-Time > Uncheck "Script"
      • 偵錯 > 選項和設定> 偵錯 > Just-In-Tim > 取消勾選「指令碼」
      • image
        其實以上大部份的內容在 WebView 的 MSDN 官方文件的 Remakrs 段落中都有說明,只是可能沒有很細節的描述,在此也一併轉貼如下給大家參考:
        Remarks
        WebView is not a Control subclass and thus does not have a control template. The display area is the Width and Height.
        WebView has the characteristic that other UI regions such as controls cannot be rendered on top of the WebView. This is because of how window regions are handled internally, particularly how input events are processed and how the screen draws. If you want to render HTML content and also place other UI elements on top of that HTML content, you should use WebViewBrush as the render area. The WebView still provides the HTML source information, and you reference that WebView through the SourceName property. WebViewBrush does not have this overlay limitation.
        If you want to display an interactive WebView that only occasionally has overlapping content (such as a drop-down list or app bar), you can temporarily hide the WebView control when necessary, replacing it with an element using a WebViewBrush fill. Then, when the overlapping content is no longer present, you can display the original WebView again. For more info, see the WebView control sample.
        WebView doesn’t support many of the UIElement events like KeyDown, KeyUp, and PointerPressed. A common workaround to this problem is to use WebView.InvokeScript with eval to use the HTML event handlers, and to use window.external.notify from the HTML event handler to notify the application using WebView.ScriptNotify.
        Note WebView always uses Internet Explorer 10 in document mode. Additionally, WebView does not currently support some HTML5 features including AppCache, IndexedDB, programmatic access to the Clipboard, or geolocation. Furthermore, WebView does not support the ms-appdata scheme, although it does support the ms-appx-web scheme. This enables you to load content files in your project.

      如何偵測目前所在位置 (Geolocation)

      許多的 Apps 都需要取得目前裝置的所在位置,才能進行如路線規劃、查詢附近美食等各式應用。而這類與裝置有關的 API ,Windows Runtime (WinRT) 都已經系統化的整理,讓 Windows Store App 開發者用很精簡的程式即能達到目的;以下就以如何取得所在位置的經緯度作介紹:

       

      於 Visual Studio 2012 (Express 版本免費下載) 之中新增一個 C# “空白Windows 市集”專案,然後在 MainPage.xaml 中加入一個 Button 及 WebView 元件如下:

      image

      新增以下這一行在 MainPage.xaml.cs 的前面:

      using Windows.Devices.Geolocation;

      雙點 Button,然後實作此按鍵的方法如下:

      private async void Button_Click_1(object sender, RoutedEventArgs e)
      {
          Geolocator geo = new Geolocator();
          Geoposition pos = await geo.GetGeopositionAsync();
      
          // 緯度+經度
          string strSADDR = 
               pos.Coordinate.Latitude.ToString() + "," 
               + pos.Coordinate.Longitude.ToString();
          // 以 Google Map 為例
          webView.Source = 
               new Uri(Uri.EscapeUriString(https://maps.google.com/?num=1&q= 
               + strSADDR));
      
      }

      請注意以上程式,我們只用了一個 GetGeopositionAsync() 方法就順利取得裝置的所在位置了! 同時,由於這個方法是一個 Async call,所以你需要在呼叫這個方法的函式之前加上 async 的宣告,否則會發生編譯錯誤。

       

      接下來,我們即可透過pos.Coordinate.Latitude.ToString(); 以及 pos.Coordinate.Longitude.ToString(); 分別取得緯度及經度資料,作為我們 App 的後續運用。

       

      比如 Bing Map, Google Map, Yahoo Map 等都提供了 API 甚至 URL String 的方式讓開發者使用,以上便是以 Google Map 使用 URL String 為例。

       

      如果你直接執行此程式並按下此 Button,應該會看到以下這個執行時期錯誤:

      image

      其中的描述為:

       

      WinRT 資訊: The required device capability has not been declared in the manifest.

      其他資訊: 存取被拒。 (發生例外狀況於 HRESULT: 0x80070005 (E_ACCESSDENIED))

      也就是沒有宣告這個 App 會使用到 GPS 的功能。你只要點開專案中的 .appxmanifest 檔,勾選位置(Location)即可:

      image

      順利執行的畫面會如以下:

      image

      image

      image

      完整程式碼可在此下載: http://sdrv.ms/WMMR9I

       

      完成以上練習之後,就可以發想許多應用,簡單一個案例如下:

      image

      延伸閱讀:

      快速入門:偵測使用者的位置 (本篇文章中的程式碼有誤,但只要將所有的 IGeoposition 置換成 Geoposition 即可順利編譯)

      地理位置範例
      Bing Maps SDK 範例
      Windows.Devices.Geolocation

       

      如何在未安裝 Visual Studio 2012 的機器上測試 Windows Store App?

      首先,在您的 Visual Studio 2012 專案中按右鍵,選擇”市集”->”建立應用程式套件”:

      image

      然後依以下步驟建立應用程式套件 (Application Package):

      image

      image

      image

      點選輸出位置之後,就會看到您的套件 (Application Package) 被包成一個 .appxupload 檔,加上一個資料夾 (output location)

       

      接下來只要把這整包 ( .appxupload 檔 + 資料夾) 整份 copy 到要測試的機器上,然後在此資料夾中找到一個 Add-AppDevPackage.ps1 的檔案,按右鍵以 PowerShell 執行即可。

       

      image

       

      以上這種作法稱為 Sideloading,但有兩點是需要注意的:

       

      1. 這台機器必需有一個有效的 Developer License: 作法是在以系統管理員身份開啟的 PowerShell 介面中執行: Show-WindowsDeveloperLicenseRegistration然後再輸入你的 Microsoft ID (及以前的MSN 帳號或 Live ID),這台機器就會擁有 3 個月期限的 Developer License.

      image

      2. 確保這台機器可以執行 PowerShell scripts: 作法是在 PowerShell 介面中執行: Set-ExecutionPolicy unrestricted 即可.

      image

      以上的這兩點,在同一台機器上只要作一次就好了,然後就可以在這台機器上安裝任何經由 Visual Studio 2012 打包出來的 Windows Store App!

       

      ARM-based 的機器?

       

      不論你的機器是 Intel-based (x86/x64) 或是 ARM-based 的 CPU,都可以用以上的方式來佈署。

       

      除了以上的方法,Visual Studio 2012 還提供了「遠端電腦」方式來作測試:

      image

      詳細設定則請參考 MSDN 的文章: 在遠端電腦執行 Windows 市集應用程式

       

      另外請注意,這篇文章說明的是在開發過程之中,以測試為目的佈署 Windows Store App 至別台機器的方法;若是要在企業內部進行 LOB Apps 的大量佈署的話,另有其他的考量及作法,請參考 TechNet 文章: 如何新增和移除應用程式

      呈現 PDF 文件

      目前,要在 Windows Store App 中顯示 PDF 格式的文件,至少有以下有兩種 SDK 可供選擇使用:

       

      FoxIt: http://www.foxitsoftware.com/company/press.php?action=view&page=201210241943.html

      Adobe: http://www.datalogics.com/products/rmsdk/

       

      其中 Adobe 提供的是其Adobe Reader Mobile SDK (RMSDK),支援 ePub 及 PDF 格式的 static content 以及 Adobe DRM.由 Datalogics 這間公司負責代理,有興趣的合作夥伴也可以直接與 Datalogics 的業務聯絡: sales@datalogics.com

       

      已有希臘的一個 App 以此進行實作及上架:

      image

       

      另外, Adobe 的另一項產品 Adobe Digital Publishing Suite (DPS) 雖還未支援 Windows Store App,但刻正進行整合上的努力,釋出正式支援版本的時程則未定。