System Setting: Providing System Setting Functionality
This tutorial demonstrates how you can access the device's settings for the home screen and lock screen wallpaper, incoming call ringtone, and email notification tone.
The System Setting API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The System Setting API is supported on the Tizen mobile Emulator and partly supported on the Tizen wearable Emulator (only the home screen and incoming call features).
Warm-up
Become familiar with the System Setting API basics by learning about:
-
Managing the Device Wallpapers
Set the wallpaper of the home screen and the lock screen.
-
Managing Ringtones and Notification Tones
Set the ringtone for incoming calls and the tone for email notifications.
Managing the Device Wallpapers
Learning how to set the device wallpaper and get information about it is a basic application development skill:
-
To set the specified image as the lock screen wallpaper, use the setProperty() method:
function setLockscreenWallpaper() { tizen.filesystem.resolve("images/Background.jpg", function(imageFile) { try { tizen.systemsetting.setProperty("LOCK_SCREEN", imageFile.toURI().replace("file://", ""), successCB, errorCB); } catch (error) { console.log("Error: " + error); } }); }
-
To get the current system setting information for the home screen wallpaper, use the getProperty() method:
function getHomescreenWallpaper() { try { tizen.systemsetting.getProperty("HOME_SCREEN", successCB, errorCB); } catch (error) { console.log("Error: " + error); } }
Managing Ringtones and Notification Tones
Learning how to set ringtones and notification tones is a basic application development skill:
-
To set the specified audio file as the notification tone for emails, use the setProperty() method of the SystemSettingManager interface (in mobile and wearable applications):
function onSet() { console.log("It's set"); } tizen.filesystem.resolve("music/Favorite track.mp3", function(musicFile) { try { tizen.systemsetting.setProperty("NOTIFICATION_EMAIL", musicFile.toURI().replace("file://", ""), onSet); } catch (error) { console.log("Error: " + error); } });
-
To get the current system setting information for the incoming call ringtone, use the getProperty() method:
function onGet(value) { console.log("Current setting option value is: " + value); } try { tizen.systemsetting.getProperty("INCOMING_CALL", onGet); } catch (error) { console.log("Error: " + error); }