2016-10-11 26 views
1

我創建了一個Web Widget,我想推送到我的手錶。 Tizen Documenation表示小部件不能單獨部署。所以,我試圖將我的Widget與Web應用程序捆綁在一起。我已經成功地將Web應用程序推送到了我的手錶上,但是我無法使用該小部件。我嘗試按以下步驟操作:https://developer.tizen.org/development/getting-started/web-application/application-development-process#multi如何使用Tizen Web應用程序爲我的智能手錶打包Tizen Web Widget?

我的Web小部件稱爲JohnDoeWidget。捆綁它的Web應用程序叫做BuddyUI(這是示例應用程序)。在Tizen IDE中,在Project Explorer中,它顯示「JohnDoeWidget [With BuddyUI] wearable-2.3.2」。所以我認爲我正確地做了這個部分。當我將BuddyUI推送到我的手機上時,沒有它的小部件。

在BuddyUI config.xml中的T​​izen(或高級)菜單中,Web Widget部分沒有任何內容。 當然,這是問題!但是,我不知道如何將JohnDoeWidget添加到此。我嘗試手動編輯config.xml文件,但是當它生成時,它說「JohnDoeWidget存在一個不同的網頁構件項目。」。 BuddyUI config.xml看起來像這樣

<?xml version="1.0" encoding="UTF-8"?> 
<widget xmlns="(removing link)" xmlns:tizen="(removing link)" id="(removing link)" version="1.0.0" viewmodes="maximized"> 
    <tizen:application id="yUnJzQvDKJ.BuddyUI" package="yUnJzQvDKJ" required_version="2.3"/> 
    <content src="index.html"/> 
    <feature name="(removing link)/feature/screen.size.normal"/> 
    <icon src="icon.png"/> 
    <name>BuddyUI</name> 
    <tizen:privilege name=(removing link)/privilege/application.launch"/> 
    <tizen:profile name="wearable"/> 
    <tizen:setting hwkey-event="enable"/> 
</widget> 

我試圖做的是改變它到這個,沒有運氣。

<?xml version="1.0" encoding="UTF-8"?> 
<widget xmlns="(removing link)" xmlns:tizen="(removing link)" id="(removing link)" version="1.0.0" viewmodes="maximized"> 
    <tizen:application id="yUnJzQvDKJ.BuddyUI" package="yUnJzQvDKJ" required_version="2.3"/> 
    <content src="index.html"/> 
    <feature name="(removing link)/feature/screen.size.normal"/> 
    <icon src="icon.png"/> 
    <name>BuddyUI</name> 
    <tizen:privilege name="(removing link)/privilege/application.launch"/> 
    <tizen:profile name="wearable"/> 
    <tizen:setting hwkey-event="enable"/> 
    <tizen:app-widget id="Fttrlmw6YQ.JohnDoeWidget.JohnDoeWidget" primary="true"> 
     <tizen:widget-label>Hello Web Widget!</tizen:widget-label> 
     <tizen:widget-content src="index.html"> 
      <tizen:widget-size preview="preview.png">2x2</tizen:widget-size> 
     </tizen:widget-content> 
    </tizen:app-widget> 
</widget> 

我也試圖改變應用程序的小部件id來yUnJzQvDKJ.BuddyUI.JohnDoeWidget但提供了錯誤「JohnDoeWidget存在具有不同的Web Widget項目。」

如何將小部件添加到現有的Web應用程序?

- 編輯: 我也試過如下:

  • 我創建了一個新的Web應用程序
  • 捆綁一個新的Web控件與它
  • 它推到我的收藏。該應用顯示在我的手錶上,但小部件沒有。

回答

3

Web部件在Gear S2下不支持。 (我不能確定S3。)
看看這個document

網頁插件從2.3.2開始支持。但齒輪s2是2.3.1。

我不知道你的智能手錶是什麼,但我知道每個三星智能手錶操作系統在tizen 2.3.1下。

我在Tizen Studio最新版本的2.3.2模擬器上查看我的解決方案。 並確保它在仿真器上有效。
但它不適用於我的三星齒輪s2。

所以這是正確的操作「網絡小工具」不在當前時間的真實目標上工作。


不要編輯config.xml來添加小部件。

在您檢查用於在link的包多菜單中添加項目的小部件之後,Tizen Studio會將您的config.xml更改爲添加小部件。
你可以看到它在解壓縮BuddyUI.wgt

你的錯誤似乎是因爲重複的小部件標籤發生。
我認爲自動生成的config.xml可能會有兩個相同的app-widget標籤。

只需執行以下過程並構建UI項目。

In the Web UI application project context menu, select Properties > Tizen Studio > Package > Multi. 
Select the check box for the web widget applications, and click OK. 

您可以檢查並瞭解Tizen工作室如何製作它。只需解壓wgt文件即可。

我創建了基本的UI和TestWidget1,並將它合併爲一個具有上層進程的wgt文件。它顯示解壓縮後的文件樹。

├── author-signature.xml 
├── config.xml 
├── css 
│   └── style.css 
├── icon.png 
├── index.html 
├── js 
│   └── main.js 
├── signature1.xml 
└── widget 
    └── TestWidget1 
     ├── css 
     │   └── style.css 
     ├── icon.png 
     ├── index.html 
     ├── js 
     │   └── main.js 
     └── preview.png 

,也有以下的config.xml

<?xml version="1.0" encoding="UTF-8"?> 
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/BasicUI2" version="1.0.0" viewmodes="maximized"> 
    <tizen:app-widget id="LRVQWwNeO1.BasicUI2.TestWidget1" primary="true"> 
     <tizen:widget-label>Hello Web Widget!</tizen:widget-label> 
     <tizen:widget-content src="widget/TestWidget1/index.html"> 
      <tizen:widget-size preview="widget/TestWidget1/preview.png">2x2</tizen:widget-size> 
     </tizen:widget-content> 
    </tizen:app-widget> 
    <tizen:application id="LRVQWwNeO1.BasicUI2" package="LRVQWwNeO1" required_version="2.3.2"/> 
    <content src="index.html"/> 
    <feature name="http://tizen.org/feature/screen.size.all"/> 
    <icon src="icon.png"/> 
    <name>BasicUI2</name> 
    <tizen:profile name="wearable"/> 
</widget> 
+0

謝謝你的幫助,但問題仍然存在。我創建了一個新的Web應用程序,然後捆綁了一個新的Web小部件,然後將它推送到我的手錶。該應用顯示在我的手錶上,但小部件沒有。 – Onosa

+1

好吧我修正了答案,如果你的目標不是tizen,這是正常的操作2.3.2 –

相關問題