Importing an OPML into Nokia N9 Feed Reader
As you know (and it's already reported), there's currently no way to import an OPML into the Nokia N9 Feed Reader application (see Harmattan Bug #159).
However, I noticed that when you open a feed link with the built-in browser, it launches the Feed Reader app, and asks you to subscribe to the feed. I guessed that it was communicating with the Feed Reader using D-Bus, so I dbus-monitored it, and that's what I found:
- First, the browser asks the application to subscribe to a given feed (here I'm asking the client to subscribe to my blog's feed):
dbus-send --print-reply --dest=com.nokia.FeedReader \ / \ com.nokia.FeedReader.subscribeFeed array:string:"http://simonpena.com/blog/feed/"
- If the user accepts that, then the Feed Reader application requests the Engine to actually subscribe to the Feed. The nice thing is that, although you cannot (AFAIK) ask the client to subscribe to more than one feed at the time, you can ask the Engine to do it, so this actually works (requesting the engine to subscribe to my blog, Planet Maemo and Planet Igalia):
dbus-send --print-reply --dest=com.nokia.FeedEngine \ / \ com.nokia.FeedEngine.subscribe \ array:string:"http://simonpena.com/blog/feed/","http://maemo.org/news/planet-maemo/rss.xml","http://planet.igalia.com/atom.xml" \ string:"rssatom"
From this point on, it should be quite straight forward to import an OPML into the Feed Reader application. You can use a QDomDocument to parse the OPML or use QML's XmlListModel to parse the OPML file.
XmlListModel {
property string subTitle: ''
query: subTitle ? "/opml/body/outline[@title='" + titleText + "']/outline": "/opml/body/outline"
XmlRole { name: 'text'; query: '@text/string()' }
XmlRole { name: 'title'; query: '@title/string()' }
XmlRole { name: 'type'; query: '@type/string()' }
XmlRole { name: 'xmlUrl'; query: '@xmlUrl/string()' }
XmlRole { name: 'htmlUrl'; query: '@htmlUrl/string()' }
}
Then, you can use this to subscribe to the feeds using D-Bus:
static const QString DBUS_IFACE("com.nokia.FeedEngine");
void Controller::subscribeFeeds(const QStringList &feedList) const
{
QDBusInterface dbusInterface(DBUS_IFACE,
"/",
DBUS_IFACE,
QDBusConnection::sessionBus());
dbusInterface.asyncCall("subscribe",
QVariant::fromValue(feedList),
QVariant::fromValue(QString("rssatom")));
}
I hope you find this useful
Mahjong Solitaire for the Nokia N9
Last week, we got Mahjong Solitaire for N9 finally published.
This has been a great opportunity to use QML in my daily work at Igalia, instead of using it simply for the occasional hacking, such as Butaca or the XKCD reader.
So far, comments in the Nokia Store have been really positive -although some people seem to miss the classic theme from the Mahjongs available back in Maemo. But not only the comments are positive: the application is currently listed in the first position of the Top Free games!
Drop me a line (spena at igalia.com) if you find issues, you have suggestions or if you simply want to complain about the colors
Mixing QML and MeeGoTouch
When trying to invoke a MeeGoTouch application's MSheet from a QML app, I was getting the following error:
There is no instance of MDeviceProfile. Please create MComponentData first.
Using MApplication instead of QApplication would solve that, but still a MApplicationWindow would be needed to make the MSheet appear.
After searching on Google for a while (see after the snippet for the sources) and talking to gri in #harmattan, I've come up with the following solution:
#include <MApplication>
#include <MApplicationWindow>
#include <MApplicationPage>
#include <QDeclarativeEngine>
#include <QGraphicsObject>
#include <QDeclarativeComponent>
#include <QDeclarativeContext>
int main(int argc, char *argv[])
{
MApplication app(argc, argv);
QDeclarativeEngine engine;
// The context is unused in this example
// QDeclarativeContext *context = engine.rootContext();
MApplicationWindow window;
window.showFullScreen();
MApplicationPage page;
page.setPannable(false);
page.appear(MApplication::instance()->activeWindow());
QDeclarativeComponent component(&engine, QUrl("qrc:/qml/main.qml"));
QGraphicsObject *content = qobject_cast<QGraphicsObject*>(component.create());
MWidget *centralWidget = new MWidget;
content->setParentItem(centralWidget);
page.setCentralWidget(centralWidget);
int result = app.exec();
delete centralWidget;
return result;
}
From QML support in Meego touch Framework I learnt that I had to load the QML into a MeeGoTouch widget, so I followed Loading QML components from C++ to replace the loadQmlComponent non-existing method with the QDeclarativeComponent::create approach.
Also, note that I use MApplicationWindow::showFullScreen instead of MApplicationWindow::show and MWidget::setMinimumSize
Butaca is now available in the Ovi Store
After having improved the movie showtimes support and updated the UI so it aligns better with the Swipe UX, this Saturday I submitted Butaca to the Ovi Store. Yesterday (yes, that quickly!) I got a notification that it had been accepted. I'm really satisfied with this release: I use the application myself a lot, and it's great to be able to check which movies are playing on the cinemas and later review their details and the crew's.
I've uploaded a screencast to Youtube, displaying how the application works, and -as usual- screenshots are available at my Flickr gallery. You can also review the release details at the project page (where you'll be able to file bugs or get support as well).
If you wonder what's to come next, here's some insight:
- Localization
- Check for extras after and during the credits (now that I have an API available for that)
- Offline mode / better data caching
- Embed trailer playback in the application
- UI improvements
Download Butaca for free from the Ovi Store!
Butaca, IMDb and TMDb
Right now, probably all of you know IMDb. The Internet Movie Database is "the place" you'd go to look up a movie or check the filmography of an actor, writer or director. Some of you will also be familiar with IMDb Android and iOS applications, which allow you to check out that very same information on your mobile device, providing the means to settle any arguments (who directed The Terminator? And Aliens?). However, IMDb doesn't provide a free API: it provides a big ZIP file that you can download and parse to get that info. Then... -if you don't want to get a commercial license for the API- what are your chances as an Open Source developer willing to get the same functionality?
TMDb was started in the fall of 2008 as a side project in order to help serve high resolution posters and fan art for the popular XBMC project. What started as just a simple single page linked with some zip files has morphed into one of the most active user built movie databases on the entire Internet.
themoviedb.org is a free and open movie database. It's completely user driven by people like you. TMDb is currently used by millions of people every month and with our powerful API, also used by the world's most popular media centers.
And indeed it is a powerful API. Butaca uses it to provide you with all the movie information you could need
. At this moment, Butaca implements almost all the API exposed by TheMovieDb, so you can search and get information from people and movies and navigate through genres: the only thing you need is an Internet connection. Besides, Butaca allows you to mark the content as favorite so you'd keep it in your home screen as a shortcut.

Welcome view with favorites

Detailed Movie View
Other available feature in Butaca is movie showtimes. Right now, I couldn't find any world-wide open showtimes API: looks like there are some local ones, which could serve in some countries (or areas inside some countries) but most of these APIs need to be licensed. So what's the solution at the moment? When the user wants to check what's on the theaters around him, the browser is open pointing to Google Movies. The browser is used also, if you want to check if there are shows for a particular movie. In the future (unless I find some good API), instead of opening the browser, a WebView will be used.
So if at this point you're still interested, please check out the project. You'll find plenty of screenshots there, and instructions on how to add the OBS repository (deb http://repo.pub.meego.com/home:/spenap/Harmattan/ ./) to your device so you can install Butaca and start using it. And then, start filing bugs
Butaca: getting close to the first release
This time, some screenshots before heading to bed.
You can check out the full set of screenshots at Picasa, the code at Gitorious, and -only for the braves!- a Debian package. Thanks a lot to Tuomas Siipola, who sent me the placeholder icons for persons and movies, and to Felipe Erias, who is guiding me on the UI design.
EDIT: Also uploaded the screenshots to Flickr, with descriptions in each view.
EDIT 2: You can follow these steps to use my OBS repository and keep Butaca updated
Butaca in Harmattan
Three weeks ago, the N9 was announced. Little can be added to what's been written: it's a great achievement, but also a bitter one. Still, I really think that great things can be done on this platform, and that's why I applied to the N950 Devkit Program.
My initial idea was to port Maevies from Fremantle to Harmattan, keeping the same architecture. In the week or so that went between the N9 announcement and the filtering of the candidates for the devkit program, I resumed the development on the client side, bringing the ability to save and load favorite movies, as well as other minor UI fixes, and also updated the D-Bus service so that it would compile on HARMATTAN target.
When I knew I was selected for the program, I started using PySide (specifically Harmattan Python) to quickly get a working UI which could connect to the D-Bus service... but it turned out that I didn't need it, thanks to the powerful way to deal with XML models inside QML. Today I've uploaded "Butaca" application to gitorious. Still a draft of what I expect it to be, it lets the user search and browse through movies, and get detailed information about them. I also created an entry at the MeeGo Wiki at User:Spenap/Butaca.
Guess what? I’m going to FOSDEM
After a great experience last year, and again sponsored by Igalia -this time as an employee
-, I'm going to FOSDEM. I'm really looking forward to meet again a pretty good amount of fellow Igalians there, and also some great people from the Free Software Master.
See you in Brussels next week!
Three weeks at Igalia
Today marks three weeks since I started working at Igalia. The experience is being amazing and promises to remain so: new challenges, new technologies and excellent companions. So much to learn!
(And I have only words of gratitude to my former colleagues at Fenosa: thank you for all this time!)
GObject Introspection and Grilo: A winner combination
About GObject Introspection
A few days ago Adrian Perez wrote about GObject Introspection (abbreviated GI), explaining why it is gaining so much momentum. While you're really encouraged to visit his blog entry to see the work he did on Lua's GI bindings, I'll take some of his words:
In short, it (GObject Introspection) works like this:
- Library developers add annotations to the documentation comments of functions.
- The GI support tools generate XML and compiled API metadata.
- You have a library to use that metadata at runtime.
The last thing is very interesting, especially the runtime usage of metadata... because it enables dynamic language bindings. This means that developers no longer have to build e.g. the Python bindings for themselves but just annotating the source code!
GObject Introspection in Grilo
As Grilo's primary focus is to allow application developers concentrate on making good user interfaces, without having to deal with the low level stuff done at the framework level, we consider very important providing them with the ability to use their language of choice. At the same time, we'd like to avoid devoting time to write manual bindings, and that's the reason we put so much effort on GObject Introspection support: right now, if not all, most of the API is accessible via GI, and we're working to fix the less binding-friendly parts.
Building Grilo with GObject Introspection enabled
The best way to try Grilo from GI is, in my opinion, using jhbuild. Clone it with
git clone git://git.gnome.org/jhbuild
build and install it, and copy the configuration file provided sample.jhbuildrc to ~/.jhbuilrc. The project page explains everything in detail, from installation details to tweaking the configuration file, but if you don't want to do it, that's fine. You'll probably need to install the build prerequisites, by invoking
$jhbuild bootstrap
To see the dependencies needed to get grilo and grilo plugins installed you can type
$jhbuild list grilo grilo-plugins
But to get the most from Grilo, you'd go for:
$jhbuild build gtk+ pygobject grilo grilo-plugins
That will install grilo core and plugins, pygobject (which includes Python's glue to use GObject Introspection, and has gobject-introspection as a dependency) and Gtk+, needed to run the grilo-test-ui sample done with GI. After a rather long build, you should have an environment with Grilo installed with GI support.
From there, type
$jhbuild shell
to enter the jhbuild environment and go to your Grilo's checkout directory. If everything has worked fine, you should be able to do:
$ python Python 2.5.2 (r252:60911, Aug 6 2010, 16:46:34) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from gi.repository import Grl >>> Grl.init([]) >>>
Under tools/python/ there's a grilo-test-ui.py program, which showcases all the combined potential of GI and Grilo: run it with
$python tools/python/grilo-test-ui.py
and enjoy
(And then, start doing you own apps
)








