Motorcycle Adventures and Free Software
Henri Bergius
Biker, free software consultant, neogeographer

There is a total of 792 posts.

Weblog: category "mobility"

buscatcher: Never miss another tram

Posted on 2010-09-02 16:17:17 UTC in 60° 0.000 N 24° 0.000 E 28km S of Lojo, FI to . 0 comments.

Opening public data is a hot topic in Finland at the moment. As a small experiment with the data that is available I wrote buscatcher, a simple N900 app that displays Helsinki trams (and some buses) moving on a map in real time. This makes it easy to determine when your next tram is coming to the stop, or where it is stuck.

buscatcher.jpg

So far I'm keeping this application away from Extras until HSL gets scalability issues solved with their dataset. In the meanwhile you can grab and run the application from the GitHub repo.

Sponsored links

Microsoft Certification Exams save money using, phone card

My interview at dot KDE

Posted on 2010-09-02 15:55:28 UTC in 60° 0.000 N 24° 0.000 E 28km S of Lojo, FI to . 0 comments.

Jos Poortvliet did an interview with me for dot KDE in this summer's aKademy and it has been online for a while now. In it we discuss things like Midgard as a storage engine for desktop applications, and Maemo's open QA process for Downloads applications. Some excepts:

At maemo.org we have an appstore for FOSS applications on the Maemo platform. This appstore is enabled by default on all Nokia N900s so we wanted to have some quality control. We had to create our own appstore approval process, compatible with the FOSS philosophy. Now any developer can submit an app, and anyone can test and vote. The whole process is completely transparent, auditable and visible. And it also provides a feedback channel from testers and users to the developers!

...

