Old Blogs

Old blogs

How to sync stuff with Nokia Podcasting Application

Tips and tricks - March 31st, 2008 - Written by Jukka Eklund

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.


download_podcasting.jpg

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:

  1. * If your phone doesn’t have the Nokia Podcasting Application, download and install it from here: http://www.nokia.com/podcasting
  2. * Download and install the MWS from here: http://mymobilesite.net and create an account on that page using your PC.
  3. * Start the MWS, make sure it runs OK. You can keep all the default settings and select any connection you like. As a test, open the web browser in your phone and type in the URL 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.
  4. * You want your podcasts to be copied to the mass storage drive of your phone (microSD card or internal 8GB memory), which requires a minor configuration of the MWS. Start the S60 filemanager on your phone and copy the file 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.
  5. * This step is not necessarily needed, but it could make things easier in future: Create an OPML file (name it 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>

    Note how the URL points to “127.0.0.1″, which is the local URL that refers to the machine on which the webserver is running, i.e. your phone.

  6. * On your PC, create an RSS feed document and name it 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.

  7. * Connect your phone to USB mass storage again. Open the phones mass storage drive on the PC and create a folder /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.
  8. * Start the MWS and make sure it is connected. You can select any connection.
  9. * On the phone, start the Nokia Podcasting Application. Go into Directories and select Options, New, Web directory. Give it any name and type in the URL “http://127.0.0.1/podcasts/feeds.opml”. Select Done. Highlight the directory link you just created and select Options, Update. Select any connection if prompted. The little folder icon should now turn yellow. Click on it to open it, then click on the one feed that is in there to subscribe to that feed. You are now subscribed to a RSS feed that is stored locally on your phone.
  10. * Open the Podcasts view, find the new feed (”Local sync feed”). The UI should indicate “updated recently”. Open the feed and you should see one episode. Click on the episode to download it. The download should go pretty quick. Once the download finished, click on the episode to play it.

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

About the author Jukka Eklund

I have been working in the Finnish IT industry for over 10 years, and spend most of that time working with a some form of Internet service. [..]

Comments are closed.

Visit new S60 Blogs

You are browsing old S60 blogs. Please note that these sections are not updated any more. Go to the new S60 Blogs to find out the latest news!

New blog categories:

Categories

What is S60?