20 RMB per Month Unlimited WAP

It is old news already, but I think it is valuable information to visitors to Shanghai. China Mobile has decreased the price of GPRS. They are offering a package to give unlimited WAP access for 20 RMB per month. Here are the configuration details:

Access Point: CMWAP

Gateway: 10.0.0.172

CMWAP v.s. CMNET

I have been using GPRS from China Mobile for some time but I never really understand the difference between the two AP – cmwap and wmnet. The only thing I know was, to be able to access Internet, for example, from my laptop, or Dopod Smartphone to access Internet website like ebay.com, I have to use cmnet. If I only need to access WAP site, like WAP comment feed for this site, cmwap is enough. CMWap is cheaper – 20 RMB for all-you-can-eat while CMNET is charged by bytes.

You need to answer the question in the configuration section of your mobile.

Now, I understand the situation better.

CMWAP and CMNET are intentionally divided by China Mobile. They are two access points. If you configure your mobile to access CMNET, your mobile phone is assigned an IP address and the client can directly connects to web servers on the Internet, like microsoft.com, yahoo.com, wangjianshuo.com…

CMWAP is an application layer seperate that your client is assigned an IP address in the range of 10.*.*.*, and you can ONLY access sites with IP addresses in this range. That means, only the servers hosted by the closed system in China Mobile. There is one exception though. It is the mysterious 10.0.0.172 configuration. That is the ONLY WAP gate server on the 10.*.*.* network range. With this WAP gate way, you can access all the website (like a proxy) on the Internet that provides WAP protocal, like Wangjianshuo’s Blog WAP Edition. However, it is slow since there is only one point that you can access for the entire China Mobile.

So, just call 1860 to enable your unlimited WAP access today. :-) (Seems I am a China Mobile agent now).

My Blog on My Mobile Via WAP

These days, I have setup the WAP site for Wangjianshuo’s Blog. I can get the latest comments on my web site and the total hit count from my mobile. I’d like to share the source code and steps with all blog users – especially for MovableType owners since you can convert your web site to WAP site with the code I provide.

How to access the WAP site

If you have a WAP-enabled mobile, please visit the following web site:

http://home.wangjianshuo.com/wap/

Here is the two images (left is the home page displaying all the comments and the right picture shows the hit counter)

picture-ot715.wap-index.PNG picture-ot715.wap-hits.PNG

The above are the simulated OT301 screen using UP.Simulator. I hope I can give you a picture of the page on my Alcatel OT715 one day.

Note: If you click the link above in Internet Explorer, you will not see the page. Instead, you are prompted to download the page, since it returns “text/vnd.wap.wml” as content type which cannot be proccessed by Internet Explorer.

The WAP page – WML file

If you save the page to your local disk and open it in notepad, you will see the following codes:

<?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=”index” title=”Wangjianshuo’s blog”>

<p><a href=”index.asp?id=353″>Jian Shuo Wang</a></p>

<p><a href=”index.asp?id=352″>p1gs1ck</a></p>

<p><a href=”index.asp?id=351″>KLN</a></p>

<p>* <a href=”hits.cgi”>Hits</a></p>

</card>

</wml>

After you click the *Hits link, you get the following WML code:

<?xml version=”1.0″?>

<!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.1//EN” “http://www.wapforum.org/DTD/wml_1.1.xml”>

<wml>

<head>

<meta forua=”true” http-equiv=”Cache-Control” content=”max-age=0″/>

</head>

<card id=”hit” title=”Page Hit”>

<p>Page hits: 127502</p>

<p>[<a href=”index.asp”>Back</a>]</p>

</card>

</wml>

Code behind the sceen

I used an ASP file to do the job. You can easily convert it to Perl or PHP code. If you are using MovableType, follow the steps below to create a WAP index template.

1. Open MovableType console and open the blog you are editing.

2. Click “Templates” on the left navigation bar.

3. Click “Click new index template” in the Index Template section.

4. Enter “WAP Index” in Name field and “WAP/Index.asp” in the Output file field.

5. Use the code below in the Template body field.

6. Save the template and rebuild. You will have the WAP page at WAP/index.asp.

<%

‘ Copyright 2003 Jian Shuo Wang

‘ URL: http://wangjianshuo.com

‘ Author: Jian Shuo Wang

‘ Created: March 18, 2003

‘ Description:

‘ This page displays the latest comments

‘ on any mobile phone supporting WAP.

%>

<%

Response.ContentType=”text/vnd.wap.wml”

If Request(“ID”) = “” Then

Response.Expires = -1

End If

%>

<%

‘ The standard header every card need

%>

<?xml version=”1.0″?>

<!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.1//EN” “http://www.wapforum.org/DTD/wml_1.1.xml”>

<wml>

<%

Select Case Request(“ID”)

‘ =================================

‘ Comment content

‘ =================================

%>

<MTComments lastn=”5″>

<%

Case “<$MTCommentID$>”:

%>

<card id=”index” title=”<$MTCommentAuthor$>”>

<$MTCommentBody$>

<p>- by <$MTCommentEmail$> at <$MTCommentDate$> from <$MTCommentIP$></p>

<p>[<a href=”?”>Back</a>]</p>

</card>

</MTComments>

<%

Case “”:

‘ =================================

‘ Homepage – Comment Index

‘ =================================

%>

<card id=”index” title=”<$MTBlogName$>”>

<MTComments lastn=”10″>

<p><a href=”index.asp?id=<$MTCommentID$>”><$MTCommentAuthor$></a></p>

</MTComments>

<p>* <a href=”hits.cgi”>Hits</a></p>

</card>

<%

Case Else:

%>

<card id=”index” title=”Wangjianshuo”>

<p>Something wrong with the page</p>

<p><a href=”?”>Back</a></p>

</card>

<%

End Select

%>

</wml>

Comments on the code

1. Response.ContentType=”text/vnd.wap.wml” must be included since it let the WAP browser understand it is a WML content since it cannot be judged from the .ASP extension.

2. It may need some modification before it can work on your site.

Blog on WAP

http://home.wangjianshuo.com/wap/ is the new wap page for my blog. I can get the latest comment entries on my mobile phone. I will post it later about the source and steps.

Do not try to use your browser to open this page since it is in WML format and can only be read in a WAP browswer – typically a mobile phone with WAP function. You can have a try using this WAP simulator.

Update December 25, 2005

The wap location is changed to http://home.wangjianshuo.com/archives/wap/index.wml.