Editing Developer FAQ

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 33: Line 33:
Enter the following lines in the Scratchbox:
Enter the following lines in the Scratchbox:
-
  eval $(dbus-launch --sh-syntax)
+
  X86: ~] > eval $(dbus-launch --sh-syntax)
-
  export DBUS_SESSION_BUS_ADDRESS
+
  X86: ~] > export DBUS_SESSION_BUS_ADDRESS
-
  export DBUS_SESSION_BUS_PID
+
  X86: ~] > export DBUS_SESSION_BUS_PID
Then run the dbus-monitor command and it should work fine!
Then run the dbus-monitor command and it should work fine!
Line 42: Line 42:
'''Error messages'''
'''Error messages'''
-
[config/dbus] couldn't take over org.x.config: org.freedesktop.DBus.Error.AccessDenied (Connection ":1.310" is not allowed to own the service "org.x.config.display2" due to security policies in the configuration file)
+
[config/dbus] couldn't take over org.x.config: org.freedesktop.DBus.Error.AccessDenied (Connection ":1.310" is not allowed to own the service "org.x.config.display2" due to security policies in the configuration file)
'''Solution'''
'''Solution'''
Line 48: Line 48:
You need to edit the following file:
You need to edit the following file:
-
/etc/dbus-1/system.d/xorg-server.conf
+
  /etc/dbus-1/system.d/xorg-server.conf
-
Add the following three lines in the "<code><policy context="default"></code> group
+
Add the following three lines in the "<policy context="default"> group
-
<source lang="xml">
+
  <allow own="org.x.config.display2"/>
-
<allow own="org.x.config.display2"/>
+
  <allow send_destination="org.x.config.display2"/>
-
<allow send_destination="org.x.config.display2"/>
+
  <allow send_interface="org.x.config.display2"/>
-
<allow send_interface="org.x.config.display2"/>
+
-
</source>
+
-
Basically you should have one for each display you plan on using, by default display 0 and display 1 are in the file. If you are planning on using a different display number for Xephyr than :2 make sure you use its number rather than "display2" when you add these lines.
+
Basically you should have one for each display you plan on using, by default display 0 and display 1 are in the file.   If you are planning on using a different display number for Xephyr than :2 make sure you use its number rather than "display2" when you add these lines.
=== How can I avoid "qemu" error messages of "af-sb-init start" in ARMEL target? ===
=== How can I avoid "qemu" error messages of "af-sb-init start" in ARMEL target? ===
Line 106: Line 104:
The problem can be resolved like this (with thanks to Frank Banul in the developer list):
The problem can be resolved like this (with thanks to Frank Banul in the developer list):
-
<ol>
+
1) add "deb http://scratchbox.org/debian/ maemo5-sdk main" to /etc/apt/sources.list  
-
<li>
+
-
add <pre>deb http://scratchbox.org/debian/ maemo5-sdk main</pre> to <code>/etc/apt/sources.list</code>
+
2) run:
-
</li>
+
sudo apt-get remove scratchbox-devkit-debian
-
<li>
+
sudo apt-get install scratchbox-devkit-debian
-
run:
+
sudo apt-get remove scratchbox-devkit-perl
-
<pre>
+
sudo apt-get install scratchbox-devkit-perl
-
sudo apt-get remove scratchbox-devkit-debian
+
-
sudo apt-get install scratchbox-devkit-debian
+
-
sudo apt-get remove scratchbox-devkit-perl
+
-
sudo apt-get install scratchbox-devkit-perl
+
-
</pre>
+
-
</li>
+
-
</ol>
+
=== Why can I reach an IP-address but no domain inside Scratchbox? ===
=== Why can I reach an IP-address but no domain inside Scratchbox? ===
Line 131: Line 122:
'''Error messages'''
'''Error messages'''
Depends on the program, which is used. But here a small test client in python:
Depends on the program, which is used. But here a small test client in python:
-
<source lang="python">
+
 
-
import urllib2
+
import urllib2
-
print urllib2.urlopen("http://google.com").read()
+
print urllib2.urlopen("http://google.com").read()
-
</source>
+
Then the following error message will be returned:
Then the following error message will be returned:
Line 154: Line 144:
  SBOX> sb-conf in -edFL
  SBOX> sb-conf in -edFL
-
This sets the <code>/scratchbox/etc/resolv.conf</code> as default and ignores the one of the scratchbox. Info about the command you'll find [http://maemo.org/development/sdks/maemo_5_beta_2_sdk_installation/#manualinstall here].
+
This sets the /scratchbox/etc/resolv.conf as default and ignores the one of the scratchbox. Info about the command you'll find [http://maemo.org/development/sdks/maemo_5_beta_2_sdk_installation/#manualinstall here].
These steps should solve the problem. If it still does not work, you could try to replace the entries of the resolv.conf '''within''' the scratchbox with the same entries of the resolv.conf of the '''host''' system by hand.
These steps should solve the problem. If it still does not work, you could try to replace the entries of the resolv.conf '''within''' the scratchbox with the same entries of the resolv.conf of the '''host''' system by hand.
Line 179: Line 169:
To solve this stop the framework, kill all old processes and start it again. This can be done by:
To solve this stop the framework, kill all old processes and start it again. This can be done by:
-
# stop the framework:<pre>af-sb-init.sh stop</pre>
+
* stop the framework:
-
# kill old processes:<pre>sb-conf killall</pre>
+
~] > af-sb-init.sh stop
-
# restart:<pre>af-sb-init.sh start</pre>
+
 
 +
* kill old processes:
 +
~] > sb-conf killall
 +
 
 +
* restart:
 +
~] > af-sb-init.sh start
=== How to install the SDK+ on a Linux AMD64 platform? ===
=== How to install the SDK+ on a Linux AMD64 platform? ===
Line 219: Line 214:
== Porting to Fremantle ==
== Porting to Fremantle ==
-
{{main|Documentation/Maemo 5 Developer Guide/Porting Software}}
+
This section is intended to consolidate the common errors that occur while trying to port Diablo applications to Fremantle. Feel free to improve this page and/or add additional information.
-
 
+
-
This section is intended to consolidate the common errors that occur while trying to port [[Open development/Maemo roadmap/Diablo|Diablo]] applications to [[Open development/Maemo roadmap/Fremantle|Fremantle]]. Feel free to improve this page and/or add additional information.
+
===maemo-select-menu-location: command not found===
===maemo-select-menu-location: command not found===
Line 232: Line 225:
  dpkg: error processing leafpad (--configure): subprocess post-installation script returned error exit  status 127
  dpkg: error processing leafpad (--configure): subprocess post-installation script returned error exit  status 127
-
'''Reason'''
+
'''Reason'''  
-
:maemo-select-menu-location is obsolete. In Fremantle, there is no submenu like, "Utility", "Extra", "Settings" etc. All installed 3rd party software will be visible under "Applications" by default.   
+
 
 +
maemo-select-menu-location is obsolete.
 +
In Fremantle, there is no submenu like, "Utility", "Extra", "Settings" etc. All installed 3rd party software will be visible under "Applications" by default.   
'''Action'''
'''Action'''
-
:Remove the instance from the post installation script. It is not needed.
+
Remove the instance from the post installation script. It is not needed.
===Missing dependency: maemo-installer-utils===
===Missing dependency: maemo-installer-utils===
'''Reason'''
'''Reason'''
-
:The package <code>hildon-application-manager</code> no longer provides <code>maemo-installer-utils</code>. The commands <code>maemo-confirm-text</code>, <code>maemo-application-running</code>, <code>maemo-list-user-packages</code> are  still available.  
+
 
 +
The package hildon-application-manager no longer "provides" ''maemo-installer-utils''. The commands ''maemo-confirm-text'', ''maemo-application-running'', ''maemo-list-user-packages'' are  still available.  
'''Action'''
'''Action'''
-
:Replace the dependency with <code>hildon-application-manager</code>.  
+
 
 +
Replace the dependency with hildon-application-manager.  
===Missing dependency: libhildonhelp0===
===Missing dependency: libhildonhelp0===
'''Reason'''
'''Reason'''
-
:libhildonhelp does not exist in Fremantle.
+
 
 +
libhildonhelp does not exist in Fremantle.
'''Action'''
'''Action'''
-
:Remove the dependency and calls to the help APIs.
+
 
 +
Remove the dependency and calls to the help APIs.
===Limitation of Home Area applets===
===Limitation of Home Area applets===
-
Unlike Diablo, in Fremantle these applets do not support text input, pannable areas, resizing nor scrolling.
+
Unlike Diablo in Fremantle these applets don't support text input, pannable areas, resizing nor scrolling.
'''Reason'''
'''Reason'''
-
:Framework limitations.
+
 
 +
