Guides of Tizen.System.SystemSettings class for DotNet 17/146117/3
authorjinwang.an <jinwang.an@samsung.com>
Fri, 25 Aug 2017 04:49:24 +0000 (13:49 +0900)
committerEditor Lionbridge <TizenEditor.SEL@lionbridge.com>
Mon, 28 Aug 2017 08:07:16 +0000 (11:07 +0300)
PS3: Reviewed

Change-Id: I0a73b7a00e2e3767e9b2fcbeb74c0fd5a402ec03
Signed-off-by: jinwang.an <jinwang.an@samsung.com>
org.tizen.guides/html/dotnet/system-settings.htm [new file with mode: 0755]

diff --git a/org.tizen.guides/html/dotnet/system-settings.htm b/org.tizen.guides/html/dotnet/system-settings.htm
new file mode 100755 (executable)
index 0000000..a262f49
--- /dev/null
@@ -0,0 +1,199 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+       <meta http-equiv="X-UA-Compatible" content="IE=9" />
+       <link rel="stylesheet" type="text/css" href="../css/styles.css" />
+       <link rel="stylesheet" type="text/css" href="../css/snippet.css" />
+       <script type="text/javascript" src="../scripts/snippet.js"></script>
+       <script type="text/javascript" src="../scripts/jquery.util.js" charset="utf-8"></script>
+       <script type="text/javascript" src="../scripts/common.js" charset="utf-8"></script>
+       <script type="text/javascript" src="../scripts/core.js" charset="utf-8"></script>
+       <script type="text/javascript" src="../scripts/search.js" charset="utf-8"></script>
+
+       <title>System Settings</title>
+
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="toc-navigation">
+
+
+       <div id="profile">
+               <p><img alt="Mobile C#" src="../images/mobile_s_cs.png"/> <img alt="TV C#" src="../images/tv_s_cs.png"/></p>
+       </div>
+
+       <div id="toc_border"><div id="toc">
+               <p class="toc-title">Dependencies</p>
+               <ul class="toc">
+                       <li>Tizen 4.0 and Higher for Mobile and TV</li>
+               </ul>
+
+               <p class="toc-title">Content</p>
+                       <ul class="toc">
+                               <li><a href="#prerequisites">Prerequisites</a></li>
+                               <li><a href="#settings">Retrieving System Settings</a></li>
+                               <li><a href="#events">Monitoring System Setting Changes</a></li>
+                       </ul>
+               <p></p>
+
+               <p class="toc-title">Related Info</p>
+               <ul class="toc">
+                       <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1System_1_1SystemSettings.html">Tizen.System.SystemSettings Class</a></li>
+               </ul>
+       </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+
+       <h1>System Settings</h1>
+
+<p>You can access the system configuration related to user preferences, such as ringtone, wallpaper, and font.</p>
+
+       <p>The main features of the <code>Tizen.System.SystemSettings</code> class include:</p>
+       <ul>
+               <li>Managing system settings
+               <p>You can <a href="#settings">retrieve the current system settings</a>.</p></li>
+               <li>Monitoring system setting changes
+               <p>You can set event handlers to <a href="#events">monitor changes in the system settings</a>.</p></li>
+       </ul>
+
+<h2 id="prerequisites">Prerequisites</h2>
+<p>To access system settings in your application:</p>
+<ol>
+       <li>To use the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1System_1_1SystemSettings.html">Tizen.System.SystemSettings</a> class, the application has to request permission by adding the following privilege to the <code>tizen-manifest.xml</code> file:
+<pre class="prettyprint">
+&lt;privileges&gt;
+   &lt;privilege&gt;http://tizen.org/privilege/systemsettings.admin&lt;/privilege&gt;
+&lt;/privileges&gt;
+</pre>
+       </li>
+       <li>To make your application visible in the Tizen Store only for devices that support the system setting features used in your application, add the corresponding feature keys to the <code>tizen-manifest.xml</code> file:
+<pre class="prettyprint">
+&lt;!--To use the WallpaperHomeScreen property and WallpaperHomeScreenChanged event--&gt;
+&lt;feature name="http://tizen.org/feature/systemsetting.home_screen"/&gt;
+</pre>
+       <p>The following table lists the feature keys required by the specific properties and events of the <code>Tizen.System.SystemSettings</code> class.</p>
+       <p align="center" class="Table"><strong>Table: Feature keys related to system settings</strong></p>
+       <table>
+       <tbody>
+               <tr>
+               <th>Feature key</th>
+               <th>Property</th>
+               <th>Event</th>
+               </tr>
+               <tr>
+               <td><code>http://tizen.org/feature/network.wifi</code></td>
+               <td><code>NetworkWifiNotificationEnabled</code></td>
+               <td><code>NetworkWifiNotificationSettingChanged</code></td>
+               </tr>
+               <tr>
+               <td><code>http://tizen.org/feature/network.telephony</code></td>
+               <td><code>UltraDataSave</code></td>
+               <td><code>UltraDataSaveChanged</code>, <code>UltraDataSavePackageListChanged</code></td>
+               </tr>
+               <tr>
+               <td><code>http://tizen.org/feature/systemsetting.font</code></td>
+               <td><code>DefaultFontType</code>, <code>FontType</code>, <code>FontSize</code></td>
+               <td><code>FontSizeChanged</code>, <code>FontTypeChanged</code></td>
+               </tr>
+               <tr>
+               <td><code>http://tizen.org/feature/systemsetting.home_screen</code></td>
+               <td><code>WallpaperHomeScreen</code></td>
+               <td><code>WallpaperHomeScreenChanged</code></td>
+               </tr>
+               <tr>
+               <td><code>http://tizen.org/feature/systemsetting.incoming_call</code></td>
+               <td><code>IncomingCallRingtone</code>, <code>SoundNotification</code></td>
+               <td><code>IncomingCallRingtoneChanged</code>, <code>SoundNotificationChanged</code></td>
+               </tr>
+               <tr>
+               <td><code>http://tizen.org/feature/systemsetting.lock_screen</code></td>
+               <td><code>LockscreenApp</code>, <code>WallpaperLockScreen</code></td>
+               <td><code>LockScreenAppChanged</code>, <code>WallpaperLockScreenChanged</code></td>
+               </tr>
+               <tr>
+               <td><code>http://tizen.org/feature/systemsetting.notification_email</code></td>
+               <td><code>EmailAlertRingtone</code></td>
+               <td><code>EmailAlertRingtoneChanged</code></td>
+               </tr>
+       </tbody>
+    </table>
+
+       <p>You can also check whether a device supports a given feature by using the <code>TryGetValue()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1System_1_1SystemInfo.html">Tizen.System.SystemInfo</a> class and accordingly enabling or disabling the code requiring the feature:</p>
+
+<pre class="prettyprint">
+const string HOME_SCREEN_FEATURE_KEY = "http://tizen.org/feature/systemsetting.home_screen";
+bool ret;
+
+if (SystemInfo.TryGetValue&lt;bool&gt;(HOME_SCREEN_FEATURE_KEY, out ret) == false)
+{
+    /// Error handling
+}
+</pre>
+       <div class="note">
+<strong>Note</strong>
+In TV applications, you can test the system settings functionality on an emulator only. Most target devices do not currently support this feature.
+</div>
+       </li>
+       <li>To use the methods and properties of the <code>Tizen.System.SystemSettings</code> class, include the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1System.html">Tizen.System</a> namespace in your application:
+<pre class="prettyprint">
+using Tizen.System;
+</pre>
+       </li>
+</ol>
+
+<h2 id="settings">Retrieving System Settings</h2>
+<p>You can retrieve system settings with the properties of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1System_1_1SystemSettings.html">Tizen.System.SystemSettings</a> class.</p>
+<p>To retrieve, for example, the ringtone for incoming calls, use the <code>Tizen.System.SystemSettings.IncomingCallRingtone</code> property:</p>
+<pre class="prettyprint">
+var getValue = Tizen.System.SystemSettings.IncomingCallRingtone;
+</pre>
+
+<h2 id="events">Monitoring System Setting Changes</h2>
+<p>You can set up notifications about system setting changes by defining event handlers and registering them for the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1System_1_1SystemSettings.html">Tizen.System.SystemSettings</a> class events.</p>
+<p>To monitor, for example, when the ringtone for incoming calls changes:</p>
+       <ol>
+               <li>Define the event handler and register it for the <code>IncomingCallRingtoneChanged</code> event:
+
+<pre class="prettyprint">
+private static void OnIncomingCallRingtoneChanged(object sender, Tizen.System.IncomingCallRingtoneChangedEventArgs e)
+{
+    Assert.IsInstanceOf&lt;string&gt;(e.Value, "OnIncomingCallRingtoneChanged: IncomingCallRingtone not an instance of string");
+}
+
+Tizen.System.SystemSettings.IncomingCallRingtoneChanged += OnIncomingCallRingtoneChanged;
+</pre>
+               </li>
+               <li>When you no longer need the event handler, deregister it:
+<pre class="prettyprint">
+Tizen.System.SystemSettings.IncomingCallRingtoneChanged -= OnIncomingCallRingtoneChanged;
+</pre>
+               </li>
+       </ol>
+
+<script type="text/javascript" src="../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../scripts/showhide.js"></script>
+</div></div></div>
+
+
+<a class="top sms" href="#"><img src="../images/btn_top.gif" alt="Go to top"/></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+
+</body></html>