|
» Subscribe » Favorite Links » What is S60? » Freeware & Trials » S60 devices » Hints and tips » About this blog |
» Announcements (19) » Feedback (10) » Fun (1) » General (5) » Tips and tricks (12) |
|
Main links » Mymobilesite.net » Discussions » Feedback For developers » Forum Nokia start page » Wiki » Discussions |
Research » Research project » Open Source project » Wiki » SourceForge Related technology links » Apache HTTP server » Mod_python » Python for S60 |
|
Subscribe RSS 2.0 feed |
Subscribe Atom feed If you wish to receive email notification, please here » |
|
» June 2008 » May 2008 » April 2008 » March 2008 » February 2008 » January 2008 » December 2007 » November 2007 » October 2007 |
|

« Take the Mobile Web Server Challenge! | Main | Going to Web 2.0 Expo? »
Here is a guest blog entry by Dennis Knothe, hope you find it useful!
Hello MWS fans,
I work as software architect in Nokia's Services and Software organization. The other day, I sent an email to Jukka describing how the Nokia Podcasting Application (http://www.nokia.com/podcasting) can subscribe to a RSS feed that is hosted by the Mobile Web Server (MWS) on the same device. I'm sure you think "why would I do that?". Well, this way it is possible to load episodes in the Nokia Podcasting Application without the need for a network connection in the phone. You can download episodes using the PCs Internet connection and copy them into the Nokia Podcasting Application. Furthermore, this example shows nicely that any S60 Internet application can be extended by accessing the MWS through a local URL. And because the MWS can be easily customized through Python scripts, this could be used to implement all sorts of exciting features.
Jukka apparently found this idea interesting enough and he asked me whether I would like to write a guest blog post about the setup I was using. I was happy to do that and you find the result in this post. I'm looking forward to read the comments and ideas that you have.
Please note that the steps below only describe the rough concept of using the MWS to enable a new use case in the Nokia Podcasting Application. I haven't spent any time of writing any code for the MWS (e.g. a Python script) to automate some of the steps. I would like to leave that as a challenge to you, dear reader.
I used a Nokia N95 with the most recent firmware and the Mobile Web Server version 1.2.2 beta. However, this should work on any recent Nokia S60 device. Please post a comment if you tried it on any other phone. Follow these steps:
http://127.0.0.1. That should show you the homepage of your webserver. If everything is OK, shut the web server down completely - don't just hide it.c:\data\web server\conf\httpd.conf to e:\. Now connect the USB cable to your phone, select Data transfer and edit the httpd.conf file using a text editor on the PC. Below the line Alias /WEBDAV "C:/Data/Web server/htdocs", add the line Alias /podcasts "E:/Podcasts/mwssync". Save the file and disconnect mass storage. With the S60 filemanager, copy the file e:\httpd.conf back to c:\data\web server\conf.feeds.opml) on the PC that looks like this:
<opml>
<body>
<outline text="Local sync feed" type="rss" url="http://127.0.0.1/podcasts/feed.rss" />
</body>
</opml>feed.rss:
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Local sync feed</title>
<item>
<title>Episode from 17 March 2008</title>
<pubDate>Mon, 17 March 2008 16:09:00 PDT</pubDate>
<guid>http://127.0.0.1/podcasts/audio080317.mp3</guid>
<enclosure url="http://127.0.0.1/podcasts/audio080317.mp3" length="123456" type="audio/mpeg" />
</item>
</channel>
</rss>Note how this RSS feed points again to the local URL, i.e. the mp3 file that it refers to is stored on the phone.
/Podcasts/mwssync on that drive. Use any mp3 file which is relatively small in size, rename it to audio080317.mp3 and copy it into that folder. Change the "length" attribute in the feed.rss enclosure tag to reflect the correct size of the mp3 file (in bytes). Copy the feeds.opml file along with the feed.rss file into the new mwssync folder. Disconnect USB mass storage. That's it! Now, what happened here? The podcasting application subscribed to and downloaded a feed which is hosted by the MWS on your phone. The podcasting application also downloaded the mp3 audio file from the MWS podcasts folder (e:\podcasts\mwssync) into its own storage folder, which is "e:\podcasts\sounds". You can verify with the S60 file manager that indeed you now have two copies of that file. Another interesting detail is that even though you selected connections in the MWS and the Nokia Podcasting Application, for the downloads from the local URL http://127.0.0.1 there wasn't actually any data transferred through those connections. You can verify that through the S60 Connection Manager which is located in the Tools, Connectivity menu in the N95.
As said, this setup just shows the concept. In order for this to be really usable, someone would have to automate some of the steps. Copying the mp3 file from the PC to the phone and generating the appropriate RSS feed document in the mwssync folder are obvious candidates. Also, it is not ideal that after the download of the mp3 file by the podcasting application that there are two copies of the file in the phone. One could write a MWS script that deletes the original file after the download finished. Or, even better would be if someone managed to write a MWS plugin which would load the mp3 file directly from the PC, without having to copy it first from the PC to the mwssync folder. Lots of challenges for you!
I hope I have inspired some ideas and maybe someone from the community does find some time to use this concept in practice. I'm looking forward to your comments, ideas and suggestions.
~Dennis