Framework limitations.
'''Action'''
'''Action'''
-
:Replace text input fields with dialogs. Use buttons for scrolling. Add resizing options in the settings dialog or adapt the UI of the applet regarding to that. For further information on how to develop those applets, please check the [[Documentation/Maemo_5_Developer_Guide/Application_Development/Writing_Desktop_Widgets|documentation]].
+
 
 +
Replace text input fields with dialogs. Use buttons for scrolling. Add resizing options in the settings dialog or adapt the UI of the applet regarding to that. For further information on how to develop those applets, please check the [[Documentation/Maemo_5_Developer_Guide/Application_Development/Writing_Desktop_Widgets|documentation]].
===What icon size should be used?===
===What icon size should be used?===
Line 269: Line 270:
'''Application Manager'''
'''Application Manager'''
-
* Icon size: <code>HILDON_ICON_SIZE_FINGER</code>
+
* Icon size: HILDON_ICON_SIZE_FINGER.
* In Gimp or Photoshop: 48x48 pixels
* In Gimp or Photoshop: 48x48 pixels
'''Task Launcher'''
'''Task Launcher'''
-
* Icon size: <code>HILDON_ICON_SIZE_THUMB</code>
+
* Icon size: HILDON_ICON_SIZE_THUMB.
* In Gimp or Photoshop: 64x64 pixels
* In Gimp or Photoshop: 64x64 pixels
Line 283: Line 284:
'''Problem'''
'''Problem'''
-
:The text in dialog boxes is not formatted correctly (truncated on the right size), when a icon is in place.
+
 
 +
The text in dialog boxes is not formatted correctly (truncated on the right size), when a icon is in place.
'''Action'''
'''Action'''
-
:In general icons should not be used in dialogs in Fremantle. Remove the icon and the text will be formatted correctly.
+
 
 +
In general icons should not be used in dialogs in Fremantle. Remove the icon and the text will be formatted correctly.
===Initialisation scripts===
===Initialisation scripts===
'''Problem'''
'''Problem'''
-
:Initialisation scripts don't work any more.
+
 
 +
Initialisation scripts don't work any more.
'''Reason'''
'''Reason'''
-
:Fremantle has switched to using '''upstart''' for system initialisation.
+
 
 +
Fremantle has switched to using '''upstart''' for system initialisation.
'''Action'''
'''Action'''
-
:Create '''upstart''' job definitions instead of init scripts.  Information on writing these can be found on http://upstart.ubuntu.com/getting-started.html. However, be aware that the directory used on Maemo 5 is <code>/etc/event.d</code>.
 
-
:The job script should be placed in <code>/etc/event.d/''package''</code>.  And the package postinst, prerm and postrm should use the ''start --quiet'' and ''stop --quiet'' commands to start and stop the service.  Unfortunately there is no debhelper tool to assist with this.
 
 +
Create '''upstart''' job definitions instead of init scripts.  Information on writing these can be found on http://upstart.ubuntu.com/getting-started.html.  However, be aware that the directory used on Maemo 5 is ''/etc/event.d''.
-
=== Enabling sudo for user installed scripts ===
+
The job script should be placed in /etc/event.d/''package''. And the package postinst, prerm and postrm should use the ''start --quiet'' and ''stop --quiet'' commands to start and stop the service. Unfortunately there is no debhelper tool to assist with this.
-
 
+
-
'''Problem'''
+
-
:Users tend to want to edit /etc/sudoers to allow a command provided by a script they created to run with raised privileges. This is highly likely to result in a bricked device forcing you to re-flash to make it work again from scratch.
+
-
 
+
-
'''Reason'''
+
-
:The <code>/etc/sudoers</code> file seems deceivingly straight forward to edit. It's not:
+
-
  <code>
+
-
    17:27 < MohammadAG51> listen to that advice<BR>
+
-
    17:27 < MohammadAG51> don't be a smartass like I did once
+
-
  </code>
+
-
 
+
-
'''Action'''
+
-
:Add your specific sudo configuration to "<code>/etc/sudoers.d/*</code>" as a new file (courtuesy to the reader, you are advised to read [http://www.sudo.ws/sudo/sudoers.man.html this] to understand how to create sudoers.d/ snippets appropriate for your application or script.
+
-
:Run update-sudoers and profit.
+
== Qt ==
== Qt ==
Line 322: Line 312:
There is a [[Qt4 Hildon|Qt page on the wiki]] with some useful information, and [http://qt.nokia.com/doc/qt-maemo-4.6/index.html official Qt for Maemo documentation].
There is a [[Qt4 Hildon|Qt page on the wiki]] with some useful information, and [http://qt.nokia.com/doc/qt-maemo-4.6/index.html official Qt for Maemo documentation].
-
=== How to create "[[Documentation/Maemo_5_Developer_Guide/Human_Interface_Guidelines/Windows#Window_Views|HildonStackableWindows]]"?===
+
=== How to create "[[Documentation/Maemo_5_Developer_Guide/Human_Interface_Guidelines/Windows#Window_Views | HildonStackableWindows]]"?===
-
This is done by setting a special attribute on the window, as shown in the [http://doc.qt.nokia.com/qt-maemo-4.6/maemo5-stackedwindows.html Qt Maemo 5 stacked window example].
+
This is done by creating a [http://doc.trolltech.com/4.5/qmainwindow.html QMainWindow], with another QMainWindow as parent in the constructor.
 +
'''Example'''
 +
<source lang="cpp">
 +
// created by [http://talk.maemo.org/member.php?u=25407 hopbeat]
 +
 +
QApplication app(argc, argv);
 +
QMainWindow* window=new QMainWindow();
 +
window->setCentralWidget(someWidget);
 +
         
 +
window->show();
 +
 +
QMainWindow* window2=new QMainWindow(window);
 +
window2->show();
 +
</source>
== Autobuilder ==
== Autobuilder ==
=== Localization isn't working ===
=== Localization isn't working ===
-
You are probably using the following line in <code>configure.ac</code>:
+
You are probably using the followin line in configure.ac:
  localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
  localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
-
This means that you need to add <code>osso-af-settings</code> to your Build-Depends.
+
This means that you need to add osso-af-settings to your Build-Depends.
=== Package gets rejected: REJECTED: The same or newer version is already in extras-devel ===
=== Package gets rejected: REJECTED: The same or newer version is already in extras-devel ===
Line 342: Line 345:
=== Build failed: No such file or directory in log file ===
=== Build failed: No such file or directory in log file ===
-
You probably forgot to specify the correct Build-Depends in <code>debian/control</code>. The autobuilder starts every build with a clean SDK image. If you need any application during building which is not available in the default SDK image, you need to specify it specifically.
+
You probably forgot to specify the correct Build-Depends in debian/control. The autobuilder starts every build with a clean SDK image. If you need any application during building which is not available in the default SDK image, you need to specify it specifically.
You may verify that your Build-Depends field in debian/control is complete by running
You may verify that your Build-Depends field in debian/control is complete by running
Line 348: Line 351:
  dpkg-depcheck -m dpkg-buildpackage -rfakeroot -b
  dpkg-depcheck -m dpkg-buildpackage -rfakeroot -b
-
in the source tree.  (You'll need to "<code>fakeroot apt-get install devscripts</code>" for this to work).
+
in the source tree.  (You'll need to <code>fakeroot apt-get install devscripts</code> for this to work).
=== Build failed, works in my own scratchbox ===
=== Build failed, works in my own scratchbox ===
Line 360: Line 363:
{{main|Documentation/Maemo 5 Developer Guide/Packaging, Deploying and Distributing}}
{{main|Documentation/Maemo 5 Developer Guide/Packaging, Deploying and Distributing}}
-
As Maemo is based on the Debian operating system, creating packages for Maemo borrows a lot of tools and techniques from Debian, however there are [[Packaging#Maemo-specific packaging information|some Maemo-specific differences]].
+
As Maemo is based on the Debian operating system, creating packages for Maemo borrows a lot of tools and techniques from Debian, however ther are [[Packaging#Maemo-specific_information|some Maemo-specific differences]].
-
A [[Packaging|simple guide to get started]] is available.
+
A [[Packaging | simple guide to get started]] is available.
=== How do I request upload rights for Extras ===
=== How do I request upload rights for Extras ===
Line 370: Line 373:
=== How do I enable extras, extras-testing, and extras-devel in Scratchbox ===
=== How do I enable extras, extras-testing, and extras-devel in Scratchbox ===
-
Add the following lines to <code>/etc/apt/sources.list</code> from within scratchbox:
+
Add the following lines to /etc/apt/sources.list from within scratchbox:
  deb http://repository.maemo.org/extras/ fremantle free non-free
  deb http://repository.maemo.org/extras/ fremantle free non-free
  deb-src http://repository.maemo.org/extras/ fremantle free
  deb-src http://repository.maemo.org/extras/ fremantle free

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: