MAEMO Training. Day 1
March 23 was the first day of training on MAEMO, which took place in the building of the Scientific Research Center of Moscow State University. Lomonosov in Moscow.
The following topics were considered on this day:
First, I’ll talk about the organization of the training.
At the entrance, traditionally everyone was given badges. And also a disk with the necessary software, documentation and presentations.
There were coffee breaks. Instant coffee, but one of the best. Also tea, mineral water and traditional cookies.
Lunch is not included in the training program, but I’ll tell you about lunch later, this is a separate issue.
The training took place according to the following scheme, the first two introductory topics, then GTK, then Hildon and the task for independent execution, then again about some features of Hildon and MAEMO and again the task.
The first presentation was a review, it was made by Dmitry Malichenko, SPB SUAI .
An important part of the introduction was the description of the MAEMO architecture, the main components you can see in the image
In principle, there’s nothing more to tell from the introductory story, as well-known things went further, like the description of the N900 iron.
The report was made by the same speaker. I also attributed this presentation to the introductory ones, because in general, everything that was told within its framework is nothing new, but I will focus on the most important points:
Log in scratchbox executed command - / scratchbox / the login .
Using the sb-menu script in the scratch box, you can change the environment and platform for assembly and emulation.
To display the emulator’s graphical screen outside the scratch box, you need to run Xephyr with the following command:
and to start MAEMO itself, execute the following commands in the scratchbox:
To run a graphical application from the scratchbox console, you need to use the run-standalone.sh script.
It adds the necessary environment to the launched application.
For application development, the minimum required:
Most of this should already be installed, but if something is missing, you can install it yourself with the usual apt.
The only IDE under which we recommend writing now is EsBox - a modified Eclipse.
esbox.garage.maemo.org/2nd_edition/index.html You
can still use the integration in the "native" Eclipse
wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Eclipse_Integration
At this point, the whole introduction started and ended.
This section will certainly be absolutely not interesting to people working with GTK every day, if you are one of them, you can safely skip it.
However, for me, as for Qt'shnik, this was completely new information.
The report was made by: Yevgeny Linsky, St. Petersburg SUAI
GTK + is a graphical object-oriented library in C.
This leaves a strong imprint on the development style since “pure” C does not support classes and objects.
example:
In C ++ you would write like this:
In C, you have to write like this:
From my point of view, this is creepy, but about this and generally about the advisability of using GTK later.
The main components of the library you can see in the image
The basis of the set of GTK widgets is the basic graphic element GtkWidget, it is the
base class for all graphic elements, from it I inherit buttons, menus, toolbars, etc.
GTK is a signal-oriented library, i.e. when an event occurs (for example, a click buttons) a signal is emitted. The developer can associate the signal with some predefined handler, this is done
by the g_signal_connect () function .
An example of a simple GTK program that only displays a window and closes with a "cross"
Initially , the GTK environment is initialized with the gtk_init () function ,
after which the main program window is created - gtk_window_new () , the
window sizes and its title are set,
then gtk_widget_show_all () is called , which tells the main window to draw itself and all its descendants,
after which the handler is installed ( on_close () ) exits the program and
the gtk_main () function is executed , which starts the main application loop.
After that we talked about GTK containers, containers are widgets in which you can put
other widgets, I will not talk about them here, everyone interested will read the introduction to GTK
it's all quite simple.
At the end of the presentation, several examples of applications that you can download from this
link were considered .
The report was made by Eugene Lininsky.
Hildon is a graphics library for MAEMO. Hildon is an add-on for GTK that
adds an implementation specific to mobile devices, such as a touch input interface.
Hildon completely copies the GTK interface, replacing some functions with its own, which
allows it to interact through drawn elements.
For example, the menu in MAEMO is simply a list of large buttons that are convenient to click on.
The main ToolBar moves down, as is customary in MAEMO. It is important to note that regarding the
ToolBar, the MAEMO developers give the following recommendation - it should contain only really frequently used
application functions, all secondary functions should be brought out in the menu.
After this part of the presentation, the time for “interactive” came and we were asked to
port the Desktop-gtk application to MAEMO-Hildon ourselves.
An example on GTK and the result proposed by the author of the report can be downloaded and studied here.
It is important to note that unlike GTK in Hildon, the canvas redrawing event is only executed when the application starts, but it does not happen when the window is minimized / maximized.
After most of the participants completed the assignment and made a “debriefing”, the
lunch break began. In search of food service, we (a group of three people) walked a path of ~ 7 km, and all because no one knew where to eat in the area of Moscow State University, and the wrong direction was initially chosen.
We were late for 15 minutes to continue, however, the organizers were late too, and apparently for the same reason.
So we did not miss anything.
A stack of windows implements chains of successive windows in which you can return from the top to the bottom with the back button, this approach is very convenient for mobile applications.
Creating a stack window is done by the hildon_stackable_window_new () function ;
And switching to the next window with the gtk_widget_show_all () function with a parameter - a pointer to the next window.
You can implement many stacks of windows in an application.
HildonPannableArea - A widget container that can include the number of child widgets that exceed the screen size,
and that implements inertial scrolling with your finger. The widget is created by the hildon_pannable_area_new () function .
After the presentation, the interactive started again, and we were asked to implement an example using HildonPannableArea and a stack of windows.
However, for today we already ate GTK, and decided to try to do the same on Qt for MAEMO
how to install it and use it, read the article by tass .
As expected, the Qt code turned out to be two times shorter when counted line by line, and the lines themselves were shorter than 2.5 times. This proves once again that something should be made an instrument suitable for this. Moreover, MAEMO 6 (or MeeGo) will completely switch to Qt as a graphics library.
See the Qt code here .
maemo.org/api_refs/5.0/5.0-final - all the necessary documentation for development under MAEMO.
fruct.org - site of the organization that conducted the training.
maemoworld.ru is the site of the Russian MAEMO community.
Audience during a coffee break:
Organizers and speakers (SPB SUAI)
Demonstration of the task application from the task of porting the Desktop-GTK application to MAEMO-Hildon in the Scratchbbox emulator The
same application but already on the device, ported by me personally (in the photo, my hand, by the way :))
About the second day of training the tass user will tell you . For sim, please take my leave, thanks for reading.
Sorokin Vasily: @ VasiliySorokin .
Kormalev Denis: @ BlackTass .
The following topics were considered on this day:
- Introduction to MAEMO. Overview of devices and versions.
- Working environment. IDE overview.
- Introduction to GTK
- Introduction to Hildon
Foreword
First, I’ll talk about the organization of the training.
At the entrance, traditionally everyone was given badges. And also a disk with the necessary software, documentation and presentations.
There were coffee breaks. Instant coffee, but one of the best. Also tea, mineral water and traditional cookies.
Lunch is not included in the training program, but I’ll tell you about lunch later, this is a separate issue.
The training took place according to the following scheme, the first two introductory topics, then GTK, then Hildon and the task for independent execution, then again about some features of Hildon and MAEMO and again the task.
Introduction to MAEMO. Overview of devices and versions.
The first presentation was a review, it was made by Dmitry Malichenko, SPB SUAI .
An important part of the introduction was the description of the MAEMO architecture, the main components you can see in the image
- Media Application Framework - Abstraction over GStreamer
- GDigikam - add-on on GStreamer for working with the camera
- tablet-browser-interface - browser API
- calendar-backend - manage calendar and organizer
- UI Framework
- Hildon Desktop - window manager
- Hildon Graphics Library
- 3D Clutter Library
- Input Method Framework - working with virtual keyboards and layouts
- Nokia graphics
- Sounds, icons, pictures
- Preset video, audio content
- Location Framework - Working with maps and GPS
- Search for coordinates on the map at
- Show on the map
- Get information from the card
- POI (Points Of Interest)
- Data managment
- GConf - a system for storing and managing application settings
- The address book
- Tracker - indexing and search tool
- Package management
- Toolkit
- Graphics libraries gtk +, hildon, cairo, etc.
- Fonts, themes
- RTCom (Real Time Communication)
- Telepathy Framework
- Instant messaging
- IP telephony
- Streaming (telepathy-stream-engine)
- Connection Managers (telepathy-sofiasip)
- Telepathy Framework
- Connectivity framework
- Connection Management (libconic-> D-BUS-> ICd)
- GUPnP framework
- osso-wlan
- Bluez
- Multimedia framework
- GStreamer, codecs
- PulseAudio, codecs
- Cellular
- cellular
- Modem software
- System software
- Power management
- Device Status Management
- upstart
- Maemo launcher
- D-bus
- Hal
- clockd alarmd
- Linux kernel
- Video4Linux
- Sensors
- Vibro
- X Window System
- Opengl es
- Openssl
- C / C ++ Libraries
- Busybox
- Nolo bootloader
In principle, there’s nothing more to tell from the introductory story, as well-known things went further, like the description of the N900 iron.
Working environment. IDE overview.
The report was made by the same speaker. I also attributed this presentation to the introductory ones, because in general, everything that was told within its framework is nothing new, but I will focus on the most important points:
What is required for development
- Linux distribution (preferably Debian-based)
- Scratchbbox - a set of tools for cross-compilation and emulation (ARM platform, x86). Installation instructions can be found in the tass Habrauser article .
- Maemo sdk
- Xephyr - X Server
Emulator launch
Log in scratchbox executed command - / scratchbox / the login .
Using the sb-menu script in the scratch box, you can change the environment and platform for assembly and emulation.
To display the emulator’s graphical screen outside the scratch box, you need to run Xephyr with the following command:
$ Xephyr: 2 -host-cursor -screen 800x480x16 -dpi 96 -ac &
and to start MAEMO itself, execute the following commands in the scratchbox:
export DISPLAY =: 2
af-sb-init.sh start
To run a graphical application from the scratchbox console, you need to use the run-standalone.sh script.
It adds the necessary environment to the launched application.
Working tools
For application development, the minimum required:
- gcc
- pkg-config
- make
- GNU Autotools
- Develop GTK + Library
Most of this should already be installed, but if something is missing, you can install it yourself with the usual apt.
IDE
The only IDE under which we recommend writing now is EsBox - a modified Eclipse.
esbox.garage.maemo.org/2nd_edition/index.html You
can still use the integration in the "native" Eclipse
wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Eclipse_Integration
At this point, the whole introduction started and ended.
Introduction to GTK
This section will certainly be absolutely not interesting to people working with GTK every day, if you are one of them, you can safely skip it.
However, for me, as for Qt'shnik, this was completely new information.
The report was made by: Yevgeny Linsky, St. Petersburg SUAI
GTK + is a graphical object-oriented library in C.
This leaves a strong imprint on the development style since “pure” C does not support classes and objects.
example:
In C ++ you would write like this:
- GtkButton *btn = new GtkButton();
- btn->setLabel("label");
- GtkWindow *w = (GtkWindow *) btn;
* This source code was highlighted with Source Code Highlighter.
In C, you have to write like this:
- GtkButton *btn = gtk_button_new();
- gtk_button_set_label(btn, "label");
- GtkWindow *w = GTK_WINDOW(btn);
* This source code was highlighted with Source Code Highlighter.
From my point of view, this is creepy, but about this and generally about the advisability of using GTK later.
GTK structure
The main components of the library you can see in the image
- Libglade - creating an XML-based interface (not covered in the report)
- GDK - Low Level I / O
- Pango - text output (fonts, style, languages)
- Cairo - Vector graphics, drawing, working with images (a new library designed to replace the standard GDK'shash drawing functions)
- GLib - collections, streams, etc.
Practical use
The basis of the set of GTK widgets is the basic graphic element GtkWidget, it is the
base class for all graphic elements, from it I inherit buttons, menus, toolbars, etc.
GTK is a signal-oriented library, i.e. when an event occurs (for example, a click buttons) a signal is emitted. The developer can associate the signal with some predefined handler, this is done
by the g_signal_connect () function .
An example of a simple GTK program that only displays a window and closes with a "cross"
- #include <gtk/gtk.h>
-
- static void on_close(GtkWindow *window, gpointer user_data){
- gtk_main_quit();
- }
-
- int main(int argc, char *argv[]){
- GtkWidget *window;
-
- gtk_init(&argc, &argv);
-
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(window), "simple");
- gtk_widget_set_size_request(window, 300, 100);
-
- gtk_widget_show_all(window);
-
- g_signal_connect(window, "destroy", G_CALLBACK(on_close), NULL);
-
- gtk_main();
- return 0;
- }
* This source code was highlighted with Source Code Highlighter.
Initially , the GTK environment is initialized with the gtk_init () function ,
after which the main program window is created - gtk_window_new () , the
window sizes and its title are set,
then gtk_widget_show_all () is called , which tells the main window to draw itself and all its descendants,
after which the handler is installed ( on_close () ) exits the program and
the gtk_main () function is executed , which starts the main application loop.
After that we talked about GTK containers, containers are widgets in which you can put
other widgets, I will not talk about them here, everyone interested will read the introduction to GTK
it's all quite simple.
At the end of the presentation, several examples of applications that you can download from this
link were considered .
Introduction to Hildon
The report was made by Eugene Lininsky.
Hildon is a graphics library for MAEMO. Hildon is an add-on for GTK that
adds an implementation specific to mobile devices, such as a touch input interface.
Hildon completely copies the GTK interface, replacing some functions with its own, which
allows it to interact through drawn elements.
For example, the menu in MAEMO is simply a list of large buttons that are convenient to click on.
The main ToolBar moves down, as is customary in MAEMO. It is important to note that regarding the
ToolBar, the MAEMO developers give the following recommendation - it should contain only really frequently used
application functions, all secondary functions should be brought out in the menu.
After this part of the presentation, the time for “interactive” came and we were asked to
port the Desktop-gtk application to MAEMO-Hildon ourselves.
An example on GTK and the result proposed by the author of the report can be downloaded and studied here.
It is important to note that unlike GTK in Hildon, the canvas redrawing event is only executed when the application starts, but it does not happen when the window is minimized / maximized.
Dinner
After most of the participants completed the assignment and made a “debriefing”, the
lunch break began. In search of food service, we (a group of three people) walked a path of ~ 7 km, and all because no one knew where to eat in the area of Moscow State University, and the wrong direction was initially chosen.
We were late for 15 minutes to continue, however, the organizers were late too, and apparently for the same reason.
So we did not miss anything.
Work with Hildon. Stack of windows. HildonPannableArea (kinetic finger scrolling)
A stack of windows implements chains of successive windows in which you can return from the top to the bottom with the back button, this approach is very convenient for mobile applications.
Creating a stack window is done by the hildon_stackable_window_new () function ;
And switching to the next window with the gtk_widget_show_all () function with a parameter - a pointer to the next window.
You can implement many stacks of windows in an application.
HildonPannableArea - A widget container that can include the number of child widgets that exceed the screen size,
and that implements inertial scrolling with your finger. The widget is created by the hildon_pannable_area_new () function .
After the presentation, the interactive started again, and we were asked to implement an example using HildonPannableArea and a stack of windows.
However, for today we already ate GTK, and decided to try to do the same on Qt for MAEMO
how to install it and use it, read the article by tass .
As expected, the Qt code turned out to be two times shorter when counted line by line, and the lines themselves were shorter than 2.5 times. This proves once again that something should be made an instrument suitable for this. Moreover, MAEMO 6 (or MeeGo) will completely switch to Qt as a graphics library.
See the Qt code here .
Work with Hildon. What else is interesting.
- HildonBanner - messages that are displayed for a certain time (display notifications, for example: “connection is established”)
- HildonNote - standard confirmation dialog
- HildonFileSelection - dialog for selecting files optimized for a small screen. (to use it, you must additionally connect the hildon-fm-2 library)
useful links
maemo.org/api_refs/5.0/5.0-final - all the necessary documentation for development under MAEMO.
fruct.org - site of the organization that conducted the training.
maemoworld.ru is the site of the Russian MAEMO community.
Some more photos
Audience during a coffee break:
Organizers and speakers (SPB SUAI)
Demonstration of the task application from the task of porting the Desktop-GTK application to MAEMO-Hildon in the Scratchbbox emulator The
same application but already on the device, ported by me personally (in the photo, my hand, by the way :))
About the second day of training the tass user will tell you . For sim, please take my leave, thanks for reading.
The authors
Sorokin Vasily: @ VasiliySorokin .
Kormalev Denis: @ BlackTass .