Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


February 22, 2001

Dynamic Wireless Applications, Part 2

RSS
Subscribe to Windows IT Pro | See More Windows OSs Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

The infrastructure and development tools used to develop dynamic wireless applications with ASP parallel those used in Web development. This article shows how.

Dynamic wireless application development using server-page technology such as Active Server Pages (ASP) is currently the preferred way to deliver dynamic Wireless Application Protocol (WAP) applications.

Experienced Web developers who take on wireless applications will find that their existing skills transfer well to the new challenge, but they must learn Wireless Markup Language (WML) and the differing form factors of WAP devices. The infrastructure and development tools used to develop dynamic wireless applications with ASP parallel those used in Web development. Many developers use Microsoft's VisualInterDev, Allaire's Homesite, or any IDE as development environments. During application development, a text editor helps balance the WML's simple syntax and mediocre visual tools.

Server-page technology involves embedding the scripting language within the markup language. When the WAP device requests the dynamic WAP application URL, the Web server processes all the ASP script and delivers only the customized WML deck and cards to the wireless device.

The sample code shows a VBScript/WML combination used to check product stock levels in a wireless sales automation scenario. The code is given in simplified form here; the actual code will typically contain files, COM objects, functions, error handling, procedure calls and other advanced development features. For example, an error-handling code will prevent the WML deck from exceeding 1.5Kb, as could occur if too many product records were returned from the database query.

<% 
Response.ContentType = "text/vnd.wap.wml"

Dim dbConn, rsProducts, sql 

Set dbConn = CreateObject("ADODB.Connection") 
dbConn.Open "Driver={SQL 
Server};Server=test;UID=sales;PWD=steve;Database=update" 

sql="SELECT ProductName, ProductQuantity FROM Products" 
Set rsProducts = dbconn.Execute(sql) 
%> 

<?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="Home" title="StockLevel"> 
        <p align="center"> 
        <b>--Stock Level--</b> 
        </p> 
        <p align="left"> 
        </p> 
        <%
        Do while not rsProducts.EOF 
        Response.Write "<p>-" & rsProducts("ProductName") & 

        ":" & rsProducts("ProductQuantity") & "</p>" 
        rsProducts.MoveNext 
        Loop 
        Set rsProducts = Nothing 
        Set dbConn = Nothing 
        %>
</card> 
</wml> 

The WML deck and embedded VBScript lie within this ASP page, which shows a SQL Server connection, an embedded SQL statement, and a resulting recordset with products and the quantities. Within the StockLevel card, the loop goes through recordset and displays the product name and quantity. Note the Response.ContentType property set to the WAP MIME type.

This example demonstrates a simple product-list display. To develop the example into an application, use another deck to display product-category options to show in the first deck. The user could select a product category, which could be passed to the second deck by HTTP POST or GET commands. By using the request object, the variable could be captured and used in the SQL statement, resulting in the display of that category's products. These techniques apply to developing almost any type of application.

From the user's point of view, data entry on a WAP-enabled device works best by displaying a list of menu choices that lead to the next step. When users must tap repeatedly on the device's keypad to enter data, errors ensue.

Finally, WAP applications function in real time and thus require a constant wireless Internet connection during use. In the future, we'll explore synchronization solutions that provide offline access to application resources.

The next Wireless & Mobile UPDATE will discuss additional techniques and give some tips and tricks for developing dynamic wireless applications with ASP.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
No Jobs, No Excitement at Apple's Last Macworld Keynote

Apple CEO Steve Jobs made the right move in skipping out on his company's last appearance at Macworld: In a Tuesday keynote address at the conference, Apple had no interesting new products to sell, opting instead to spend mind-numbing amounts of time on ...

Where is Microsoft NetMeeting in Windows XP?

...

The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing