Add csharp guide for PhonenumberUtils 02/153602/2
authorJongkyu Koo <jk.koo@samsung.com>
Fri, 29 Sep 2017 01:53:48 +0000 (10:53 +0900)
committerEditor Lionbridge <TizenEditor.SEL@lionbridge.com>
Fri, 29 Sep 2017 08:50:58 +0000 (11:50 +0300)
PS2: Reviewed

Change-Id: I7d7f37ebce846c66817b384104ef2dbedd15b199
Signed-off-by: Jongkyu Koo <jk.koo@samsung.com>
org.tizen.guides/html/dotnet/phonenumber-utils.htm [new file with mode: 0644]

diff --git a/org.tizen.guides/html/dotnet/phonenumber-utils.htm b/org.tizen.guides/html/dotnet/phonenumber-utils.htm
new file mode 100644 (file)
index 0000000..d2c59ad
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
+       <meta http-equiv="X-UA-Compatible" content="IE=9" />\r
+       <link rel="stylesheet" type="text/css" href="../css/styles.css" />\r
+       <link rel="stylesheet" type="text/css" href="../css/snippet.css" />\r
+       <script type="text/javascript" src="../scripts/snippet.js"></script>\r
+       <script type="text/javascript" src="../scripts/jquery.util.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../scripts/common.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../scripts/core.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../scripts/search.js" charset="utf-8"></script>\r
+\r
+       <title>Phone Number Management</title>\r
+</head>\r
+\r
+<body onload="prettyPrint()" style="overflow: auto;">\r
+\r
+<div id="toc-navigation">\r
+\r
+       <div id="toc_border"><div id="toc">\r
+               <p class="toc-title">Dependencies</p>\r
+               <ul class="toc">\r
+                       <li>Tizen 4.0 and Higher</li>\r
+               </ul>\r
+               <p class="toc-title">Content</p>\r
+               <ul class="toc">\r
+                       <li><a href="#prerequisites">Prerequisites</a></li>\r
+                       <li><a href="#getting">Retrieving Location Information</a></li>\r
+                       <li><a href="#formatting">Formatting Phone Numbers</a></li>\r
+                       <li><a href="#normalizing">Normalizing Phone Numbers</a></li>\r
+               </ul>\r
+               <p class="toc-title">Related Info</p>\r
+               <ul class="toc">\r
+                       <li><a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1PhonenumberUtils.html">Tizen.PhonenumberUtils Namespace</a></li>\r
+               </ul>\r
+       </div></div>\r
+</div>\r
+\r
+<div id="container"><div id="contents"><div class="content">\r
+\r
+<h1>Phone Number Management</h1>\r
+\r
+<p>You can parse, format, and normalize phone numbers. The Tizen.PhonenumberUtils namespace is implemented with the libphonenumber open source library.</p>\r
+\r
+<p>The main features of the Tizen.PhonenumberUtils namespace include:</p>\r
+<ul>\r
+       <li>Retrieving location information\r
+       <p>You can <a href="#getting">get the location</a> based on the phone number, region, and language.</p></li>\r
+       <li>Formatting phone numbers\r
+       <p>You can <a href="#formatting">format the phone number string based on the region </a>using the dash ("-") and space (" ") characters.</p></li>\r
+       <li>Normalizing phone numbers\r
+       <p>You can <a href="#normalizing">normalize the phone number</a>.</p></li>\r
+</ul>\r
+\r
+<h2 id="prerequisites">Prerequisites</h2>\r
+<p>To enable your application to use the phone number management functionality:</p>\r
+<ol>\r
+   <li>To use the <code>GetNormalizedNumber()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1PhonenumberUtils_1_1PhonenumberUtils.html">Tizen.PhonenumberUtils.PhonenumberUtils</a> class, the application has to request permission by adding the following privilege to the <code>tizen-manifest.xml</code> file:\r
+<pre class="prettyprint">\r
+&lt;privileges&gt;\r
+   &lt;privilege&gt;http://tizen.org/privilege/telephony&lt;/privilege&gt;\r
+&lt;/privileges&gt;\r
+</pre>\r
+   </li>\r
+   <li>To use the methods and properties of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1PhonenumberUtils.html">Tizen.PhonenumberUtils</a> namespace, include it in your application:\r
+<pre class="prettyprint">\r
+using Tizen.PhonenumberUtils;\r
+</pre>\r
+       </li>\r
+</ol>\r
+\r
+\r
+<h2 id="getting">Retrieving Location Information</h2>\r
+\r
+<p>To retrieve the location from a phone number, use the <code>GetLocationFromNumber()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1PhonenumberUtils_1_1PhonenumberUtils.html">Tizen.PhonenumberUtils.PhonenumberUtils</a> class. Provide the region of the phone number and the language of the returned location string as parameters, using the values defined in the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1PhonenumberUtils.html#acfcfcabb066feb7d4a2ab2da337e745b">Tizen.PhonenumberUtils.Region</a> and <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1PhonenumberUtils.html#ab159dc3447ec930e04ed1016cf6e80a6">Tizen.PhonenumberUtils.Language</a> enumerations, respectively.</p>\r
+<pre class="prettyprint">\r
+var utils = new PhonenumberUtils();\r
+var location = utils.GetLocationFromNumber("0222550114", Region.Korea, Language.English);
+/// Method returns the location string "Seoul"\r
+</pre>\r
+\r
+<h2 id="formatting">Formatting Phone Numbers</h2>\r
+\r
+<p>To format a phone number to use region-specific separators, use the <code>GetFormattedNumber()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1PhonenumberUtils_1_1PhonenumberUtils.html">Tizen.PhonenumberUtils.PhonenumberUtils</a> class, which takes the region parameter as a value of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1PhonenumberUtils.html#acfcfcabb066feb7d4a2ab2da337e745b">Tizen.PhonenumberUtils.Region</a> enumeration:</p>\r
+<pre class="prettyprint">\r
+var utils = new PhonenumberUtils();
+var formattedNumber = utils.GetFormattedNumber("0222550114", Region.Korea);
+/// Method returns the formatted number string "02-2255-0114"\r
+</pre>\r
+\r
+<h2 id="normalizing">Normalizing Phone Numbers</h2>\r
+\r
+<p>To retrieve a phone number in a normalized format, use the <code>GetNormalizedNumber()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1PhonenumberUtils_1_1PhonenumberUtils.html">Tizen.PhonenumberUtils.PhonenumberUtils</a> class:</p>\r
+<pre class="prettyprint">\r
+var utils = new PhonenumberUtils();\r
+var normalizedNumber = utils.GetNormalizedNumber("0222550114");
+/// Method returns the normalized number string "+821022550114"\r
+</pre>\r
+\r
+<script type="text/javascript" src="../scripts/jquery.zclip.min.js"></script>\r
+<script type="text/javascript" src="../scripts/showhide.js"></script>\r
+</div></div></div>\r
+\r
+<a class="top sms" href="#"><img src="../images/btn_top.gif" alt="Go to top" /></a>\r
+\r
+<div id="footer">\r
+<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>\r
+</div>\r
+\r
+<script type="text/javascript">\r
+var _gaq = _gaq || [];\r
+_gaq.push(['_setAccount', 'UA-25976949-1']);\r
+_gaq.push(['_trackPageview']);\r
+(function() {\r
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
+})();\r
+</script>\r
+\r
+</body>\r
+</html>\r