Professional Documents
Culture Documents
NET
Nguyen Trung Lap Lotus College
Introducing mobile.net
Mobile devices have become part of life MDs can connect to the Internet. To deliver any types of data, to any user, any place in the world! Mobile.net is a new platform for developing mobile applications
Key Technologies
Microsoft .NET Compact Framework is the smart device development framework for Microsoft .NET. ASP.NET mobile controls, known as the Microsoft Mobile Internet Toolkit (MMIT), build mobile Web applications. SQL Server CE is the compact database for mobile devices.
Key Technologies
Windows Mobile is a powerful and flexible mobile device platform(smart phone) Windows CE and Windows XP Embedded. (pocket pc, tablet pc)
Data and XML (System.Data and System.Xml namespaces, sql server, sql server ce ) Web Services GDI Support(System.Drawing) Base Classes(System.Threading, System.Net, System.IO ) IrDA Support(System.Net.IrDA ) Visual basic The option component
Included technology
Features Missing from the .NET Compact Framework Method Overloads Missing Controls
CrystalReportViewer, PageSetupDialog, PrintDialog, PrintDocument, PrintPreviewControl and PrintPreviewDialog Using the Windows CE API
XML Functionality
System.Xml.XPath namespace Xslt
Developing with Visual Studio .NET 2003 Visual Studio .NET include a set of prebuilt device profiles(contains information necessary to build applications that target specific devices ) Additions to the IDE
Templatespredefined configurations for common project types Device-specific controls Device emulators Automatic deployment of applications Remote debugging
Supported Languages
The .NET Compact Framework supports C# and Visual Basic .NET Projects are restricted to a single language, either C# or Visual Basic .NET Workaround: templet project
HScrollBar
ImageList
InputPanel
Label
ListBox
ListView
MainMenu
NumericUpDown
OpenFileDialog
Panel
PictureBox
ProgressBar
RadioButton
SaveFileDialog
StatusBar
TabControl
TextBox
Timer
Toolbar
TrackBar
TreeView
VScrollBar
DataGrid
Demo
MainMenu Toolbar InputPanel .....
Required
.NET compact framework May be SQLCE All .cab file for application, .netcpf, sqlce
After ceate the cab file, copy the suitable file into device and click to install
Images
MMITS FEATURE
Support for a variety of devices Write-once Web pages World-class tool support Customizability and extensibility
MOBILE WEBFORM
Is a special asp.net webform Is displayed by mobile devices Is a text file with an .aspx extention Content a set of mobile webform controls Automatically convert to suitable form for requesting devices
Codebehind
Content server side script
Whats WAP
Wap is a standard for accessing internet content via wireless client (mobile phone, PDA)
WAP stands for Wireless Application Protocol WAP is an application communication protocol WAP is used to access services and information WAP is inherited from Internet standards WAP is for handheld devices such as mobile phones WAP is a protocol designed for micro browsers WAP enables the creating of web applications for mobile devices. WAP uses the mark-up language WML (not HTML) WML is defined as an XML 1.0 application
WML
WML- wireless markup language WML inherited from HTML but base on XML, stricter than HTML WML is used to create wap pages Pages in wml are called decks Decks are constructed as a set of cards WML page have extension .wml
WMLSCRIPT
WML uses wmlscript to run simple code on client the same to java script in html wmlscript is a light java script language wmlscript are not embedded in wml page wml page only contain wmlscript url wmlscript need to be compiled into bytecode on server before run in a wap browser
WML Tags
The same to HTML tags All tags are case sensitive All tags must be properly closed
WAP Example
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card id="HTML" title="HTML Tutorial"> <p> Our HTML Tutorial is an award winning tutorial from W3Schools. </p> </card> <card id="XML" title="XML Tutorial"> <p> Our XML Tutorial is an award winning tutorial from W3Schools. </p> </card> </wml>
TEXT FORMAT
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xm l"> <wml> <card title="Formatting"> <p> normal<br/> <em>emphasized</em><br/> <strong>strong</strong><br/> <b>bold</b><br/> <i>italic</i><br/> <u>underline</u><br/> <big>big</big><br/> <small>small</small> </p> </card> </wml> ----- Formatting ----normal emphasized strong bold italic underline big small
TABLE
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card title="Table"> <p> <table columns="3"> <tr> <td>Cell 1</td> <td>Cell 2</td> <td>Cell 3</td> </tr> </table> </p> </card> </wml>
LINK
<anchor> tag always has a task ("go", "prev", or "refresh")
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card title="Anchor Tag"> <p><anchor>Next page<go href="test.wml"/> </anchor> </p> </card> </wml>
LINK
<a>
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card title="A Tag"><p><a href="test.wml">Next page</a></p> </card> </wml>
IMAGE
Input Field
A WML card can be set up to let a user enter information
<wml> <card title="Input"> <p> Name: <input name="Name" size="15"/> <br/> Age: <input name="Age" size="15 format="*N"/> <br/> Sex: <input name="Sex" size="15"/> </p> </card> </wml>
Timer
Timer function of WML. The time unit of the timer is 1/10 of a second. The example below will display a message for 3 seconds, and then take you to the file "test.wml":
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card ontimer="test.wml"> <timer value="30"/> <p>Some Message</p> </card> </wml>
<setvar> tag
Variable
Input field
<card id="card1"> <select name="schoolname"> <option value="HTML">HTML Tutorial</option> <option value="XML">XML Tutorial</option> </select> </card>
Use variable
<card id="card2"><p>You selected: $(schoolname)</p></card>
What is WMLScript?
WMLScript is the scripting language used in WML pages WMLScript is a light version of the JavaScript language WML scripts are not embedded in the WML pages. WML pages only contains references to script URLs WMLScript is compiled into byte code on the server before it is sent to the WAP browser WMLScript is a part of the WAP specification
The script is in a file called check.wmls, and the name of the function is go_url.
check.wmls File
extern function go_url(the_url) { if (the_url=="W3Schools") { WMLBrowser.go("http://www.w3schools.co m/wap.wml") } }
Data Types
WMLScript is a weakly typed language
Boolean Integer Floating-point String Invalid
WMLScript is not object-oriented -> is impossible to create your own userdefined data types
Functions
Related WMLScript statements can be executed together as a unit known as a function Syntax:
extern function identifier(FormatParameterList) { Block }; Example: function RunTime(distance, speed) { var time = distance / speed; return time; };
Functions (2)
When calling a function included with one of the WMLScript standard libraries, the library name must be included with the function call
Lang - Included in this library are functions for data type manipulation, absolute value calculations, and random number generation. Float - Typical functions provided by this library include sqrt(), round(), and pow(). String - Some of the functions included in this library are length(), charAt(), find(), replace(), and trim().
prompt()
Returnsthenearestintegerthatisnotsmallerthana specifiednumber Returnsthenearestintegerthatisnotlargerthana specifiednumber Returnstheintegerpartofaspecifiednumber Returnsthelargestpossiblefloating-pointnumber Returnsthesmallestpossiblefloating-pointnumber Raisesanumbertothepowerofasecondnumber andreturnstheresult Returnsthenearestintegertoaspecifiednumber Returnsthesquarerootofaspecifiednumber
isInt()