Wednesday, 26 September 2007

A Talking Phone, with a Little Help

Thanks to cyke64 who read my previous post about my troubles with getting the Nokia python API doc in a phone-readable form. Cyke6f pointed me at the doc as a text file at http://cyke64.googlepages.com/PythonForS60_1_4_0_doc.txt

I still had some fun and games downloading this. My normally reliable Opera browser had a fit when clicking the link. It went into install-a-program mode and then just hung. I had hoped that I could find the downloaded file somewhere on the system, but several minutes searching yielded nothing. Swapping to the Nokia browser worked fine, but it lacks any feature to save a copy locally so I have to reload every time.

With the doc available, the solution to my challenge was within easy reach. The quick speech-synthesis program goes like this:

import audio
audio.say("hello world")

Now I've got that far the question is what next. The real interesting thing I'm aiming for is to combine data from the web with voice-synthesis to give me audio notifications while driving - traffic news being the obvious first application. So, next step: write a python app to download a web-page.

Sunday, 23 September 2007

Trying to Convert the Symbian Python API from PDF to Text

I'm still determined to boot-strap my python development environment on my Nokia E61 phone. By boot-strap I mean use only the phone itself to set-up the environment and not resort to an intermediate PC. Somewhat surprisingly the thing that is currently blocking my path is that the API doc for the Nokia python environment is in PDF format and I can't read it on my phone. I've tried to find a PDF reader for the phone with no luck. Now I'm trying to convert the PDF to something I can read.

My first stop was the adobe web page where I found their on-line tools page . This gave me two promising looking options. Either I could give them a URL to the PDF and they would convert it into text for me, or I could email in the PDF file and they would mail me back the text.

The paste-a-URL option highlights a problem that I commonly have when browsing on my phone: there is no option to view the source of a page. The Adobe form needed a URL. The URL was hidden in sourceforge's download system. My preferred browser on the E61 is Opera. Opera lets you cut and paste the URL of the page that you are currently on, but there is no way to get the address of other links on the page. The phone's built-in browser doesn't even let you cut and paste the current URL,

I was beaten by the URL option so on to the email. I had successfully downloaded the PDF so emailing it off should be straightforward. I would have to use the built-in email client as the Google mobile mail client that I prefer doesn't let you add attachments. I'd done that before so my settings were still available. I fired off the email to pdf2txt@adobe.com as directed. I closed the Nokia mail client and jumped back to the Google mail app. With baited breath I pressed refresh. The reply was already there...but it was just an email bounce with "unknown user". Hmph! I mailed Adobe for help but I'm not holding my breath.

Time for a new approach. Here's my thinking: the PDF must have been created from some source code

Saturday, 22 September 2007

PDF Reader on the Nokia E61 Phone

I'm right now struck in a rather extreme example of the DadHacker-needs-to-be-mobile theory. I'm on my commute into work and there has been a crash and the traffic has just stopped. Given I have now some free hacking time and a 3G network link I'll put the theory into practise.

In my quest to make my phone say "Hello World!" using python and no other computing power than that available on my Nokia E61 I've got to the point where I need a PDF reader in order to read the standard Symbian python docs. By default the E61 doesn't have a PDF reader. Checking out the All About Symbian forums I quickly find two options: one from Nokia and another called PDF+ from mBrain Software.

Trying the Nokia one first. I downloaded the sis file from the Nokia Asia site but the installation failed. Don't know why, but it is enough to make me try PDF+.

Trying the PDF+ reader from mbrains, but on clicking the sis link the browser displays the binary on the screen. I guess that the mime type is wrong on their server.

Trying the adobe site directly. Took some searching and headed off to "Reader LE". That link sends me off to a "partner site". This site gives me an option to buy but no preview. Sigh.

OK. Time for a re-think. Next time I'll try to get a text version of the API docs from somewhere. For now the traffic is moving and I'm off to work.

Thursday, 20 September 2007

Getting the Python Nokia API Doc on my Phone

So I'm getting my hand-held development environment together, albeit slowly. I've got my python interpreter, easyedit lets me edit the files next thing I need is some doc available on my phone.

The first place I went to look was Google, of course. "s60 python api doc" first of all gives me a couple of links to the LightBlue bluetooth API project which is not what I'm looking for. The next link is to Nokia forum so that looks promising but turns out to be an old PDF file. Fifth link down I find a link to the Nokia open-source wiki at http://wiki.opensource.nokia.com/projects/PyS60_documentation.

Disapointingly the latest doc available is in PDF format which I can't read on my phone. Still, I've downloaded the PDF and I'll look for a reader.

Monday, 17 September 2007

Ron Stevens on Mobile Python

Ron Stevens in his latest Python411 podcast talked about the future of python as a programming language to develop apps for mobile phones - see http://www.awaretek.com/python/ .

I'm interested in this avenue, but I think Ron missed an important first step. Rather than speech recognition I'd like to get my phone to do speech synthesis. Image the app: you're driving home on your daily commute when you phone tells you that it has been monitoring the traffic reports on the web and suggests that you take an alternative route. I have a feeling I've seen an API or library for the nokia/symbian python that lets you generate a voice. I think I'll take a shot at a spoken "Hello World" app.

Wednesday, 12 September 2007

Bootstrap Python Dev Environment on Symbian Phone

I wanted to get a dev env for python on my nokia e61. What I had in mind was an editor that I could use to type up python code on the phone which I could then run using the nokia python interpreter. Installing the python sis file from nokia was easy. The hard part was finding something to edit files in e:\Python. In the end I came across "easyedit" on the nokia forums. The sis file is at:

http://discussion.forum.nokia.com/forum/showthread.php?p=307143

It installed quite nicely. My little script of:


import appuifw

f = appuifw.Form([])
appuifw.title = 'dave'
title = appuifw.app.title
appuifw.note(u'ERE IAM JH\n' + title, 'info')

...works a treat.