Archive for the ‘Python’ Category

MaemoFlickr

Tuesday, May 23rd, 2006

Besides working with the BitTorrent client, I’ve been also working with application that I call MaemoFlickr. I’ve been building this application from scratch and when it is ready it will be able to upload photos to Flickr using simple and intuitive user interface. The intention is that if you have camera phone or something you could easily upload the photos you’ve taken to Flickr. Future versions might include also some photo organizing features, but I think that for starters it is probably better to keep it simple.

Here are some screenshots…

MaemoFlickr

MaemoFlickr Loading...

MaemoFlickr About

BitTorrent for Maemo continued

Tuesday, May 23rd, 2006

Ok, now I’ve got the UI of the BitTorrent client somewhat Hildonized. I decided to move the start/stop button, the search field and the connection indicator to a toolbar at the bottom of the view. I think this makes it a bit more usable. I’m considering moving the upload rate adjust bar to the toolbar also, so that the main view would only contain the information about the torrents that are being downloaded or uploaded. I haven’t yet touched the other views, but I think those need less editing anyways.

The search bar on the bottom does not of course work yet, since it is not possible to launch the web browser form Python applications yet. However, this should become possible with the new software release and new pymaemo version. Then also MIME support for bittorrent files would be nice. I’ll look into that and then we have full blown BitTorrent for the Maemo platform. All I would need now is actual content distributed via BitTorrent that actually could be used in the Nokia 770. Usually videos are too large and those iPod mp4 videos does not seem to play in the video player. Anyone know any good podcasts that are distributed using BitTorrent?

Maemo BitTorrent

The original BitTorrent on Nokia 770

Saturday, May 20th, 2006

As the readers of this blog have probably noticed, I like doing stuff with Python. I also like downloading all kinds of stuff from the Internet and what better way to do that nowadays than the BitTorrent. How convenient, BitTorrent has originally been written in Python. ;) Here we go… I need to port the BitTorrent client on Maemo platform using pymaemo. I know there are command line versions of some other BitTorrent clients already available for maemo, but I kind of like having UIs. They make life alot easier. ;)

The surrent stable version of the BitTorrent client uses PyGtk for the user interface so porting should go quite smoothly. I decided to give it a go and as I suspected it worked straight from the package. Of course I had to modify the .deb installer a bit to make it install using the application installer on the device, but otherwise nothing else was needed.

Here are couple of screenshots. As you can see, no Hildonization for the UI yet, but I’m already rolling up my sleeves so lets see when I can release the first installer package.

Maemo BitTorrent main screen

Maemo BitTorrent about screen

Nannoid 1.0 for Maemo

Saturday, March 18th, 2006

In my previous post to this blog I was experimenting with Pygame and found out that a game called Nannoid worked almost fully on the Nokia 770 without modifications. Well, I decided to modify it a bit and now it should be fully playable.

It requires you to have Pymaemo runtime installed. Also, since Python for Maemo does not yet fully support LibOsso (or something?) you wont be able to switch back to another application during the game and you don’t see the “loading…” sign when launching the application from the menu. After clicking the menu item, just wait a couple of seconds and the game will launch. You can play the game using the stylus or the keys.

Download the installer package from here. I hope you enjoy the game. Here are some screenshots…

Nannoid menu

Nannoid

Nannoid

Experimenting with Pygame on Nokia 770

Wednesday, March 15th, 2006

It’s been a while since my last post to my blog and yesterday, while watching OC and lying on the couch, I thought I gotta post something. Then I started to browse through the Pygame site since I thought there might be something cool stuff that I could try on my Nokia 770.

First I started at the Gamelets section. I thought that these should be simple enough and work without any editing on the device. To be honest, that was not the case, but at least I got this small game called Spacepong working. It worked really nice and I could control the ball on the screen using the stylus. The game itself is not the coolest kind, but might offer a good example on how to develop games using Pygame. Here are some screenies from the game taken from Nokia 770.

Spacepong menu on Nokia 770

Spacepong game on Nokia 770

Now, encouraged from this nice experience with Pygame gamelets, I decided to go for the actual games. Since I’ve always liked Arkanoid I immediately wanted to try Pygame version of that called Nannoid. To my surprise, it also worked right out of the package. Well not fully. As you can see from the screenshots below, the game didn’t quite fit to the screen. Anyhow, this seems like something that would be really cool with some modifying.

Nannoid menu on Nokia 770

Nannoid game on Nokia 770

