Editing Documentation/Maemo 5 Developer Guide/Application Development/Writing a new maemo application

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 7: Line 7:
The figure below is a screenshot of the text editor.
The figure below is a screenshot of the text editor.
-
[[Image:Maemopad2.png|500px|alt=Screenshot of MaemoPad|MaemoPad text editor]]
+
[[Image:Maemopad2.png|500px]]
== Creating the application file structure ==
== Creating the application file structure ==
Line 15: Line 15:
* <code>debian/</code>: Contains the files related to Debian packaging
* <code>debian/</code>: Contains the files related to Debian packaging
* <code>data/</code>: Contains all data files needed to run the application. Maemopad will need the following data files:
* <code>data/</code>: Contains all data files needed to run the application. Maemopad will need the following data files:
-
**<code>maemopad.desktop</code> file  
+
**<code>.desktop</code> file  
-
**D-Bus <code>maemopad.service</code> file  
+
**D-Bus <code>.service</code> file  
**application icons in a separate directory called <code>icons/</code>
**application icons in a separate directory called <code>icons/</code>
* <code>po/</code>: Contains the localization files. Maemopad contains the following files:
* <code>po/</code>: Contains the localization files. Maemopad contains the following files:
Line 87: Line 87:
* Creating an instance of <code>HildonProgram</code>
* Creating an instance of <code>HildonProgram</code>
* Calling to a function, usually defined in <code>interface.c</code>, to create the main view.
* Calling to a function, usually defined in <code>interface.c</code>, to create the main view.
-
* Connecting the main view window to the created <code>HildonProgram</code>
+
* Connecting the main view window to the created HildonProgram
* Running <code>gtk_main()</code>
* Running <code>gtk_main()</code>
* Connecting the <code>delete_event</code> of the main view to a callback function to handle a proper application exit, such as destroying the main view window, freeing used memory and saving application states before exit.
* Connecting the <code>delete_event</code> of the main view to a callback function to handle a proper application exit, such as destroying the main view window, freeing used memory and saving application states before exit.
Line 121: Line 121:
   g_assert (osso);
   g_assert (osso);
   
   
-
   /* Create the window for our application: */
+
   /* Create the window for our application: */</font>
   data->window = maemopad_window_new (osso);
   data->window = maemopad_window_new (osso);
   hildon_program_add_window (data->program, data->window);
   hildon_program_add_window (data->program, data->window);
Line 355: Line 355:
== Adding application to menu ==
== Adding application to menu ==
-
In short, the <code>maemopad.desktop</code> and <code>com.nokia.maemopad.service</code> files are stored in the <code>./data</code> directory, and they look like this, respectively:
+
See section [localhost#sec:getting_app_to_task_navigator_menu 8.6.1] for information on how to perform this. In short, the maemopad.desktop and com.nokia.maemopad.service files are stored in the ./data directory, and they look like this, respectively
-
  [Desktop Entry]
+
  <code>[Desktop Entry]
  Encoding=UTF-8
  Encoding=UTF-8
  Version=0.1
  Version=0.1
Line 367: Line 367:
  X-Window-Icon-Dimmed=maemopad
  X-Window-Icon-Dimmed=maemopad
  X-Osso-Service=com.nokia.maemopad
  X-Osso-Service=com.nokia.maemopad
-
  X-Osso-Type=application/x-executable
+
  X-Osso-Type=application/x-executable</code>
('''N.B.''' Whitespace is not allowed after the lines.)
('''N.B.''' Whitespace is not allowed after the lines.)
Line 378: Line 378:
These files reside on the device here:
These files reside on the device here:
-
* <code>/usr/share/applications/hildon</code>
+
* /usr/share/applications/hildon
-
* <code>/usr/share/dbus-1/services</code>
+
* /usr/share/dbus-1/services
 +
 
 +
== Link to Maemo menu ==
When the Debian package is installed to Maemo platform, .desktop and .service files are used to link MaemoPad to the Task Navigator.
When the Debian package is installed to Maemo platform, .desktop and .service files are used to link MaemoPad to the Task Navigator.
 +
 +
== Packaging the application ==
== Packaging the application ==
Line 387: Line 391:
{{main|Packaging}}
{{main|Packaging}}
-
A Debian package is an application packed in one file to make installing easy in Debian-based operating systems, like Maemo platform. More information about creating a Debian packages can be found in the [[Documentation/Maemo 5 Developer Guide/Packaging%2C Deploying and Distributing#Creating Debian Packages|creating Debian packages]] section of the [[Documentation/Maemo 5 Developer Guide/Packaging, Deploying and Distributing|Packaging, Deploying and Distributing chapter]]. Our goal in this section is to create a Debian package of MaemoPad, to be installed in the Maemo platform.
+
A Debian package is an application packed in one file to make installing easy in Debian-based operating systems, like Maemo platform. More information about creating a Debian packages can be found in section ''Creating Debian packages'' [/node18.html#sec:creating_debian_packages 17.1] of Maemo Reference Manual Chapter ''Packaging, Deploying and Distributing''. Our goal in this section is to create a Debian package of MaemoPad, to be installed in the Maemo platform.
-
If creating a package that can be installed using the Application Manager, be sure that the package is in an [[Documentation/Maemo 5 Developer Guide/Packaging%2C Deploying and Distributing#Sections|allowed section]].
+
If creating a package that can be installed using the Application Manager, see section ''Making application packages'' [/node18.html#sec:making_app_pack 17.2] of the same aforementioned chapter.
=== Creating debian/ Directory ===
=== Creating debian/ Directory ===
-
In order to create the package, the following files are created in the <code>debian/</code> directory:
+
In order to create the package, the following files are created in the debian/ directory:
-
* <code>changelog</code>
+
changelog
-
* <code>control</code>
+
control
-
* <code>copyright</code>
+
copyright
-
* <code>rules</code>
+
rules
-
* ... etc ...
+
... etc ...
-
The <code>rules</code> file is the file defining how the Debian package is built. The <code>rules</code> file tells where the files should be installed. Also a <code>control</code> file is needed to define what kind of packages (often different language versions) are going to be created. <code>changelog</code> and <code>copyright</code> files are also needed, or the package does not build. The <code>changelog</code> file consists of the version number of the package, and a short description about changes compared to older versions. The <code>copyright</code> file includes information in plain text about the package copyrights.
+
The 'rules' file is the file defining how the Debian package is built. The 'rules' file tells where the files should be installed. Also a 'control' file is needed to define what kind of packages (often different language versions) are going to be created. Changelog and copyright files are also needed, or the package does not build. The 'changelog' file consists of the version number of the package, and a short description about changes compared to older versions. The 'copyright' file includes information in plain text about the package copyrights.
Most important lines in rules file are:
Most important lines in rules file are:

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: