Archive for the 'Symbian Python' Category

accelball: Python + N95 accelerometer demo

Posted in Mobile Platform, N95, Symbian Python on February 2nd, 2008 at 23:05:15

So, today, I built a small application to demonstrate the use of the accelerometer built into the Nokia N95. I decided to convert a simple example: the ‘’ example that ships with 홀덤사이트 Nokia’s distribution of Python for Series 60 (SourceForge).

The example uses the arrow keys to move a ball around the screen. Instead, I wanted to tilt the screen to do it.

The result came out reasonably well: I even used the webcam on the eeepc to put together a little video:

The code is available from my Symbian page, which has received so few changes that it doesn’t actually even mention my 6600 that I got years ago, and have since upgraded from.

In my searches, I wasn’t able to find a lot of source code for pure-Python scripting using the accelerometer, so hopefully if anyone is looking for demos of accelerometer usage, they can take this as an example in Python.

Love to hear any feedback if anyone else gives it a shot…

Note to self: NMEA_to_DecDeg

Posted in Bluetooth, GPS Devices, Locality and Space, Mobile Platform, Symbian Python on April 27th, 2006 at 08:50:40

Note to self:

The NMEA\_to\_DecDeg function is documented in Mapping Hacks, hack #62, “Build a Car Computer”.

(I’m going to be working quite a bit on my gsmlocation stuff in the next couple weeks, building up to a lightning talk presentation at Where 2.0 on June 13th. If you have a Bluetooth GPS and a Series 60 Symbian cell phone, please talk to me: I could use your help in building up a larger dataset.)

GPS Display

Posted in Bluetooth, GPS Devices, Mobile Platform, Python, Symbian Python on January 14th, 2006 at 14:32:32

Today, there are a large number of cheap bluetooth GPS devices on the market. These devices allow you to connect to the device wirelessly, which is great for when you’re driving and don’t want cables draped all over the car.

However, what happens when you can’t drag your computer out to act as a display of your position? No bluetooth GPS on the market today for under $500 has a display of any kind. When you consider that these things can be had for $70, that makes purchasing one go from likely, to ridiculous. What’s the point of a handheld, easy to use GPS if you can’t use it to see where you are?

GPSDisplay ScreenshotIf you’ve been asking this question, I’ve got software which has an answer for you. GPSDisplay will allow you to connect to NMEA compatible Bluetooth GPS devices and display your position fix. It is written entirely in Python, using NMEA code from Forum Nokia. It requires only that you first install Python for Series 60 on your device, and should work on all first and second generation Series 60 phones. Simply download the .sis file, send it to your phone, and you’ll be all set to go — you can use your phone as a display for that new cheap Bluetooth GPS you bought, and stop dragging your laptop out into the woods to go Geocaching.

Code Releases and Symbian Packaging

Posted in Mobile Platform, Symbian Python on January 14th, 2006 at 10:08:59

I’m prepping my first actual .sis file release for the Symbian platform today. I’ve actually been doing it for the past couple days, but today is when I’m going to put in the brunt of the effort.

Most people don’t realize that for me, a release is a process, similar to the way any software company would do it. Prior to a release, I do many things, like checking in code to a revision control system, creating a webpage for the application, gathering screenshots, writing instructions and simple informational blurbs on a product, and so on.

It also leads up to me doing a markeitng blitz for the “product”, even if it’s free: doing my best to inform the persons who would be most interested in the newly released product that it is available. This includes posting in weblog, listing in IRC channels, etc.

Really, to create a full release, it takes me about a half day to get code from “Working on my phone” to the condition where I want to declare a release point, with ample documentation of what I’ve done, why I’ve done it, and why I think it might be useful.

This is going to be my first release using some new tools: specifically Py2SisNG, an *excellent* tool for creating .sis files out of Python applications. The documentation for the app is very good, and if you read the README in the distribution, it really does tell you step by step everything you need to do. I can’t thank the creators of this application enough. It has allowed me to turn my amatuerish Python script into an actual application, something I thought I’d never be able to do on a non-Windows platform.

Of course, there is still one limitation to what I can do: I can’t figure out how to create a .mbm image for the icon of the application. It seems like this little-used format is popular in the mobile world for storing multiple bitmaps in one file, but that there is little information on how to create these images under non-Windows platforms. I’m not sure if I’m going to delay the release until I have an icon for the application, but I’m considering it.

If anyone has any experience in creating .mbm images under non-Windows platforms, please let me know! I’d love to be able to put an icon onto my application to make it look just a little more complete.


Posted in Geolocation, Mobile Platform, Ning, Python, Symbian Python on October 14th, 2005 at 10:23:43

In my spare time (hah!) I’ve been hacking on an app on Ning, called PeopleFinder. The goal is to be a geolocation app, supporting a variety of things social. One of my many goals for a long time has been to create and use some kind of tool which allows me to generate MeNow data with no effort.

I’ve finally got it.

With the help of Geocoder, I can now type in an address, and have it automatically update my location on the website, including showing my position on a GMaps interface. The PeopleFinder API is still a bit weak, but using it, I can write a Client for Series 60 Python, which allows you to update via a GPS lat and long, or via an address.

I’ve created a token system for authentication via the API — when logged in, you simply hit the token link, grab the token, and put it into the client (in the “token” variable).

Eventually, once I write the functionality, it is my hope that I will be able to provide more features via this API — the ability to look for people nearby you, get their information, send them messages, and so on. However, right now this is just a 2-3 hour hack, and I’ve got piles of work to do – but this is so cool I had to share it.

As far as I know, this is the first example of a Ning App exporting a semi-usable API to remote clients. In part, this may be due to previous limitations on Ning’s end which have recently been resolved: looking at the phone client code, you’ll see the ?xn_auth=no parameter, which allows you to skip cookie authentication. It’s a pretty nice solution to the problem in my opinion — it solves what I need while not interfering with the rest of Ning.

So grab your phone, grab a client, and update your address on the go — then, the next time I see you in the neighborhood, I’ll drop by and give you a wave.

Symbian Python Update

Posted in Flickr, Mobile Platform, Python, Symbian Python on June 4th, 2005 at 10:08:49

Matt Croyden mentioned the other day that there is a new Python for Series 60 Alpha release. Reading through Erik Smartt’s post on the topic, I realized that this offers a number of the features that I had wanted built in in the original release: Camera access, Address Book and Contact APIs, and other similar things.

I had put off working on Symbian Python work for a while, but with the new release, I think I’m going to put some more effort into it: use of the new APIs will make things easier (like automatically uploading pictures taken to flickr, one of my original goals) and makes me want to get hacking again.

Congratulations to the Python-on-Symbian team, and I’m looking forward to starting work with the new alpha release.

Flickr Posting App Update

Posted in Flickr, Symbian Python on March 2nd, 2005 at 07:25:29

Since I’ve gotten a couple people asking about it – my application for my phone to post to flickr has a basic shell built, and works, but I’m llooking to add a few more features and make it more user friendly before I post the code for you all to use.

Featureset right now:
* Ability to store options, including default tags, username, password, and security
* Browsing through filesystem in a filebrowser and selecting a photo to upload
* Uploading a photo, and adding additional tags to the defaults

Other Features that I want to implement:
* Actually respecting the security that’s stored.
* Uploading more than one image at a time
* Less confusing interface.

So, it’s still on my todo list, and I’m going to continue to work on it, it just hasn’t gotten done yet. Mostly because I’ve been too busy reading Snow Crash.

One thing I’m not sure if people want to do is type in a title and description for the image while uploading the image. I don’t have any t9 enabled input boxes that are easy to use. So, it’s a question of whether I want to use the more difficult (and possibly confusing) Form box, or if I want to just skip it for the time being.

Actually, now that I think about it, the appuifw.Form wouldn’t be as bad of a way to go as I thought it would be… Hm. Will have to check that out.


Posted in Flickr, Geolocation, Mobile Platform, Symbian Python on February 28th, 2005 at 09:46:41

Wombat takes charge : learning how easy it is to work with location stuff in Python, he starts work on a project that sounds a lot like the work I’ve started on locative stuff. Looks like I need to get back to that…

As FrankK reports, Darla will record an orgasm ringtone if she gets requests on her blog for one. Think she’ll follow through? I’m interested in finding out.

Flickr stuff is close to done. I’ve got a user interface put together, using code stolen from the included file browser provided by Nokia. You can browse through, select a picture to upload, and upload it, using the given tags, security, and stored username/password. It’s not ready for prime time yet, because I want to set up a way to do multiple uploads at once. I’d also like to be able to type in titles/descriptions, but the limitations of the UI widgets available blocked me there. I don’t have anything that I can type t9 into with ease, so getting the data out would be a pain. Is it so much to ask for a t9 enabled appuifw.query window?

Jess asked me yesterday if I’ll ever make any money hacking these things together. My answer is probably not: I don’t like the idea of charging people money for something. I’ve never even asked for donations, because I just think it’s not fair to expect people to pay me for the work I do. Despite this, if anyone wants to offer me money to do what I’m doing, I’d be glad to take it. I really need to move this stuff to a server that isn’t hosted in a house with four cats running around: they have a tendancy to pull out the ethernet cable nightly, which means downtime for everyone.

I’m looking to move stuff soon, I’ve had my eyes on one of the Sagonet bargain servers for a while. (The reason I’m going for my own box rather than a virtual box type solution is memory based: I want to run julie off a different machine than my own, and that requires me to use a hell of a lot more memory than any virtual hosting solution I’ve yet found.) The price is good, it’s just that initial extra setup fee that’s putting me off.

However, every day that goes by is another day that I realize I really just need to move stuff and be done with it. Waking up every morning and having to restart my menagerie of bots is getting old. I want something stable.

Is anyone looking for hosting? $10/ a month, and I’ll do all the work to install anything you want! 🙂

Flickr Posting via Phone

Posted in Flickr, Mobile Platform, Symbian Python on February 26th, 2005 at 23:22:27

screen capture of vim editing session. Really just designed to draw attention to the post.I’ve worked out how to post images to flickr using HTTPlib and Python from the flickrup source code. I have no idea if this is the best way to do it, but it seems to work, so I’m writing an application to surround it in a UI. In the process, I’m creating a pretty generalized application framework that I should be able to use on some of my other applications. So, I’m enjoying that.

Some things that it’s done so far:
* Established a couple generalized option configuration methods, which let me load and save from a file
* Created what i hope is a UI for changing those options (which will change per-app)
* Added in some general stuff to make sure the UI works, like locks to make sure the application doesn’t just quit

I’m probably not going to release the framework on its own, at least not until I come out with the Flickr app that I’m writing it for, simply because I’m writing the functions as I go along. If it ends up being worthwhile and reusable enough, I may list it seperately on my page of Symbian Projects.

I think that this could be really fun for me to play with, and I hope I get it working soon, because it seems like a cool application idea. The basic idea behind it is to combine the filebrowser code that is included with the examples in the distribution with a flickr uploading option, as well as the option to view the images. Granted, I can’t do anything other than open them in the default viewer right now, but then at least people can see what they’re getting into.

I’m starting to get to the point where I could see how having a bit more advanced symbian UI widgets would be helpful: something like Putty’s menu, where things can actually be in submenus and the like. I can also see how it’d be way more difficult to code, so I’m not lamenting the lack, just noticing it more than I used to as I get into more and more complex applications. One thing that I have learned is that the Text widget makes a really good way to keep messages and so on on the screen without any complex threading or anything, which is nice. Little things like a progress bar (which seems to be underway) might still be nice though.

Just some random meandering thoughts while I’m writing. Hopefully by the end of the week I’ll have an app at least starting to take shape for Flickr, and maybe I can devote some more time to the traffic cam project too.

TrafficCam, Version 3

Posted in Python, Symbian Python on February 20th, 2005 at 05:42:21

Apparently, when the TrafficCam flash program was released, Justin was opening a can of worms that was bigger than I could have imagined.

After my example of quick development on the Python app, I got a lot of interest in my own TrafficCam application. Suddenly, there was a London version. And a Dubai version. And every time I mentioned it, someone else wanted to create their own version and load it in so that they could use the same nifty features. If there’s one thing that I do right, it’s listen to what my users are telling me. So, this afternoon, upon the arrival about my new Nokia 6600, I got to work.

First step: Build a file loader. This function should take a file of predefined format and read it in over the web, letting you specify some parameters to the program. This data should then be returned in a way that the application can use. We can’t make the file format too complex: the default Python install comes with no XML support, remember, so we’re using a very basic, tab delimited layout for this. The format is pretty simple: It’s described in the TrafficCam Format Documentation, for those of you who may want to use it.

Step two: Build the app around the data. Given a specific URL, construct the entire application setup, from the tabs to the title to listings, from that returned data. Not too hard: required a little bit of changing how I did things so that it could be reloaded easily, but as always, Python was cooperative.

Step Three: Build a frontend to choosing URLs to load data from. Store a title an a URI, and let people choose which to load. Not too bad: using the popup_menu that symbian provides, can easily associate the resulting choice with your earlier list.

Step Four: Add support for reloading. Once I’m done with one set of cameras, I want to view another without having to exit and restart. This is a bit more complex: it requires me to move some of the logic around so that the application flow stays mostly the same. In the end, I ended up cleaning up some ugly repetition of the code this way, which was useful.

Step Five: Make it more user friendly. Add an “Other” for choosing their own URLs, add progress meters and information boxes, put in exception support for when a URI doesn’t load correctly, and in general, make the app work better.

All in all, I spent six hours yesterday working on the application, and basically rewrote it from top to bottom. It’s now easy to use, and extendable to do whatever people want. I can admit that it’s probably the single most user-friendly application I’ve ever written: almost all my work in the past has been command line based, but this is truly a cool application.

If you have a phone which supports Python, I highly recommend this application. Although I’m sure there are better apps out there, this one is my personal favorite: lets you get a glimpse of the world through your phone. Of course, you should be aware that this is not a low bandwidth application: the camera listings are only about 3-4k apiece, but each camera image can be anywhere from 10-15k, sometimes more depending on the cameras you’re using. Yesterday, while doing development, I used up a megabyte of GPRS bandwidth – luckily, I have unlimited GPRS through my provider.

If you live in an area where there are traffic cameras, and you’d like to see them added, simply construct a file according to the format documentation, and drop me a line.

Have I mentioned lately that I love Python?

Now, to get working on that contact database export I had in mind…