It’s good to get back to blogging after what seems like a long break. I have been rather busy of late. Life or the lack of one, has been blowing out of proportion to take up the remaining time. I thought I’d write about something different this time than my usual languages hoopla.
After much reluctance on my part I have joined the personalized wireless world and have succumbed to adding a tracking device to myself. Now I can be tracked examined and demanded and terrorized. I have a mobile phone (yes people, I haven’t had one before and this is my first). Such are the pleasures of life.
The Samsung C100
Of course buying a Samsung C100 these days, might be considered incredibly caveman-like in certain circles and worlds, but I still belong to an utterly insignificant little blue-green planet (some of) whose ape-descended life forms are so amazingly primitive that they still think digital watches are a pretty neat idea.
The Samsung C100 is lovely phone and for its price (which was only a 6.6k for me) is a rather good deal. There are however some things I don’t like too much about the C100. I have been with it only for a short time, so a there’s lot more I need to know. This is what I know of right now – I might be wrong, in which case, expect a comment below in due time. Also, drop me a comment if you know better.
Things I Don’t Like
· There is no MMS support
· The battery seem to take a long time to charge (fully from near empty) its been plugged in for 2+ hours now. Aaah it’s done.
· I can’t seem to find an option to add words to the T9 dictionary! I don’t think there is such an option. That’s pretty bad.
· Cannot find a way to mass transfer content from Phone memory to SIM and vice versa.
· Since the C100 has only an IrDa port I need a (30+mb) sized software from Samsung to work with it. I am yet to understand what sort of cable can work here.
· The battery doesn’t last too long – a little over day. I don’t actually blame the phone or the battery too much for this. The phone is very feature ring and has a real good display and sound qualities, both of which I think eat up the battery real fast. To add to that I just cant seem to stop tinkering with it – so that’s where the battery drains out.
What’s actually bothering me is that Samsung has stopped making this model (which is what I heard from the dealer) and has moved on to a similar but more expensive X100 phone. Maybe that could mean that the issues are fixed only in the X100 and they are left open issues for the C100.
I really wonder what sort of file system structure this device has and if I can programmatically interface to it somehow. There seem to be lots of questions about how to get things working on this phone on sites like this one:
Samsung SGH-C100
http://www.techtree.com/techtree/jsp/showstory.jsp?storyid=3781
WML anyone?
That said, let me come to why I am actually writing this. I was fairly excited about the fact that I can browse on this phone. The phone has a 65k color screen with a 128*128 resolution and a good pixel density making for good viewing.
The Hutch corporate connection I am on charges 100 bucks per month for unlimited GPRS access, which seemed pretty neat. The only caveat was that downloads maybe charged according to the web site.
I didn’t make much of the ‘downloads can be charged’ stuff and visited hutchworld – which the Hutch GPRS homepage. Hutch world has a collection of goodies, wallpapers, ringtones, games etc. the games were priced at 50 bucks each so that didn’t seem very nice, especially considering that I would be charged whether the game worked our not.
The wallpapers I found interesting. There seemed to be no price mentioned. So I go about trying various wallpapers. Some fit my screen; some were too large and so on. The fun continued till I had downloaded about two dozen of these (after much patience because this is a real slow connection) when I scrolled down till the bottom of the page.
There at the very bottom was strategically placed link that says ‘cost’. The cost link said – all wallpapers shall be charged at rupees 10 each. What ????
I would have never touched those things by a pole at that price ok. So now I easily owed Hutch about 200 bucks or more for absolutely nothing useful that I can think of. Come to thing of it, these are small 128*128 size (approx) images which are hardly a few kb and most look for corny. Why would anyone want to pay 10 bucks for that?
So here is the moral of the story – don’t go about downloading ‘wallpapers’ from the hutch network. Or as I was about to learn – don’t go about downloading content from any website – you’ve got to look very patiently before you notice someplace where they say how much you are being charged.
But why were these websites being charging so much for almost meaningless content? Was it such a big deal to be able to dish out content over a GPRS network?
I wanted to take a jab at it. Since I had heard of MMIT (the Mobile Internet Toolkit) for ASP.net I figured that it would be rather simple to do my own site that dishes out WML content. But unfortunately I didn’t have any site that hosted MMIT at my disposal so I was stuck.
So in infinite wisdom I decided to try doing WAP/WML in plain ASP.net. It was easily done. One of the time consuming parts was in figuring out that I has to set the Content-type HTTP header in the response to be text/vnd.wap.wml. This little fact I did not find documented anywhere.
I wrote a single aspx page that contained only C# code that would generate WML content.
I am pasting the code here, because some of you may find it useful and might want to host the code on your own servers. This page can be pointed at one of the one of the folders on your web-server where you want to provide content that can be accessed via your WAP enabled phone. The page lets you view contents on the folder as well as browse through any subfolders. Similar to the explorer lets you browse folders.
(a space has been added after every angular bracket in the code below deliberately – because this blog engine has some issues with tags being displayed).
< %@ Page Language="C#" Debug="true" %>
< %
string 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 title=""File Browser"">{0}< /card>< /wml>";
string up_content = @"< p>< a href=""list.aspx?path={0}"">up< /a>< /p>";
string dir_content = @"< p>< b>Subfolders< /b>< /p>< p>< i>{0}< /i>< /p>";
string gif_content = @"< p>< b>Available GIFs< /b>< /p>< p>< i>{0}< /i>< /p>";
string entry = @"< a href=""{0}"">{1}< /a>< br/>";
string content="";
string server_path = "content/w/";
string sub_path = Request.QueryString["path"];
string new_path = server_path;
bool up = false;
if(!(sub_path == null || sub_path == ""))
{
new_path = server_path + sub_path;
up = true;
sub_path="";
}
//////////////////////////////////////////
//This builds the GIF specific content
content = "";
string[] files = System.IO.Directory.GetFileSystemEntries(Server.MapPath(new_path),"*.gif");
if(files.Length != 0)
foreach(string file in files)
content += String.Format(entry,
new_path+System.IO.Path.GetFileName(file),
System.IO.Path.GetFileNameWithoutExtension(file));
gif_content = String.Format(gif_content, content);
else
gif_content = @"< p>No GIFs< /p>";
//This builds the DIR specific content
files = System.IO.Directory.GetDirectories(Server.MapPath(new_path));
"list.aspx?path="+sub_path+System.IO.Path.GetFileName(file)+"/",
System.IO.Path.GetFileName(file));
dir_content = String.Format(dir_content, content);
dir_content = "";
///////////////////////////////////////////////////
//Up the Dir tree link
if(up)
int prev = 0;
char[] arr = sub_path.ToCharArray();
for(int i =0;i
if(arr[i] == '/')
prev=i+1;
string path = sub_path.Substring(0,prev);
if (path.Length == 0)
up_content = @"< p>< a href=""list.aspx"">up< /a>< /p>";
up_content = String.Format(up_content,path);
up_content = "";
//Summarise
string wml_content = up_content + dir_content + gif_content;
wml = String.Format(wml,wml_content);
//Write back
Response.ContentType="text/vnd.wap.wml";
Response.Charset = "";
Response.Write(wml);
Response.End();
%>
To deploy this onto your own web-server simply copy this onto some vdir. The server needs to be ASP.Net enabled of-course. You can change the server path (marked in bold above) to point to some folder where you have provided content you want to browse and download from your phone.
With a little bit of tinkering I figured that the Samsung C100 accepts images as GIF types. The screen display area for images is about 128*100, so just about any GIF of that dimension should display fine on this phone. I am yet to work out why animated GIFs don’t work and how the animated content on my phone works.
Of course all of this may not seem very interesting to someone who has done all this before or has found documentation about this – but if you haven’t then it will save you lots of trial and error time.
I could post a link to a URL to a WAP site I have up now, but that has some sensitive content. So I will set up something a little more generic and post a URL here so that people with Samsung C100 phones can pull off some content. (Of course I will figure out a way by which you will have to leave ‘thank you’ comments on my blog per download you make . . . kidding).
Having done this much, a thought bothered me – it is understandable how hutch can charge me, I am their customer and it is their network so there must be some easy way to identify who is downloading what. But what about the open network out there? How can people on a random server out there identify me so that they can send a bill that will be added up on my hutch monthly bill?
I called up the Hutch customer care line and the lady at the other end of the line had no clue how this happened. All she could say was that ‘all websites know who you are’ and that all download bills will show up on your monthly bill.
Hmm… this all ‘websites know who you are’ part didn’t sound too comfy. How could they know who I was? When I visit a website with a browser there is no way they can tell who I am. So how can they know in this case?
Which caused me to write this;
string 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 title=""Debug"">{0}< /card>< /wml>";
string hdr_content = @"< p>< b>Headers< /b>< /p>< p>< i>{0}< /i>< /p>";
string entry = @"{0} = {1}< br/>";
foreach(string key in Request.Headers.AllKeys)
content += String.Format(entry,key,Server.HtmlEncode(Request.Headers[key]));
hdr_content = string.Format(hdr_content,content);
wml = String.Format(wml,hdr_content);
This code, as would be obvious to ASP.net folk, simply returns all the HTTP headers. I set this up on my site and when I visited this from the phone – surprise! This is what the headers contained:
Connection = close
Via = Jataayu CWS Gateway 3.0.0
Accept = text/vnd.wap.wml, text/vnd.wap.wmlscript, image/vnd.wap.wbmp, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.wap.multipart.related, application/vnd.wap.multipart.mixed, application/x-up-device, application/vnd.phonecom.mmc-wbxml, application/vnd.phonecom.mmc-wbxml, application/vnd.phonecom.im, application/octet-stream, application/vnd.openwave.pp, application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.coc, application/vnd.uplanet.bearer-choice-wbxml, image/vnd.wap.wbmp, image/png, image/gif, application/x-mmc.wallpaper, application/x-mmc.wallpaper, application/x-mmc.picture, application/x-mmc.picture, application/x-mmc.ringtone, text/vnd.sun.j2me.app-descriptor, application/java-archive, application/vnd.smaf, */*
Accept-Charset = utf-8
Accept-Language = en
Host = www.thinkingms.com/pensieve
User-Agent = SEC-SGHC100G/1.0 UP.Browser/5.0.5.1 (GUI)
X-MSISDN = 9198867xxxxx (-- my number was here)
X-Network-Info = UDP, 10.16.2.135
While a request from my browser would look like this:
Cache-Control = no-cache
Connection = Keep-Alive
Accept = */*
Accept-Encoding = gzip, deflate
Accept-Language = en-us
Cookie = portalroles=C7A51492F7A60F5D8E518..(truncated)Host = www.thinkingms.com/pensieve
User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
The request from the phone actually seems to be sending out a lot of data – most of this data, I would expect, does not originate form the phone (does it?) but could be added by the WAP gateway of Hutch. I really need to read up some more on these standards.
The request from the browser (in this case IE 6) sends out no personally identifiable data. Where that from my phone – my phone number is in there!!! (I have edited the actual number in the display) Creeps! so much for privacy in the wireless world. To put this in context – every single website you go to in the wireless world can actually get your personal phone number. I really need to see how this information can be used in regards to other data.
Looking at the headers also gives lots of other valuable information such as the model of my phone and its browser. What content type it can accept (this is very interesting) notice the phone can accept GIF as well as PNG (among other things).
I will stop this blog entry at that note. Hopefully in the future I will have more to write about my steps into the wireless world and about the C100. If there are reasons why this whole thing is naïve or obvious information – please do point me at the right documentation, I presently have none. I recommend that you take things here with a grain of salt.
You can download the aspx files from here.
Foot Note:
I just got Pandu, who has a Reliance phone (that runs on the CDMA network), to access the debug aspx page. This is what his headers looked like:
Via = Jataayu CWS Gateway
Accept = text/vnd.wap.wml, image/png, image/gif, application/vnd.wap.wmlscript, image/vnd.wap.wbmp, image/bmp
Accept-Charset = iso-8859-1, utf-8
User-Agent = jBrowser/J2ME Profile/MIDP-1.0 Configuration/CLDC-1.0
Proxy-Connection = Close
X-Client-IP = 97.243.29.205
X-Rapmin-Id = 1067263483
His IP address seems to be a constant and there seems to be no direct ID available here (wonder what the X-Rapmin-Id is).
Remember Me
a@href@title, strike
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Roshan James
E-mail