200 likes | 431 Views
Developing International Applications for Mobile Devices with .NET. Achim Ruopp International Program Manager Microsoft Corporation. Definitions. globalization
E N D
Developing International Applications for Mobile Devices with .NET Achim Ruopp International Program Manager Microsoft Corporation
Definitions • globalization The process of designing and implementing a product and/or content (including text and non-text elements) so that it can accommodate any local market (locale). • localizability The ability of a product and/or content (including text and non-text elements) to be adapted for any local market (locale). • localization The process of adapting a product and/or content (including text and non-text elements) to meet the language, cultural, and political expectations and/or requirements of a specific local market (locale).
Agenda • focus on differences to desktop application development with .NET and how to deal with them • ASP.NET Mobile Controls • introduction • globalization • localizability and localization • .NET Compact Framework • introduction • globalization • localizability and localization • Windows CE .NET 4.1 • customizing globalization support • multi-lingual user interface support • References
.NET Application Models for Devices Visual Studio.NET .NET Framework code web pages webapplications client-sideapplications Mobile Web Browser .NET CompactFramework
ASP.NET Mobile Controls - Overview • set of ASP.NET controls in Visual Studio .NET 2003 to create mobile web applications • for Visual Studio .NET 2002 known as Mobile Internet Toolkit • broad support for connected devices with browsers for: • HTML • xHTML (Basic and Mobile Profile) • WML (Wireless Markup Language) • cHTML (compact HTML) • adaptive rendering
ASP.NET Mobile Controls – Overview • extensible and customizable controls and adapters • state management: application and session state • security through mobile forms authentication • a runtime and a designer • emulator support
Containers Lists Image MobileControl Text ‘Transfer’ Calendar AdRotator AdRotator Calendar Calendar Image Image CompareValidator List List ObjectList ObjectList PagedControl CustomValidator Form Form Panel Panel RangeValidator BaseValidator SelectionList SelectionList RegularExpression Validator PhoneCall PhoneCall StyleSheet RequiredField Validator Command Command TextControl Label Label TextView TextView Link Link ValidationSummary TextBox TextBox ASP.NET Mobile Controls – Object Model
ASP.NET Mobile Controls - Globalization • internal character encoding is Unicode • support for character set conversion to and from device character sets • all controls are globalized • display of localized control strings and exceptions requires: • installation of a language pack (available in 21 languages) and/or • Windows Server 2003 in the desired language
ASP.NET Mobile Controls - Globalization • how to make your application culture-aware: CultureInfo ci = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]); System.Threading.Thread.CurrentThread.CurrentCulture = ci; System.Threading.Thread.CurrentThread.CurrentUICulture = ci; • handling device character sets: • configure in web.config section <globalization/> • Content-Type:…;charset=XXX overrides setting in configuration for request encoding • how to use Accept-Charset: Response.ContentEncoding = Encoding.GetEncoding(Request.Headers["Accept-Charset"].ToString());
ASP.NET Mobile Controls - Localization • how to localize applications • add resource files (.RESX) to your project • create a resource manager in Application_Start: ResourceManager LocRM = new ResourceManager("LocProject.strings", typeof(MobileWebForm1).Assembly); Application["rm"] = LocRM; • use the resource manager to load string resources in a form: ResourceManager LocRM = (ResourceManager)Application["rm"]; this.Label1.Text = LocRM.GetString("txtLabel1"); • alternatively persist your resource manager in the session state
ASP.NET Mobile Controls - Demo • system requirements: • Visual Studio .NET 2003 • ASP.NET Mobile Controls Device Updates • Openwave SDK 6.1
.NET Compact Framework - Overview • lightweight version of the .NET Framework • designed for resource-constrained devices • online and offline • supported by Visual Studio .NET 2003 • two available programming languages: • Visual C# .NET • Visual Basic .NET • major areas of .NET Compact Framework: • base classes • drawing/Windows Forms • data/XML • XML Web Service Client • supported devices: • Pocket PC 2000/Pocket PC 2002/Pocket PC Phone Edition • any device based on Windows CE .NET 4.1 • soon: Smartphone
.NET Compact Framework – Class Subset System.Web System.WinForms Services UI Design ComponentModel Description HtmlControls Discovery WebControls System.Drawing Protocols Caching Security Drawing2D Printing Text Configuration SessionState Imaging System.Data System.Xml ADO.NET SqlClient XmlDocument Serialization Reader/Writers Design SqlServerCe Xslt/XPath System Collections IO Configuration Runtime InteropServices Security Net ServiceProcess Remoting Text Reflection Diagnostics Serialization Globalization Resources Threading
.NET Compact Framework- Globalization • globalization support in System.Globalization • culture support is factorized • Pocket PC: world-wide English+CJK • Windows CE .NET: WWE+CJK+Rest of World • uses some data from underlying operating system (Windows CE): • sort tables • character property tables • code page conversion tables • CurrentCulture/CurrentUICulture are device-wide settings • supports calendars based on the Gregorian calendar
.NET Compact Framework- Globalization • character encoding • internal character encoding is Unicode • System.Text.Encoding supports all codepages provided by • operating system • mlang.dll • character rendering • fonts can be installed by application • no complex script support (including bidirectional languages) • conclusion: for connected applications convert data to culture-invariant form before it reaches the device
.NET Compact Framework - Localization • full support for localization like in .NET Framework: • class System.Resources • support for managing multiple language resources in Visual Studio .NET • no localized properties contained in the runtime • managed exception strings are available in 10 languages • reduce memory requirements for distribution using custom .CAB files • emulator images in different languages can be installed for testing
.NET Compact Framework - Demo • system requirements: • Visual Studio .NET 2003 • additional localized emulator images
Windows CE .NET 4.1 • .NET Compact Framework 1.0 add-on downloadable from the web • customizing globalization support • locale support • codepages • fonts • input methods (IME, handwriting recognition, keyboard layouts) • multi-lingual user interface • operating system resources available in 12 languages
References • ASP.NET mobile controls: • Visual Studio .NET documentation • Microsoft websites: http://msdn.microsoft.com/nhp/Default.asp?contentid=28001370&frame=true http://www.asp.net/ (click on Mobile) • W3C: • XHTML: http://www.w3.org/TR/xhtml-basic/ • cHTML: http://www.w3.org/TR/1998/NOTE-compactHTML-19980209/ • Open Mobile Alliance: http://www.openmobilealliance.org/ • B4: “Building a Multi-lingual, Multi-cultural Web Site with the Microsoft .NET Framework” (François Liger)
References • .NET Compact Framework • Visual Studio .NET 2003 documentation • GotDotNet: http://www.gotdotnet.com/team/netcf/ • TA1: “Internationalization Features of Microsoft.NET” (Bill Hall) • B3: “Globalization with Microsoft .NET Framework” (François Liger) • Windows CE .NET 4.1 • Windows CE .NET 4.1 documentation • .NET Compact Framework 1.0 RTM download: http://microsoft.com/downloads/details.aspx?FamilyId=033AFC0E-B968-42F3-9A19-B2E71040F0F0&displaylang=en