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
V Furletovrb s
2013年 02月 27日 10:53
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
rb sV Furletov
2013年 02月 27日 21:21
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
V Furletovrb s
2013年 03月 04日 09:36
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
Marco BuettnerV Furletov
2013年 03月 05日 00:49
"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
V FurletovMarco Buettner
2013年 03月 08日 11:09
Thank you. It helped
Marco Buettner
Marco Buettner
2013年 02月 28日 03:04
Tizen doesn't support widgets at the moment.
Yunchan Cho
Yunchan Cho
2013年 05月 23日 07:59
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