Planet maemo: category "feed:437c40ecc45d4b0fa868e422ae16adb1"

Thomas Perl
The logical step after the "Volume+ as Camera Button" app (Nokia Store link) for the N9 is another app that allows you to take photos while not touching your N9 at all. While time-triggered photos are fun, remote-triggered photos are.. erm.. "funner"? So what kind of remote "buttons" can we easily get on the N9? The remote control button on the headset is both "remote" and a "button". Also, as seen in Panucci and gPodder versions since the N900, Bluetooth headset buttons can also be queried by applications. So what do we get by combining remote control and photo taking? The Headset Camera app (Nokia Store link) for the N9! Or - for the visual reader - this:



If you want to integrate such features into your own app, the code for querying the headset buttons is readily available in the gPodder source tree (src/gpodder/qmlui/helper.py):
import dbus

class MediaButtonsHandler(QtCore.QObject):
def __init__(self):
QtCore.QObject.__init__(self)
headset_path = '/org/freedesktop/Hal/devices/computer_logicaldev_input_0'
headset_path2 = '/org/freedesktop/Hal/devices/computer_logicaldev_input'

system_bus = dbus.SystemBus()
system_bus.add_signal_receiver(self.handle_button, 'Condition',
'org.freedesktop.Hal.Device', None, headset_path)
system_bus.add_signal_receiver(self.handle_button, 'Condition',
'org.freedesktop.Hal.Device', None, headset_path2)

def handle_button(self, signal, button):
if signal == 'ButtonPressed':
if button in ('play-cd', 'phone'):
self.playPressed.emit()
elif button == 'pause-cd':
self.pausePressed.emit()
elif button == 'previous-song':
self.previousPressed.emit()
elif button == 'next-song':
self.nextPressed.emit()

playPressed = QtCore.Signal()
pausePressed = QtCore.Signal()
previousPressed = QtCore.Signal()
nextPressed = QtCore.Signal()
MediaButtonsHandler is already a QObject subclass, so you can easily expose an instance of this class to your QDeclarativeView rootContext() and connect to the signals in QML (such a "headset button handler" might actually be a good candidate for inclusion into nemo-qml-plugins in Sailfish OS and Nemo Mobile?). As it's really just using the Python D-Bus bindings to get property changes from Hal devices, the code above should be easy (read: trivial) to port from Python to Qt/C++. Be aware that you need to connect to both .../computer_logicaldev_input_0 and .../computer_logicaldev_input, which can both exist if you have a cable headset and a Bluetooth headset connected at the same time.

You can get the Headset Camera App for the N9 in Nokia Store now, there is also a video on YouTube showing the app. Or start integrating headset button features into your own app or scripts by adapting the code above. One use case that comes to mind is using the previous/next buttons on a Bluetooth headset to control a photo slideshow on the N9 connected to TV-Out. Enjoy :)
Categories: n950
Thomas Perl

HTML5 Web Apps on Mobile Devices

2013-05-14 20:28 UTC  by  Thomas Perl
0
0
Get out your Buzzword Bingo cards, we're talking HTML5. And Canvas2D. And WebGL. See? Check them off and then continue reading. So, while writing "native" apps using JavaScript is definitely possible and works great with QML, some games are just simple enough (or want to have a broad enough audience) to warrant writing everything in HTML5.
Click to read 1166 more words
Categories: n950
Thomas Perl
Next up in my list of things I did in the last weeks/months and never blogged about is Petals (Nokia Store link), a "beautiful, brain-teasing puzzle game for 1-4 players" if the game's website is to be believed (I would like to think it is...). As always, there's some technical details about the porting and creation of this game. While another recent game (Tetrepetete) has been done on a low level (C++ using no frameworks, and interfacing with multiple front-ends directly, including an OpenGL ES frontend, a console-based ncurses frontend(!) as well as a server-sent events/XHR/Canvas2D-based HTML5 frontend(!!)), this one is approaching things from a very high level: JavaScript.

Petals: A puzzle game written in pure JavaScript and QMLThe gameplay logic of the game is implemented in pure JavaScript (without any QML dependencies), so it could easily be ported to, say, HTML5, but for integration reasons, QML seemed like the better choice for a release on the N9/Harmattan. Also, writing things in JavaScript wouldn't preclude a console-based frontend using nodejs and node-ncurses from happening should the need arise (making the flowers look good in ASCII art would be the challenge there - or cheating by using libcaca). Ok, ok - stop cursing, I'll stop talking about curses (cue laugh track).

