wxGTK working on Maemo

Posted on Mon 17 December 2007 in HowTo, Linux, Maemo (EN), Programmazione • Tagged with maemo, SDK, tablet, wx

Reading the official WxWidget blog, I discovered that one of their developer was working to hildonize [WxWidgets]{style="font-weight: bold;"}. I wanted to know if that was just a test or if this library could work in Maemo, so I followed his suggestion and I grabbed the latest SVN sources:

svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets

and I compiled it in this way:

cd wxWidgets ./configure --with-hildon make make install

then I grabbed a simple "HelloWorld" from the official documentation. You can find the complete source code here.

I compiled the source code in this way:

g++ hworld.cpp wx-config --libs wx-config --cxxflags -o hworld

then I ran it in the usual way:

run-standalone.sh ./hworld

The result? I think that a screenshoot is better than thousand words :)

wxWindowsHildon

Note: I tested this inside Scratchbox, using CHINOOK_x86 target, so I think it will work fine on Os2008. This could be a good thing to help other developers porting some interesting applications (uhm... aMule for example ;) ) to Maemo.


Installing qemu-arm-eabi patch into Scratchbox

Posted on Fri 16 November 2007 in HowTo, Linux, Maemo (EN), Programmazione • Tagged with maemo, qemu, scratchbox, SDK

Using Scratchbox and in particular the Maemo SDK with ARMEL target, very often when we try to execute some application we can get into this kind of errors (for example):

sem_post: Function not implemented

This happens because not all the functions have been implemented in the emulated environment.[ Lauro VenĂ¢ncio]{style="font-weight: bold;"} has created a patched version of qemu-arm called [qemu-arm-eabi].

Thanks to Marcelo Lira, we have a simple howto to install the patch into the Scratchbox environment.

Note: you have to execute these commands from outside the Scratchbox environment and you should not be logged into the environment at the same time.

You need gcc 3.4, SDL dev library andZlib dev:

sudo apt-get install gcc-3.4 libsdl1.2-dev zlib1g-dev

Get the patched qemu-arm. Notice that the patches are already applied, everything is here, and you don't need to get the qemu sources.

svn co https://qemu-arm-eabi.svn.sourceforge.net/svnroot/qemu-arm-eabi qemu-arm-eabi 
cd qemu-arm-eabi 
./configure --target-list=arm-linux-user --static make

Copy qemu to the cputransp dir on scratchbox:

sudo cp arm-linux-user/qemu-arm /scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2

Add it to the list of cputransp methods. Open the file:

sudo vim /scratchbox/devkits/cputransp/etc/cputransp-methods

and add this line:

qemu-arm-eabi-sb2

Configure the target to use the patched qemu as transparency method. Edit the file:

vim /scratchbox/users/USERNAME/targets/CHINOOK_ARMEL.config

and change this line:

SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2

That's all! You're now ready to log again into your Scratchbox environment.


Upgrading Maemo SDK 4 Beta to Maemo SDK 4 final release

Posted on Sun 11 November 2007 in HowTo, Linux, Maemo (EN), Programmazione • Tagged with maemo, SDK

The final version of Maemo SDK 4 is out. Like most other people I couldn't wait for the final release and I installed the beta version. The big question, when I did read about the final version was "how can I upgrade to the final version without installing it from scratch?!". Luckly one kind person helped me on maemo-developer mailing list, and suggested me to do a dist-upgrade from inside the Scratchbox environment. So, login into tour Scratchbox environment and execute this:

[sbox-SDK_BETA_X86: ~] > fakeroot apt-get update 
[sbox-SDK_BETA_X86: ~] > fakeroot apt-get dist-upgrade

That's all! I don't know if this is the official method to do the upgrade, but it worked for me. I checked, after the upgrade, if I had the right packages installed, using this page: http://tablets-dev.nokia.com/4.0/4.0b_vs_4.0_content_comparison.html
and they were right.


