неделя, 18 юли 2010 г.

Uploading the application and creating the launcher



Qtopia file system:
/opt/Qtopia/
           |--apps/  
           |    |-Application/  --each folder is a desktop tab.
           |    |-FriendlyARM/    in these folders are .desktop files
           |    |-Games/
           |    |-Settings/
           |
           |--pics/   -applications icone folder
           |--bin/    -applications executables
           |--help/   



1.Preparation
Prepare a .png file for desktop icon of your application.
Place it into the project folder and give it the same name as the binary file:stivlib.png
Create the stivlib.desctop file. This is a text file with the following content:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=StivLib
Comment=An Example Program
Exec=stivlib
Icon=stivlib
Type=Application
GenericName[en_US]=


2. Connect your PC to FriendlyARM witn network cable, and open a terminal.
FriendlyARM board comes with preset IP 192.168.1.230.
Set your IP address, telnet to FriendlyARM and set root password:

# su
# ifconfig eth0 192.168.1.1 netmask 255.255.255.0
# telnet 192.168.1.230
Trying 192.168.1.230...
Connected to 192.168.1.230.
Escape character is '^]'.

Kernel 2.6.32.2-FriendlyARM on (/dev/pts/0)
FriendlyARM login: root
[root@FriendlyARM /]# passwd
Changing password for root
New password:
Retype password:
Password for root changed by root
[root@FriendlyARM /]#

3. Make a folder into /opt/Qtopia/apps for your applications.
These folders appear like desktop tabs.

[root@FriendlyARM /]# cd /opt/Qtopia/apps
[root@FriendlyARM apps]# ls
Applications  FriendlyARM   Games         Settings
[root@FriendlyARM apps]# mkdir STIV
[root@FriendlyARM apps]# ls
Applications  FriendlyARM   Games         STIV          Settings
[root@FriendlyARM apps]# exit


4. Upload binary file to FriendlyARM using ftp. Upload the icone file and the .desktop file
Go to your project folder where is your binary file.

# ftp 192.168.1.230
Connected to 192.168.1.230.
220 FriendlyARM FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Name (192.168.1.230:svilen): root
331 Password required for root.
Password:
230 User root logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd opt/Qtopia/bin
250 CWD command successful.
ftp> send stivlib
local: stivlib remote: stivlib
200 PORT command successful.
150 Opening BINARY mode data connection for 'stivlib'.
226 Transfer complete.
41481 bytes sent in 0.25 secs (162.7 kB/s)
ftp> cd ..
250 CWD command successful.
ftp> cd pics
250 CWD command successful.
ftp> send stivlib.png
local: stivlib.png remote: stivlib.png
200 PORT command successful.
150 Opening BINARY mode data connection for 'stivlib.png'.
226 Transfer complete.
2743 bytes sent in 0.00 secs (62295.6 kB/s)
ftp> cd ..
250 CWD command successful.
ftp> cd apps/STIV
250 CWD command successful.
ftp> send stivlib.desktop
local: stivlib.desktop remote: stivlib.desktop
200 PORT command successful.
150 Opening BINARY mode data connection for 'stivlib.desktop'.
226 Transfer complete.
146 bytes sent in 0.00 secs (9505.2 kB/s)
ftp> bye
221 Goodbye.
#

5.Now telnet again to FriendlyARM to change the attributes of the uploaded file.
It shoul become executable

# telnet 192.168.1.230
Trying 192.168.1.230...
Connected to 192.168.1.230.
Escape character is '^]'.

Kernel 2.6.32.2-FriendlyARM on (/dev/pts/0)
FriendlyARM login: root
Password:
[root@FriendlyARM /]# cd /opt/Qtopia/bin/
[root@FriendlyARM bin]# chmod a+x stivlib
[root@FriendlyARM bin]# ls


Restart the board.

Useful links:
Read about Qtopia filesystem standarts on http://doc.trolltech.com/qtopia2.2/html/files.html
vi editor quick refference http://www.digilife.be/quickreferences/QRC/vi%20Quick%20Reference.pdf

1 коментар: