|
2010-06-20
, 15:16
|
Posts: 53 |
Thanked: 51 times |
Joined on Feb 2010
|
#2
|
Scratchbox is a cross-compilation toolkit designed to make embedded Linux application development easier. It also provides a full set of tools to integrate and cross-compile an entire Linux distribution.
chmod a+x maemo-sdk-install-wizard_5.0.py
sudo ./maemo-sdk-install-wizard_5.0.py
su -c ./maemo-sdk-install-wizard_5.0.py
su
./maemo-sdk-install-wizard_5.0.py
/etc/sysctl.conf
vm.mmap_min_addr = 0
sudo sysctl -p
sudo ./maemo-sdk-install-wizard_5.0.py
/scratchbox/login
user@linuxmint ~/Desktop $ /scratchbox/login
Welcome to Scratchbox, the cross-compilation toolkit!
Use 'sb-menu' to change your compilation target.
See /scratchbox/doc/ for documentation.
[sbox-FREMANTLE_X86: ~] >
vim /etc/apt/sources.list
#Extras deb http://repository.maemo.org/extras/ fremantle free non-free deb-src http://repository.maemo.org/extras/ fremantle free
fakeroot apt-get update
fakeroot apt-get dist-upgrade
fakeroot apt-get install libqt4-gui libqt4-dev
(Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -keybd ephyr,,,xkbmodel=evdev) &
#!/bin/sh # Automatically created by Maemo 5.0 SDK Installer (Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -keybd ephyr,,,xkbmodel=evdev) & (Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb; newgrp sbox <<'END' /scratchbox/login af-sb-init.sh stop END ) & newgrp sbox <<'END' sleep 3 /scratchbox/login sb-conf select FREMANTLE_X86 /scratchbox/login af-sb-init.sh restart END
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello World");
label->show();
return app.exec();
}
/scratchbox/login
ls
[sbox-FREMANTLE_X86: ~] > ls HelloWorld maemo-sdk-rootstrap_5.0_10.2010.19-1_armel.tgz MyDocs maemo-sdk-rootstrap_5.0_10.2010.19-1_i386.tgz [sbox-FREMANTLE_X86: ~] >
cd HelloWorld
[sbox-FREMANTLE_X86: ~] > cd HelloWorld [sbox-FREMANTLE_X86: ~/HelloWorld] > ls HelloWorld.cpp [sbox-FREMANTLE_X86: ~/HelloWorld] >
qmake -project
qmake
make
[sbox-FREMANTLE_X86: ~/HelloWorld] > qmake -project QFileInfo::absolutePath: Constructed with empty filename [sbox-FREMANTLE_X86: ~/HelloWorld] > qmake [sbox-FREMANTLE_X86: ~/HelloWorld] > make g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++ -I. -I/targets/FREMANTLE_X86/usr/include/QtCore -I/targets/FREMANTLE_X86/usr/include/QtGui -I/targets/FREMANTLE_X86/usr/include -I. -I. -o HelloWorld.o HelloWorld.cpp g++ -Wl,-O1 -Wl,-rpath,/usr/lib -o HelloWorld HelloWorld.o -L/usr/lib -lQtGui -L/usr/lib -L/usr/X11R6/lib -lQtCore -lpthread [sbox-FREMANTLE_X86: ~/HelloWorld] >
run-standalone.sh ./HelloWorld
The Following 16 Users Say Thank You to TheAccountant For This Useful Post: | ||
abuelmagd, attila77, cheve, clasificado, Crashdamage, mannakiosk, mbo, oldnetdog, panta, pelago, realsportcars, stlpaul, Straycat, uvatbc, w00t, yorg |
|
2010-06-20
, 15:17
|
Posts: 53 |
Thanked: 51 times |
Joined on Feb 2010
|
#3
|
Menu -> Settings -> Display -> Backlight time-out
Desktop Menu -> Add Shortcut -> Mad Developer
|
2010-06-20
, 15:22
|
Posts: 455 |
Thanked: 278 times |
Joined on Dec 2009
@ Oregon, USA
|
#4
|
|
2010-06-20
, 15:49
|
Posts: 53 |
Thanked: 51 times |
Joined on Feb 2010
|
#5
|
The Following User Says Thank You to TheAccountant For This Useful Post: | ||
|
2010-06-20
, 17:34
|
Posts: 61 |
Thanked: 43 times |
Joined on Aug 2008
|
#6
|
The screen resolution is 800 by 600 so there is the size you could use?
The Following 2 Users Say Thank You to harriva For This Useful Post: | ||
|
2010-06-20
, 21:46
|
Posts: 53 |
Thanked: 51 times |
Joined on Feb 2010
|
#7
|
|
2010-06-21
, 17:40
|
Posts: 52 |
Thanked: 8 times |
Joined on Apr 2010
|
#8
|
|
2010-06-21
, 18:12
|
Posts: 190 |
Thanked: 129 times |
Joined on Mar 2010
@ Bavaria, Germany
|
#9
|
|
2010-06-21
, 23:14
|
Posts: 1,141 |
Thanked: 781 times |
Joined on Dec 2009
@ Magical Unicorn Land
|
#10
|
Starting /home/paul/NokiaQtSDK/Projects/HelloWorld-build-maemo/HelloWorld... /scratchbox/tools/bin/misc_runner: /targets/links/scratchbox.config: No such file or directory /home/paul/NokiaQtSDK/Projects/HelloWorld-build-maemo/HelloWorld exited with code 126
Hi.
I just thought I would create a quick guide to getting started in Maemo including setting up the environment, creating a "HelloWorld" program and running it on the Nokia N900.
Please free to add comments and I will edit this post to reflect all your comments and criticisms!
Tested on 32 bit Linux Mint 9 running on a Intel P4.
0. Remove Old SDK
Just in case there are no issues with two SDKs, remove the old SDK by running the SDKMaintenanceTool tool. This should be located as a menu item.
If you don't have it on your menu bar, you can find it in the install directory.
Once it has loaded, simply select the tab "Package Manager", select the option "Remove all components", then click "Next".
Now simply click "Uninstall" and Nokia SDK will be removed completely, and then click "Finish" to close the tool.
1. Installing QT SDK
Download the current Nokia QT SDK (released on 23 June 2010) from:
http://www.forum.nokia.com/info/sw.nokia.com/id/e920da1a-5b18-42df-82c3-907413e525fb/Nokia_Qt_SDK.html
This make take a while... be patient!
2. Rebuild Qt Debugging Helper
Now Qt is installed, there is one important thing we need to do before we create a sample code.
We need to ensure that the debugging helpers are built.
Load Qt and go to:
You will find that the red cross is now a green tick.
Do the same for Simulator Qt for GCC (Nokia Qt SDK). Click OK to exit.
Next we need to configure the N900.
3. N900 setup
To make your life easier, you can add the Nokia N900 to Qt and use one click testing and deployment on the device itself.
You can visit http://wiki.maemo.org/MADDE/QtCreato...tion_for_linux for the USB method of connection, but as I dislike wires, I will be using the Wifi method.
First we need to prepare the device:
Make sure you have the latest firmware installed. To check the latest firmware, please go to:
Load up the App Manager:
If you have both, then select maemo Extras and disable it.
Open up maemo.org, ensure it has the following:
This will talk to Qt and allow it to deploy code to the N900.
Install the client. Note, you will be asked for a new root password, PLEASE DO NOT FORGET THIS!
4. Add the N900 to Qt
If Mad Developer is not loaded, load it up.
It should display your IP address on wlan0.
In Qt, goto:
To add the N900, populate the following fields:
You should be presented with the following:
Device configuration successful.
Hardware architecture: armv7l
Kernel version: 2.6.28-omap1
List of installed Qt packages:
libqt4-core 4.6.2
libqt4-dbus 4.6.2
libqt4-gui 4.6.2
libqt4-maemo5 4.6.2
libqt4-maemo5-core 4.6.2
libqt4-maemo5-dbus 4.6.2
libqt4-maemo5-gui 4.6.2
libqt4-maemo5-maemo5 4.6.2
libqt4-maemo5-xml 4.6.2
libqt4-multimedia 4.6.2
libqt4-network 4.6.2
libqt4-opengl 4.6.2
libqt4-phonon 4.6.2
libqt4-sql 4.6.2
libqt4-sql-sqlite 4.6.2
libqt4-svg 4.6.2
libqt4-webkit 4.6.2
libqt4-xml 4.6.2
libqt4-xmlpatterns 4.6.2
Click close to close the message box. You will need to enter a new password each time you load Mad-Developer.
Therefore, we should deploy a key to ensure we can simply load Mad-Developer on the N900 and start using it.
Note: Encrypted keys are not supported.
Click on Generate SSH Key.
A new box will open. Select Key Size 4096 and then click Generate SSH Key.
Once the key has been generated, click on Save Public Key and then click on Save Private Key.
Ensure you save them somewhere safe. Click Close to go back to the Maemo Device Configuration Screen.
If you need to change the [/B]Private Key file[/B] location, change the "Authentication Type" to Key, then click Browse button at the bottom next to Private Key and select the private key you just generated.
Now change the Authentication Type back to Password and click on "Deploy Public Key". A box will appear asking you to select the public key. Select the one you just saved and click Open.
You should revieve the message "Key was successfully deployed"
Now change the Authentication Type to "Key" and click Test to ensure it connects successfully.
Click Ok to close that screen and open the main screen up.
Now we can create out first "Hello World Program"
5. Hello World
Let create a push button when pressed will pop up a message on the screen saying "Hello World!"
First ensure you are on the Welcome screen of Qt.
Click on Create Project.
Select Mobile Qt Application, then click on Choose
Set the name as HelloWorld and click Next.
In the next screen, ensure you select both Qt for Fremantle PR1.2 Devices (Nokia QT SDK) and Simulator QT for GCC (Nokia Qt SDK) and then click Next.
Click Next again on the Class Information screen and then click on Finish.
Now by default, you should be in Design mode.
Drag a "Push Button" to the main window.
Right-Click on the Button and click "Go to slot...". Select the Clicked() and then click on OK.
You may receive an error about not being able to find/add a slot.
I believe this may be a bug. Rebuilding will not help. To solve this, simply click OK to close the error box.
On the bottom left hand side, there should be button labelled Debug, click this once and then Select the Top one, Maemo. Wait for a few seconds so that the scanning/parsing finished.
Then click back on the Qt Simulator.
Now you should be able to right click on the new button and select Go to slot... and then Clicked() and then OK.
No add the following to the MainWindow::on_pushButton_clicked() section so that it looks like the following:
Now we simply need to add the header, so go right to the top of the editor and add the following bold line:
To run on the Desktop simulator, simply click on the Run button (the first big green arrow on the left. You will be prompted to save, simply click Save All.
After a few seconds, you should receive a nice image of the N900 with a button. Click the button and it should say Hello World!.
To run it on the N900, simply click the Debug button and then select the Maemo option. Now click the green run button or hold CTRL+R.
The application should now be running on your Nokia N900.
Last edited by TheAccountant; 2010-07-03 at 16:42.