Installing Maemo SDK 4 Beta

Posted on Thu 25 October 2007 in HowTo, Linux, Maemo (EN), Programmazione • Tagged with maemo, nokia, SDK, tablet

Introduction

Maemo is an opensource development platform for Linux based devices. Actually is the base for the operating system installed on Nokia N770, N800 and the upcoming N810 but it could be adopted, with few changes, even by other similar devices.

In particular, this version of Maemo SDK is the only one that allow developers to develop new applications for N810 and to start porting old application to this new platform.

The SDK is not only a set of libraries and compiler, it gives you a real environment that emulates the Nokia device, so the developer can write applications, debug them and test them. Both command line and gui application are supported in emulator.

Graphical environment is based on a real X server, a window manager and on GTK libraries, with a particular extension called Hildon.

With Maemo SDK you can:

  • Test Maemo applications using a normal PC with Linux.
  • Write and debug applications written by you.
  • Port existing applications written for Linux/GTK and verify if they work correctly.
  • Compile and build ARMEL package so you can install them in the device.

Requirements

These are the minimum requirements to work with Maemo SDK:

  • Intel compatible processor (x86), at least 500 Mhz
  • 256 Mb RAM
  • 2 Gb space on hard disk
  • A Linux distribution (I suggest Debian or Ubuntu)

You need the following software packages:

Starting from 4.x version, Maemo has a simple installer script, so all you need are these two files:

Installing Scratchbox

The first tool you have to install is Scratchbox. I suggest you to use the script provided but you could choose also to install it manually (in this case please refer to this site for detailed instructions).

Before beginning the installation of Scratchbox, you have to become root.

First of all set the permission of the script file:

chmod +x maemo-scratchbox-install_4.0beta.sh

Then run it with these parameters:

./maemo-scratchbox-install_4.0beta.sh -d -u andy80

Please note that -d tells the installer to install from Debian dpkg packages while -u specifies your username (in my case is andy80, you have to change it using your local username).

Scratchbox environment will be installed in /scratchbox/

Please note that you'll have to logout and login again to be able to log into you new Scratchbox environment. To test it you simply have to start Scratchbox from your local user:

/scratchbox/login

Welcome to Scratchbox, the cross-compilation toolkit!

Use 'sb-menu' to change your compilation target.  
See /scratchbox/doc/ for documentation.

Installing Maemo SDK

When Scratchbox is correctly installed on your system, you can install the Maemo SDK. Please note that you have to do it from normal user (the user you specified in the installation of Scratchbox).

Simply run this command and follow instructions:

bash maemo-sdk-install_4.0beta.sh

At the end you should get this message:

Installation was successful! ----------------------------

IMPORTANT! Please read this.

You now have the maemo 4.0beta 'chinook' installed on your computer.  
You can now start your maemo SDK session with /scratchbox/login and  
then select your target with 'sb-conf select SDK\_BETA\_ARMEL' for the  
armel target or 'sb-conf select SDK\_BETA\_X86' for the i386 target.

If you have any problems with targets' package databases, you can try  
running 'fakeroot apt-get -f install' on your scratchbox target.  
This command will try to fix any problems with the package database.

Happy hacking!

Installing Xephyr

Xephyr is an X11 server that provides a device screen for the developer so that you can see all the maemo application windows and visuals on your computer.

To install it in a Debian based distribution, simply execute this (from root):

apt-get install xserver-xephyr

Running Xephyr

To see if all works fine, you should start Xephyr and Maemo environment. Execute this from outside the Scratchbox environment:

Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite

Now, from another shell, log into Scratchbox and execute this:

[sbox-SDK_BETA_X86:~] > export DISPLAY=:2 
[sbox-SDK_BETA_X86:~] > af-sb-init.sh start

This should start the Hildon Application Framework inside the Xephyr window. That's all!

References

Here you can find a list of website where I took information from to write this guide: