90 likes | 253 Views
11.2 . Khmer on Android Device (out of date). Prof. Oum Saokosal Master of Engineering in Information Systems, South Korea 855-12-252-752 oum_saokosal@yahoo.com. Khmer on Android Device.
E N D
11.2. Khmer on Android Device(out of date) Prof. OumSaokosal Master of Engineering in Information Systems, South Korea 855-12-252-752 oum_saokosal@yahoo.com
Khmer on Android Device Until now, the year 2012, Android released 4.0 Ice Cream Sandwich, yet still no support for Khmer Unicode. Some browsers like Firefox and Dolphin support Khmer Unicode but not correctly displayed. To solve this problem at the moment, we need to use a character font, e.g. ABC, to embed on a Website.
Khmer on Kohsantepheapdaily Currently, there is only site being able to display Khmer on Android device: www.Kohsantepheapdaily.com.kh Fortunately, I managed to know how to do it Next slide shows you how.
Make an App with ABC font Get the files for embedding Khmer from me!!! Copy all the files, including styles folder, into assets folder of a project.
In main.xml: <WebView android:id="@+id/webView1" android:layout_width="match_parent" android:layout_height="match_parent" /> In Java: public class KhmerAndroidActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebViewwv = (WebView) findViewById(R.id.webView1); wv.loadUrl("file:///android_asset/khmer.html"); } } Note: android_asset is a reference to assets folder
In khmer.html: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html> <head><title>Khmer Font on Android</title> <meta xmlns="http://www.w3.org/1999/xhtml" name="viewport" content="initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> <script type="text/javascript" src="styles/mobile.js"></script> <style xmlns="http://www.w3.org/1999/xhtml" type="text/css" media="screen"> @import "styles/mobile.css"; </style> </head> <body> <span class='kh20'>viTUPasaeyIg</span> <span class='kh24'>viTUPasaeyIg</span> <span class='kh28'>viTUPasaeyIg</span> </body> </html>
In mobile.css: if you wanna change a style, do it here. .kh20 { font-family: ABCTEXT05ARegular; font-size:20px; font-weight:normal !important; } .kh28 { font-family: ABCTEXT05ARegular; font-size:28px; overflow:auto; } .kh24 { font-family: ABCTEXT05ARegular; font-size:24px; overflow:auto; }