Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

February 22, 2001 12:00 AM

Dynamic Wireless Applications, Part 2

Windows IT Pro
InstantDoc ID #20092
Rating: (0)

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.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.