Midgard is a data storage service. Whether you write desktop or web applications, instead of coming up with your own file format, you just use Midgard. You can work more easily and object-based. Users have many different devices these days, so Midgard has strong replication features to synchronize between different systems. Midgard is built on top of GObject; we provide bindings to a bunch of different languages so developers can choose the tools they like - PHP, Python, Javascript. Currently (as in now, while we're talking) Qt bindings are being developed here at Akademy.

Read the whole interview.

Frankencamera aims to make cameras open and programmable

Posted on 2010-07-23 11:05:02 UTC in 60° 0.000 N 24° 0.000 E 28km S of Lojo, FI to . 3 comments.

Frankencamera, or fCam, the open source computational photography platform from Stanford's Camera 2.0 project was unleashed for the Nokia N900 this Wednesday. PhysOrg has a story outlining the significance of this:

Computational photography refers to the ways computers can extend the capabilities of digital imaging by combining multiple photographs taken with different camera settings to create an image that could not be taken in a single shot, or with an ordinary camera.

Some of these new ways of combining images can be done in Photoshop or another such program, but until now they could not be done inside the camera, Levoy said. That's because commercial cameras are closed to development by all but their manufacturers. Frankencamera, on the other hand, brings computational photography directly to the camera, by making the camera a programmable platform.

I installed fCamera and the HDR photo assistant from Maemo extras-devel yesterday, and the results (taking .DNG RAW images, automatically generating HDR pictures) seem quite impressive. Here is a quick example from our office. Sun is shining outside and the office is not lit:

HDR_2010722_1454_small.jpg

For comparison, here is the same setting with the regular N900 camera application:

20100722_001_small.jpg

It will be interesting to see what developers will come up with, now that all these camera capabilities are available through an open API!

Zeitgeist does location: what did I do while in Brussels?

Posted on 2010-07-21 17:16:00 UTC in 60° 9.768 N 24° 55.668 E Helsinki, FI to . 6 comments.

Zeitgeist, the desktop activity logging engine is now becoming geo-aware. From Seif Lotfy's blog:

It allows you to ask Zeitgeist stuff like

  • “Get me the recent files I edited at university”
  • “Who do I contact most when I am at School?”
  • “Which pictures did I take in Brazil?”
  • “Where was I when an Email came in?”
  • “What files did I open during the conference?”
zeitgeist-geoclue.jpg

As I've been advocating since 2006, location is important for making applications smarter. While you might not remember where you stored some file, you probably remember where you were when working on it. Then Zeitgeist's location features, powered by GeoClue, will be able to get it for you.

This is especially cool since Zeitgeist is coming for Maemo as well. My laptop is quite mobile, but the N900 is even more so.

Meet Midgard and GeoClue in aKademy 2010

Posted on 2010-06-28 12:54:47 UTC in 60° 0.000 N 24° 0.000 E 28km S of Lojo, FI to . 0 comments.

We tried to get the combined GUADEC and aKademy conferences to Tampere in 2009, but a warmer place unfortunately won. However, we will be hosting this year's aKademy so at least KDE and Qt fans will get to enjoy this beautiful northern industrial city.

The main conference will be held at the Tampere University over the weekend, and then the remaining hackweek will be in the nice Demola facility in the Finlayson district. Expect great connectivity and close proximity to all Tampere nightlife.

I'm involved with two aKademy activities:

In addition there will be a Maemo / MeeGo meetup in the Plevna brewery on Friday evening. See you there!

akademy-banner-small.png

Ratatoskr is out: Midgard2 Content Repository goes LTS

Posted on 2010-05-07 17:03:21 UTC in 60° 0.000 N 24° 0.000 E 28km S of Lojo, FI to . 0 comments.

Midgard2 10.05 "Ratatoskr" was released yesterday, moving the Midgard Content Repository into long-term supported state as outlined in my recent post. Ratatoskr should provide a stable storage system for both desktop and mobile application developers.

Web developers will also benefit from Midgard MVC, the PHP framework that already runs services like Qaiku.com.

The release includes:

  • Content Repository API bindings for the following programming languages: C, Python, PHP, C# and Vala. D-Bus signals are used to inform different Midgard2 applications about things happening in the repository, enabling for example a PHP website and a Python background process to communicate with each other.
  • Midgard MVC, an elegant framework for PHP web applications. Midgard MVC includes interfaces for loadable components, hierarchical sub-requests, a forms system and much more.
  • Midgard Runtime that combines the Midgard MVC, a PHP application server and a WebKit UI to provide a full Midgard web development environment on the desktop.

This release benefits greatly from new technologies happening in the GNOME sphere: some of the language bindings are created using GObject Introspection, Vala has made development of new features faster and libgda4 makes all database operations more efficient.

Packages for various Linux distributions are already trickling into Midgard's OpenSuse Build Service repositories and Maemo Packages.

A good place to start the Midgard2 journey is my Midgard2 Content Repository for Python tutorial.

ratatoskr.jpg

Photo: Squirrel by John-Morgan on Flickr (the release codename Ratatoskr is a mythological squirrel)

 

GeoClue 0.12 is out: Location awareness over D-Bus

Posted on 2010-03-29 11:26:54 UTC in 60° 11.286 N 24° 49.464 E 6km NW of Helsinki, FI to . 0 comments.

geoclue-200.png

After a long hiatus there was a new GeoClue release 0.12 last week. GeoClue is a D-Bus service that Linux applications can use to obtain user's current position and convert between human-readable addresses and coordinates. As location-aware services are becoming more important and computers more mobile the free desktops should also be aware of where they are.

Dadadi Blog writes:

Geoclue has a really nice feature, the master provider. It means geoclue can handle multiple sources of geoinformations. For example, you can get your position with your gps device, or with OpenCellId, or with webservices that will associate your IP address with a location (such as hostip). Geoclue master provider is able to choose the source with the best accuracy.

Geoclue is used at least in Empathy to publish your location to your contacts, and in WebkitGtk to support html5 geolocation.

It's been the first release in nearly two years, and it's great to see that nice project moving forward again. In this release, Nominatim has been added as a provider for geocoding and reverse/geocoding. It means it's possible to use nominatim service to get the position for a given address, or the opposite. There have been also many bugfixes and code cleaning, including a bug I've helped to resolve that prevented master provider from being usable in some configurations.

I'm also really happy to see GeoClue again moving on. It is important for the free desktop infrastructure to have such critical tools available as vendor-neutral D-Bus services instead of platform-specific libraries.

Update: ran into python-geoclue, a very handy Python convenience library for dealing with GeoClue that is a result from last summer's GSoC. Seems to work pretty well.

Getting started with the Midgard content repository

Posted on 2010-03-09 15:50:26 UTC in 3° 3.806 S 60° 6.420 W 10km NW of Manaus, BR to . 3 comments.

I'm doing a talk today in the Bossa Conference about using Midgard as a content repository for mobile applications. As part of my presentation I wrote some simple example code for using the Midgard APIs in Python, and thought they would be good to share to those not attending the event as well.

The idea of a content repository is that instead of coming up with new, isolated file formats or database setups for your application you can just work with objects and signals, and let Midgard handle the rest. This is something that lots of people are doing with CouchDB as well, but we feel Midgard, with its light footprint and native APIs for languages like Python, C, Vala and PHP fits better in the mobile applications context.

Installing Midgard

Midgard packages are available for many different Linux distributions through the OpenSuse Build Service. To find the right repository for your setup, go to the OBS project page. For example, on my Ubuntu Karmic netbook the URL to add to apt sources.list is deb http://download.opensuse.org/repositories/home:/midgardproject:/mjolnir/xUbuntu_9.10/ ./. Then I just:

sudo apt-get update
sudo apt-get install python-midgard2

Midgard is also available in Maemo extras and for OS X on MacPorts.

Defining a schema

The first thing when developing a Midgard application is to define your storage objects. This is done using the MgdSchema XML format. In this case we're doing a simple "attendee" object that amends Midgard's built-in person record with information related to the conference:

<?xml version="1.0" encoding="UTF-8"?>
<Schema xmlns="http://www.midgard-project.org/repligard/1.4">
    <type name="openbossa_attendee" table="openbossa_attendee">
        <property name="id" type="unsigned integer" primaryfield="id">
            <description>Local non-replication-safe database identifier</description>
        </property>
        <property name="person" type="unsigned integer" link="midgard_person:id">
            <description>Person attending the event</description>
        </property>
        <property name="registration" type="datetime">
            <description>Registration date of the attendee</description>
        </property>
        <property name="likesbeer" type="boolean">
            <description>Whether the attendee likes beer</description>
        </property>
    </type>
</Schema>

Then we just save this XML file into /usr/share/midgard2/schema/ so that Midgard will find it.

Initiating the repository connection

Once the MgdSchema is in place it is time to import antigravity and start hacking in Python. The code works pretty much in the same way in other languages Midgard is available for, but Python is used here for the sake of simplicity. First we load the Midgard extension:

import _midgard as midgard

Then we setup the repository connection. With these settings we will store our content into an SQLite database located in ~/.midgard2/data/midgardexample.db:

configuration = midgard.config()
configuration.dbtype = 'SQLite'
configuration.database = 'midgardexample'

# Open a Midgard repository connection with our config
connection = midgard.connection()
connection.open_config(configuration)

As this is the first time we're interacting with the repository we need to tell Midgard to prepare the storage for itself and also for our new openbossa_attendee class:

midgard.storage.create_base_storage()
midgard.storage.create_class_storage('midgard_person')
midgard.storage.create_class_storage('midgard_parameter')
midgard.storage.create_class_storage('openbossa_attendee')

Interacting with data

First we create a person object with our attendee:

person = midgard.mgdschema.midgard_person()
person.firstname = 'Leif'
person.lastname = 'Eriksson'
person.create()

Then we create our attendee object and link that with the person we just created:

attendee = midgard.mgdschema.openbossa_attendee()
attendee.person = person.id
attendee.likesbeer = True
attendee.create()

Querying data

Later we'll want to find out about all Leifs attending the event. We do this by using the Midgard query builder:

qb = midgard.query_builder('openbossa_attendee')
qb.add_constraint('person.firstname', '=', 'Leif')
attendees = qb.execute()

The query builder returns us a list of matching attendee objects. We can go through them and also fetch the associated persons:

for attendee in attendees:
    person = midgard.mgdschema.midgard_person()
    person.get_by_id(attendee.person)
    if attendee.likesbeer:
        print "%s, %s is attending the event" % (person.lastname, person.firstname)

Then we can update the persons with their email addresses:

    person.email = 'leif@vinland.no'
    person.update()

For basic data handling, that's it! When you need more, you can extend objects with file attachments or parameters. You can also create joined records using Midgard views. Midgard provides D-Bus signals, transactions, centralized metadata, synchronization and many other things.

Register and log into meego.com using your maemo.org account

Posted on 2010-02-24 13:57:09 UTC in 60° 10.080 N 24° 55.578 E Helsinki, FI to . 4 comments.

MeeGo is the new mobile Linux platform developed by Nokia and Intel. As the community is forming up, we thought that it would be good to enable people to use their maemo.org identities also on the MeeGo web services (as well as on any other OpenID enabled website). For this, let me introduce Maemo's OpenID provider.

First of all, go to meego.com and click login:

meego-login.png

Select the "Log in using OpenID" option, and provide your maemo.org OpenID URL:

meego-maemo-openid.png

Then the request will be redirected to maemo.org where the site will check your credentials and ask whether to relay your information on to meego.com:

maemo-openid-meego.png

And that's it, suddenly you can use your maemo.org account with meego.com!

 

The same OpenID provider component can also be utilized on any other Midgard-powered website.

Going to the Bossa Conference

Posted on 2010-02-23 12:38:44 UTC in 60° 10.194 N 24° 56.304 E Helsinki, FI to . 0 comments.

Bossa Conference, an event about mobile development with free software technologies will be held on March 7th-10th in Manaus, Brazil. This year I'm speaking about using Midgard as a replicated storage layer in mobile applications, with examples for multiple programming languages and toolkits.

The idea behind the Midgard content repository is that instead of coming up with your own file formats you can just keep working with objects and signals, and let the repository deal with the rest.

bossaconference-small.png

It is always fun to go to Brazil and meet the vibrant free software community there. The plan is to fly over this weekend, spend a few days in Sao Paulo and then head for the Amazon. Feel free to ping me if you're around.