And remember people, this was all done while watching OC. ;) All you need to do is to install Python for Maemo. Then download the .tar.gz packages of the games, for example, to your memory card. Then go to the directory where you downloaded them using Xterm (MMC is found in /media/mmc1) and type “tar xzvf the_name_of_the_package.tar.gz”. Change to the directory that was extracted and start the game by typing “/var/lib/install/usr/bin/python2.4 the_name_of_the_file_that_starts_the_game”. If you have errors, you might have tried to start the wrong file or it just doesn’t work. If you find more games that would be cool for Nokia 770, I’d like to hear about it. That was all this time… happy gaming. :)

Porting Python modules to Maemo

Friday, February 24th, 2006

In some of my earlier Python related postings someone asked if Python Imaging Library (PIL) has been ported for Maemo. It seemed like it is not, so I decided to give it a try. I’ve never before created any Python .deb packages so, this was sort of my first experiment in this area and I decided to write here how I did it. In case it would be of use to someone.

The created PIL package for Maemo can be downloaded from here. Anyone interested in porting Comix for Maemo now? One point I need to mention is that I have not tested the PIL library that I’ve created for performance and quite frankly I have no idea how to optimize it, so if anyone is interested just go ahead.

I made a test using PIL on my Nokia 770 and created a blended image of the two default wallpapers. Here’s the result. Keep on reading if you want to know how I ported the library for Maemo.

Blended image created with PIL

(more…)

Coding for Nokia 770 using Python – Misc Notes

Tuesday, February 14th, 2006

It is time to make a post about some great input that I’ve gotten from the readers of my blog. Thanks to everyone who has made comments. Keep on commenting people.

Ok, first of all thanks to Kasper Souren for pointing out that if you are having “permission denied” problems, or otherwise problems running the downloaded scripts, you sould do a “chmod +x *.py” in the folder where you have the script in.

Also big thanks to Martin N for giving a nice example on how to make the python script fully hildonized by adding it to the start menu and also how to get the icon to the task list while your app is running. Here’s what he wrote…

Hi Teemu, I’ve found a solution in the Maemo SDK Tutorial:

Based on this I created the following two files for your example:

uitest.desktop:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=UITest
Exec=/home/user/python/uitest.py
X-Osso-Service=example.uitest
Icon=qgn_list_gene_default_app

example.uitest.service:

[D-BUS Service]
Name=example.uitest
Exec=/home/user/python/uitest.py

…and created those links:

ln -s /home/user/python/uitest.desktop \
/var/lib/install/etc/others-menu/extra_applications/\
uitest.desktop

ln -s /home/user/python/example.uitest.service \
/var/lib/install/usr/lib/dbus-1.0/services/\
example.uitest.service

Actually you don’t need the desktop file to have an icon in the task list, but I think it makes the hildonization complete. ;)

Edit: Please note that the version parameter in the .desktop file refers to the desktop entry specification version instead of the application version. Thanks to Karo for pointing this out.

Coding for Nokia 770 using Python – Part 2

Wednesday, February 8th, 2006

Ok, the hugely popular (a minor overstatement) “Coding for Nokia 770 using Python” tutorial continues. ;) The code for part 2 example is already 180 lines, but have no fear, I’ve included the example file for download and will also go through the code and try to explain what it does. Again the “tutorial” is about developing an user interface and the actual application doesn’t do anything useful. It is meant to be more of an example than actual application. Example shows how to create buttons, panels, text area, simple dialogs and a menu using pygtk and hildon.

Since everyone loves images, I’ve included an image of the application that the example creates. To read more, click the link below the image. The example code can be downloaded from here.

UITest part 2

(more…)

Nokia releases Python for Series 60 as open source

Wednesday, February 1st, 2006

Nokia has made the source code for Python for Series 60 available via Sourceforge.net. Let’s hope that many developers join the project to develop it further. Python for Series 60 is now in version 1.3.1 and it is quite usefull for fast mobile application development.

Coding for Nokia 770 using Python – Part 1

Thursday, January 26th, 2006

I thought that I start a series of posts giving some tips on how to get started to code applications for Nokia 770 using Python. I have some experience on coding Pyhon for Series 60 and now I’ve started to play with the Python for Maemo. My intention was to give some examples and hints how to easily develop software for Nokia 770. I’m still in the phase of learning how to use GTK/Hildon to implement user interfaces, so feel free to comment if I’m doing something totally wrong or if you have questions.

In this first part I thought that I’d give instructions how to set up an easy configuration so you can easily code Python on Nokia 770 using your PC and also very easily run your applications on the actual device. I’ll also give an example of a very simple Python application that you can see below. It’s not much, but it is a good start.

Simple Python example

(more…)


blog.teemu.im is Digg proof thanks to caching by WP Super Cache