I’ve recalled about my old Shishen Sho game, originally developed for N810 (Maemo4) and I was wondering if it would compile for N900 (Maemo5). Well, after some minor corrections to make it work in a more recent version of Vala, it compiled. You can downloaded it here:
Disclaimer: It’s compiled “as is”, with no adaption for sliding menus, no new hardware keys and no new fancy features. It just works and will let you have a good time while waiting for the bus.
Some simple steps to do tethering over bluetooth to connect to Yoigo Spanish carrier:
- Enable the Maemo Extras-devel catalog (URL: http://repository.maemo.org/extras-devel, Distribution: fremantle, Components: free non-free) and install “Bluetooth Dial-up Networking”.
- In your computer, edit
/etc/bluetooth/rfcomm.conf to look like this, but using your own bluetooth device address (use
hcitool scan from your laptop to get it):
# Automatically bind the device at startup
# Bluetooth address of the device
# RFCOMM channel for the connection
# Description of the connection
Channels 1 and 3 are also available and can be defined as
rfcomm2, but the scope of that is out of this post.
- Now edit the file
/home/youruser/.wvdialrc in your laptop (using your own username) to look like this:
init1 = AT+CGDCONT=1,"IP","internet"
Username = ''
Password = ''
Modem = /dev/rfcomm1
Phone = *99#
To connect to the internet, simply open a terminal and type:
sudo wvdial YoigoBT
To disconnect, just press CTRL+c and it’s done.
Thanks to this post, which was used as a reference on how to connect using Nokia devices.
Reading blog comments about Meiga out there, I’ve found one particularly interesting. Python has an embedded HTTP server that can serve the current directory from a given port. It can be instanced for port 8282 simply issuing this command:
python -m SimpleHTTPServer 8282
The funny thing is that… it works on the N810 also!
More info about SimpleHTTPServer here.
At the end, Maemo Diablo release for N810 is out. But if you have valuable information, programs or configuration on it maybe you’re worried about what you’ll loose in a reflashing. In fact, if you’ve done the upgrade yet you’ll notice that the main part of the apps from Extras repository are missing in Diablo for the moment. Fortunately, there’s a way to install the apps from the old Chinook repository.
Here are six simple steps to perform the upgrade process and restore all your current applications:
- Backup your /home/user to a safe place by hand. Standard backup tool won’t
backup every file you’ve at home and maybe you could need them later…
- Do a backup using the backup tool.
- Reflash the device with the new image using the flasher tool according to the reflashing instructions
- Restore the backup. Some old apps will remain grayshaded because the backup
tool can’t find them in the now current Diablo repository.
- Open Application Manager. Menu, tools, application catalog. Maemo Extras,
edit. Distribution: chinook, uncheck the “disabled” checkbox, Accept. Close.
- Menu, tools, restore applications. Accept.
That’s all. Enjoy your updated device!
Version 0.3 of Shishen Sho Mahjongg has just been released. The main improvements since 0.2 are: Gravity, hints, undo history, time counter and speed improvements.
You can download the game and know more about it visiting the project page at Maemo Garage.
28/05/2008 UPDATE: Now the application is also available in Maemo Extras repository and listed in Maemo Downloads with its own green “click to install” icon 🙂
Last month I published Shishen Sho Mahjongg for Gtk and Maemo, a board game similar to Mahjongg where the goal is to remove all the tile pairs and two tiles can be removed if a line with a maximum of three segments can be drawn between them.
Today I’m announcing version 0.2. The main improvements since 0.1.1 are Hildon integration (fullscreen, embedded menu, notifications) through conditional compilation and drawing of matching path when two pieces are matched.
You can download the game and know more about the project following these links:
Feel free to send me your comments, suggestions or patches over the original Vala sources.
Thank you! 🙂
Until now, when I wanted to build some Vala source code for the Maemo platform I generated C code using the i386 Vala compiler and then builded the executable inside the scratchbox using gcc. That was fine until I wanted to use Hildon features (not available for i386). I definitely needed the Vala compiler running on the scratchbox.
This weekend I’ve put myself on the way and managed to compile Vala 0.3.2 on the scratchbox for the CHINOOK_ARMEL target. The process was much simpler than I expected and consisted of these few steps:
- Log into the scratchbox and choose CHINOOK_ARMEL
- Download the compiler from http://live.gnome.org/Vala/Release (I tried version 0.3.2)
- Untar it:
tar jxvf vala-0.3.2.tar.bz2
- Enter the vala-0.3.2 directory and configure the package for ARMEL cross compiling:
- Compile and install:
make; make install
Alternately, to build for target CHINOOK_X86, repeat the previous steps but logged into the CHINOOK_X86 target. In step 3, issue
./configure without arguments instead.
That’s it. You have now the Vala compiler ready to be used. But if you want to develop a multiplatform project, you’ll need to avoid compilation of the Hildon related code when not building for Maemo target. The best way I found to do that was to use CPP as a preprocessor to allow me to use #ifdef’s in the code.
This is a simple way to use CPP to preprocess a single file:
cpp -P -Dsymbol1 -Dsymbol2 ... source.vala destination.vala
But I’ve managed to tweak my compilation script to preprocess all the files, write the result to a directory called CPP and finally compiling the result. Here’s the source:
# File compile.sh
export PACKAGES="--thread --pkg gtk+-2.0 --pkg gdk-2.0 --pkg libglade-2.0 --pkg gmodule-2.0"
# Perform preprocessing and output to CPP directory
# Arguments to this script are "defined" and passed to CPP
for i in $@
case $i in
PACKAGES="$PACKAGES --pkg hildon-1"
if [ ! -d CPP ]; then mkdir CPP; fi
for f in *.vala; do cpp -P $DEFINE $f CPP/$f; done
valac $PACKAGES CPP/*.vala -o $APPNAME -X -g -X "-Wl,--export-dynamic -rdynamic"`
rm -rf CPP
compile.sh script can be used by passing it the symbol set that should be defined. For instance,
./compile.sh MAEMO DEV would define both
DEV symbols. Note that with this approach you should check the source files in the CPP directory when errors happen, because the line numbers referenced by the Vala compiler will be related to them and not to the original files.
I think this approach will be useful for other programmers too, so I’ve contributed it to the Vala FAQ (Does Vala have a preprocessor?).
Shishen Sho Mahjongg is a board game similar to Mahjongg. The goal is to remove all the tile pairs. Two tiles can be removed if a line with a maximum of three segments can be drawn between them.
Both the idea and the tile images were taken from kshishen (Shishen Sho 1.5.1), from the package kdegames, which is (C) 1997, Mario Weilguni and distributed under GPL license.
My girlfriend and me are fans of kshishen, so I needed to make a Maemo version to let her play on the N810 internet tablet, free my laptop and let me work on it. O:-)
The game is written in Vala and licensed under the GPL. Vala is a programming language that produces C/GObject source code which can also be compiled independently without the need of the original Vala compiler. Currently, two platforms are supported for the game: i386 (a desktop distribution, eg: Ubuntu Feisty), and also Maemo platform (armel).
21/04/2008 UPDATE: New version 0.1.1 available. Features improved compilation scripts, improved debian package structure and proper installation support from Maemo application manager.
Feel free to send me your comments, suggestions or patches over the original Vala sources. I hope you enjoy the game as much as I enjoyed writing it. 😀