Writing pure QML applications has the advantage of easing porting to Qt 5. While QtQuick 1.1 still exists on Qt 5 (and is the only QML option at the moment if you are also targetting iOS), QtQuick 2.0 is usually the better choice for performance reasons.

In my case, the changes necessary to port from QtQuick 1.1 to QtQuick 2.0 were:
  • Change "import QtQuick 1.1" to "import QtQuick 2.0" (sed(1) helps here)
  • Instead of assigning a JavaScript function to a property to create a dynamic property binding (item.someprop = function() { return otheritem.otherprop * 3.0; }), this function has to be wrapped in a call to Qt.binding() in Qt 5 (see "Creating Property Bindings from JavaScript" in the Qt 5 docs)
  • Instead of using SQL Local Storage directly as in QtQuick 1.1, use QtQuick.LocalStorage 2.0, which you can still do in your .js files - use ".import" as described in this blog post
  • In your C++ launcher (in case you need one), QApplication becomes QGuiApplication, and QDeclarativeView becomes QQuickView
  • Use "QT += quick qml" instead of "QT += declarative" in your qmake project file
And that's basically it. Of course, as this is a full-screen game with custom UI, no platform-specific components (such as Harmattan Components or Sailfish Silica) are used, so porting is a bit easier there (no need to "wait" for specific components to be compatible with QtQuick 2.0, which might realistically not happen at all for Harmattan Components). More screenshots of Petals and download links for multiple platforms can be found on the Petals Website.
Categories: qt4
Thomas Perl

Upcoming: Billboard 1.0.9 for Nokia N9

2013-05-08 19:20 UTC  by  Thomas Perl
0
0
Turns out I haven't posted here for two months, so here we go again: Billboard, your favorite low-power mode standby screen will soon receive a new update - version 1.0.9 has been uploaded to Nokia Store QA two days ago, and should hopefully pass QA and be available as an update in the next few days. This release brings a few major under-the-hood improvements and small bugfixes:
  • Fixed MeeCast icon (in 1.0.8, you can already use <<{meecast-icon-src}>>)
  • New formatter that allows you to nest {} expressions used for adding dynamic content
  • Optional image dithering (using # after the filename) for better colors in low power mode
With the new formatter, you can now output {} expressions in your scripts so that they get replaced, and similarly pass {} expressions as parameters to your scripts (for example to modify them in some way before displaying). This should allow for even more customization, some examples of what users have been doing on their N9 standby screen can be seen in the Billboard Standby Screen support thread on talk.maemo.org.

If you are looking for additional ways to tweak and enhance your Billboard-on-N9 experience, have a look at billboard-scripts, a growing collection of Shell and Python scripts that provide even more ways of customizing your standby screen.

If you haven't purchased Billboard from Nokia Store yet, you can get the current version now for your N9, and get the upgrade to 1.0.9 as soon as it's available. If you are already a happy user, watch your application updates in the next few days, and get the new version.
Categories: meego
Thomas Perl
So the Sailfish SDK was released last week, and as explained in the last blog post, gPodder is already running on Sailfish Silica Components. Of course, this has only been possible because Silica is quite similar in API design to Harmattan Qt Components (whenever I write "Harmattan" in this blog post, I usually talk about Harmattan Qt components, and whenever I write "Sailfish" it usually means "Sailfish Silica Components"). But of course porting "from" Harmattan "to" Sailfish with no way back would be kind of annoying - either Harmattan gets dropped, or somebody has to maintain two codebases, something I'd rather avoid. So, just like in "good old" Maemo 4 and Maemo 5 times, the goal here is to convert a Harmattan-only codebase to Harmattan-and-Sailfish, so that both can be maintained in the same codebase and improvements to Harmattan benefit the Sailfish port and vice versa.
Click to read 2160 more words
Categories: pyside
Thomas Perl
You might have seen this one coming: gPodder is already working on Sailfish OS. If you want to try it out in the emulator yourself (no MP3 playback due to missing codecs, and some parts of the UI have not yet been ported), install the Sailfish SDK and start the emulator (thanks to the interpreted'ness of Python, we don't have to care about cross-compiling at this point). Then, SSH into the emulator as user "nemo" (I'm purposefully vague here - if you can't figure out how to SSH into the emulator, then you probably shouldn't be trying it out at this point).

From the "nemo" user, become root (use "su -", root password is "nemo") and then install some dependencies:

zypper in python-pyside git qt-components

With that in place, go back to the "nemo" user and get gPodder from Git:

git clone git://github.com/gpodder/gpodder.git

Then, cd into the Git checkout and start it as usual:

cd gpodder
python tools/localdepends.py
bin/gpodder

Again, you don't have to do any installation or compilation steps for gPodder - it will work straight out of a Git checkout (that's how I use it all the time). If you "export" the Emulator as appliance in VirtualBox and then "import" it on a different machine, you can even work with this nicely on Mac OS X and Windows. The fact that the emulator is just another Mer installation also means that you can install a compiler and -devel packages for quick development and testing. Vim 7.3 is already installed, I only wish zsh was also available in the Mer repos :)
Categories: meego
Thomas Perl

MP3 playback in Nemo Mobile on the N950

2013-02-19 12:36 UTC  by  Thomas Perl
0
0
If you've been playing with Nemo Mobile on your N950 recently, and wanted to do more than just swipe around the Lipstick UI, you might have noticed that while there's a music player app, it can't playback MP3 files (OGG files seem to work fine). This is a quick'n'dirty log of what I had to do to get MP3s playing (I've checked in the repos for something similar, but couldn't find it):

First, install the Mer Platform SDK:
https://wiki.merproject.org/wiki/Platform_SDK

Then, get SB2 (for armv7hl, as this is what Nemo-on-N950 uses):
https://wiki.merproject.org/wiki/Platform_SDK#Compiling_with_the_SDK

Then, set everything up so you can use "nemo-n950" as target with sb2:
https://wiki.merproject.org/wiki/Platform_SDK_and_SB2

Install build dependencies (you might need more than these, use "zypper se " to search for package names):
sb2 -t nemo-n950 -m sdk-install -R zypper in gstreamer-devel gst-plugins-base-devel gst-plugins-bad-free-devel gstreamer-tools orc-devel zlib-devel

Get the gst-ffmpeg sources (use version 0.10.11, due to bug 655238):
http://gstreamer.freedesktop.org/src/gst-ffmpeg/

Extract the sources, then do:
sb2 -t nemo-n950 ./configure --prefix=/usr
sb2 -t nemo-n950 make
mkdir tmp
DESTDIR=$(pwd)/tmp/ sb2 -t nemo-n950 make install
cd tmp/
scp -r . root@192.168.2.15:/

The last step obviously assumes that your device is connected and USB networking is properly set up. And then we hear somebody say "Well, but why not package it properly?". Ok. Take this modified gst-ffmpeg.spec file (based on gst-ffmpeg.spec already included in the sources). Then build a package using:

mb build -t nemo-n950 gst-ffmpeg.spec

This will leave you with gst-ffmpeg-0.10.11-1.armv7hl.rpm in ~/rpmbuild/RPMS/armv7hl which you can then scp and rpm -i to your device.
Categories: n950
Thomas Perl

Tetrepetete, SMS Backup and apkenv updates

2013-01-29 22:39 UTC  by  Thomas Perl
0
0
Whew, January is pretty much over already, and there haven't been any updates here. So this means here's a short cumulative update of what's happened over the last few weeks:

Tetrepetete
If you are not afraid of falling blocks, and don't mind the lack of colors, give Tetrepetete a try. Not to be confused with a game of a totally different name, this game brings falling blocks of 4 to your N900 and N950/N9. While the full color version is still not available as such, the free greyscale version is up for grabs as .deb on the website. Including a cameo appearance by That Rabbit from That Rabbit Game for no good reason. Play or discuss. Or be productive. Or something.

SMS Backup GUI
Instead of rolling my own solution from scratch, I found the wonderful MeegoSMSBackupRestore project by Tony Wang, which is a command-line tool for Harmattan devices to backup and restore SMS messages (as if that wasn't clear from the application name..). It was missing a GUI, so I've added one. The announcement and download, as well as the Debian source package (.dsc, .tar.gz) are available from an Internet near you. Feel like Git? We have you covered as well.

apkenv updates
If you haven't been watching the apkenv Git repo closely (I know you haven't), you might have missed the Pandora port by crowriot, which - while not being directly useful to Maemo/MeeGo users as such - also brought improvements to the Cut the Rope module, which somehow works now. To be discussed at talk.maemo.org, and patches (as always) welcome.

In other (totally unrelated) news, the thesis is done (yay!).
Categories: tetrepetete
Thomas Perl

gPodder 3.4.0 for MeeGo 1.2 Harmattan

2012-12-23 19:03 UTC  by  Thomas Perl
0
0
As promised, following the 2.20.3 release for Maemo 4 and Maemo 5, a new version of gPodder 3 has been released today. This release brings some new improvements to the QML UI that should make scrolling in the episode list faster, as well as align a bit more with the Harmattan UX Guidelines.

gPodder 3.4.0 running on MeeGo 1.2 Harmattan (N9)As always, updated packages will be available via Nokia Store once the QA process has finished. As there have been problems with apps.formeego.org recently (3.3.0 isn't even out of the staging area yet, after 3 months), we now provide a package of gPodder for MeeGo 1.2 Harmattan on gpodder.org/downloads for those who want to avoid or can't use Nokia Store (you have to enable packages from unknown sources, and you might have to uninstall the previous version if it came from Nokia Store or Apps For MeeGo due to the Aegis security policy). The source and packaging is available in the "harmattan" branch in Git, as has always been the case.

I hope you like the new UI changes. If you are missing the feed update button in the lower left corner, try "pull to refresh" on the podcast list (this avoids accidental updates when pressing the back button twice). I'd like to create a nicer "pull to refresh" implementation, but the limitations of Qt 4's QML Flickable prevent me from creating a better one (if you have a better implementation than gPodder's PullDownHandle, I'd love to hear from you). Scrolling the episode list should now also be faster (than before), and some unnecessary animations were removed in the process.
Categories: meego
Thomas Perl

gPodder 2.20.3 for Maemo 4 and Maemo 5

2012-12-23 00:35 UTC  by  Thomas Perl
0
0
A new release of gPodder 2.x for Maemo 4 (aka Diablo, N800 + N810) and Maemo 5 (aka Fremantle, N900) is out, fixing YouTube-related issues (again ;).

gPodder 2.20.3 running on Maemo 4 (N810)Packages have been uploaded to Maemo Extras, but as people have reported problems with the autobuilder, and as maemo.org seems to be moving these days, anyway (to the Hildon Foundation, apparently), we also provide for the first time since.. well, since a very long time I guess.. binary .deb packages for gPodder on Maemo 4 and Maemo 5 :)

gPodder 2.20.3 running on Maemo 5 (N900)You can find the download links on the gPodder download page - you can directly download gPodder 2.20.3 from the web browser in both OS versions, and choose to open the .deb file with the Application Manager. Be sure to choose the right package for your device (N8x0 users choose the Maemo 4 version, N900 users choose the Maemo 5 version). Enjoy :) Next up: A new release of gPodder 3.x for Harmattan. Soon!
Categories: maemo 5
Thomas Perl

Billboard 1.0.7 available in Nokia Store

2012-12-13 14:06 UTC  by  Thomas Perl
0
0
A new version of Billboard, the standby screen customizing app for the N9 has been released and is now available from Nokia Store. It brings some nifty features such as in-line color customization, a battery bar and a battery icon:


The full ChangeLog is available on the Billboard website.
Questions and feedback can be left in the support thread on TMO.
Categories: meego
Thomas Perl

apkenv 42.1.0 source code release

2012-11-20 18:41 UTC  by  Thomas Perl
0
0
The compatibility layer for applications packed as .apk (that are running natively and use OpenGL ES) has seen its source code released yesterday. Supports Maemo 5 (Fremantle) and MeeGo 1.2 (Harmattan), which means your N900, N950 and N9 are covered. Documentation is provided in the source, and the wrapper generator scripts are also released. Looking forward to contributions and new modules from the community. Details can be found on the apkenv website.
Categories: open source