Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  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 be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Mobile and Wireless Whitepapers Legacy Tools: Not Built for Today’s Helpdesk

Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Best Practice Tips for Managing and Supporting User-Owned Smartphones

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 Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


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 DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement