Languages

Menu
Sites
Language
Widgets

Hi, Can anyone tell me how to develop homescreen widgets on Tizen?   Thanks and Regards, Sridevi

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

8 Replies
rb s
To develop HOME_SCREEN widgets on Tizen Web app, use SystemSetting API. Code snippet is given below. // Define the success callback function successCallback() { console.log("Success to setProperty"); } // Define the error callback. function errorCallback(error) { console.log("Fail to setProperty" + error.message); } tizen.systemsetting.setProperty("HOME_SCREEN", "images/image1.jpg", successCallback, errorCallback);
V Furletov
Hi, rb s The code you posted isn't working - it logs "Success to setProperty" but home_screen wallpaper isn't set and you can see black screen in emulator instead of wallpaper - image1.jpg
rb s
Have you included image1.jpg image in your application. I guess you are not using .jpg image in your application. If you are using .jpg image and still getting same problem. Then share code snippet of your application so that you will get help.
V Furletov
Thank you for your help and sorry for late reply. Unfortunatly I didn't found how to attach files to reply so here is a link to my sample eclipse project archive - https://docs.google.com/file/d/0B4Dq5MDjoEc4T2J1UUdpUnVSeEU/edit?usp=sharing And yes - image0.jpg file exists in the project in images folder and it is jpg format )) And in case if there will be any problems with project archive then there is code from main.js file function setWallpaperSuccess(){ console.log("Wallpaper successfully set"); } function setWallPaperError(error){ console.log("Failed to set wallpaper: " + error.message) } var init = function () { $('div[data-role="page"]:first .ui-btn-back').bind("click", function(event) { var currentApp = tizen.application.getCurrentApplication(); currentApp.exit(); }); // TODO:: Do your initialization job console.log("init() called"); $( "#btnSetWallpaper" ).bind( "click", function(event, ui) { try{ tizen.systemsetting.setProperty("LOCK_SCREEN", "images/image0.jpg", setWallpaperSuccess, setWallPaperError); tizen.systemsetting.setProperty("HOME_SCREEN", "images/image0.jpg", setWallpaperSuccess, setWallPaperError); } catch (error){ console.log("Set wallpaper invokes exception: " + error.message); } }); }; $(document).bind('pageinit', init); Final console output is >Wallpaper successfully set >Wallpaper successfully set But there is black screen in the emulator background (both home and lock screens).
Marco Buettner
"images/image0.jpg" is not the path of the image0.jpg in your application. "images" is the location on my files =) Read here https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/filesystem.html try this function setWallpaperSuccess(){ console.log("Wallpaper successfully set"); } function setWallPaperError(error){ console.log("Failed to set wallpaper: " + error.message) } var init = function () { $('div[data-role="page"]:first .ui-btn-back').bind("click", function(event) { var currentApp = tizen.application.getCurrentApplication(); currentApp.exit(); }); // TODO:: Do your initialization job console.log("init() called"); $( "#btnSetWallpaper" ).bind( "click", function(event, ui) { try{ tizen.systemsetting.setProperty("LOCK_SCREEN", "wgt-package/images/image0.jpg", setWallpaperSuccess, setWallPaperError); tizen.systemsetting.setProperty("HOME_SCREEN", "wgt-package/images/image0.jpg", setWallpaperSuccess, setWallPaperError); } catch (error){ console.log("Set wallpaper invokes exception: " + error.message); } }); }; $(document).bind('pageinit', init);
V Furletov
Thank you. It helped
Marco Buettner
Tizen doesn't support widgets at the moment.
Yunchan Cho
Web dynamic box was announced on Tizen 2.1. Widget that you said is similar to web dynamic box in Tizen. Please refer to the following page. You can make web dynamic box like android widget, and dynamic viewer like android widget screen. https://developer.tizen.org/help/topic/org.tizen.web.appprogramming/html/guide/dynamicbox_guide/dynamicbox.htm