Monday, October 15, 2007

OpenMoko Interface

OpenMoko is the GNU/Linux distribution designed for smartphones. After we have powered up the Neo we are running GNU/Linux with the XWindows graphical user interface, running a variety of applications. All (or at least most) of the applications conform to a common look and feel.

In this chapter we present the general user interface that is provided by the OpenMoko framework which is used to drive the Neo. We note that a vast collection of GNU/Linux applications can run on the smartphone, most not designed for it. We present in this book primarily applications developed for the limited screen space available for the common OpenMoko installation.


Basic Concepts

After turning on the Neo1973 the system will boot into OpenMoko. Whilst it is booting a simple splash screen is displayed, showing the Neo's logo and a progress bar. Once booted, the XWindows system is started, and the screen changes to show the logo and a Please wait message (as we saw in Figure 1.4). We will then see the main OpenMoko application, called Today, as annotated in Figure 3.1.

The Neo's screen is now actually displaying a couple of running applications. In general, the OpenMoko interface consists of a top Panel and an application area where the various OpenMoko applications open their own windows. Each application, in fact, generally occupies all of the space of the screen. The Panel occupies the top part of the screen, but is essentially transparent, sitting on top of the title of bar of the application. In Figure 3.1 an application (called Today) is open. Notice that the name of the application is shown in the application's title bar and the Panel displays a collection of icons that sit in the title bar on the right.

The default Today application presents a summary of missed calls and new messages, as well as a list of tasks from our calendar. The row of icons along the top can be used to open other common applications and a row of tabs along the bottom to select different pages from the application (Home page, Main Menu page, and Application Manager.

Figure 3.1: The OpenMoko's Today Application
Image neo_today_annotated

The Panel is a standard OpenMoko application, and in fact is a computer program called matchbox-panel-2. The general user does not need to know this, nor would they ever type these program names into a computer terminal, but it is useful to have a little bit of a conceptual model of how the OpenMoko system fits together. To get adventurous, though, have a look at Section 15.3, beginning page [*].

The Panel appears as a titlebar for the running application, and includes a digital clock, a collection of information and connectivity icons for Bluetooth (local area wireless connectivity), USB (cable connectivity to a host computer), GPS (satellite-based location system), GSM (mobile phone system), and a battery status.

OpenMoko uses the so-called matchbox window manager sitting on top of the X window system for displaying the graphical components of each of the applications.

Applications written for OpenMoko either aim to be finger-based applications (and thus tend to have larger buttons for you to touch with your finger) or stylus-based (and thus have smaller buttons and more traditional menu items etc.). Many of the most commonly used applications are finger-based applications, so that for common usage we don't need to use our stylus.

Another characteristic of OpenMoko applications is that they monitor your changes and immediately save them so that you will not need to explicitly save anything. It will just happen.

To close an application a quick press of the POWER button is all that is needed (except for the Today application for which this does not have any effect). To switch to another currently running application press the AUX button. The Today application can also be used to switch to or close other applications (see the Manager tab). Also, for all applications other than Today, a tap in the top left of the title bar will display a menu of currently running applications that we can choose to switch to.

OpenMoko is the GNU/Linux distribution designed for smartphones. After we have powered up the Neo we are running GNU/Linux with the XWindows graphical user interface, running a variety of applications. All (or at least most) of the applications conform to a common look and feel.

In this chapter we present the general user interface that is provided by the OpenMoko framework which is used to drive the Neo. We note that a vast collection of GNU/Linux applications can run on the smartphone, most not designed for it. We present in this book primarily applications developed for the limited screen space available for the common OpenMoko installation.


Basic Concepts

After turning on the Neo1973 the system will boot into OpenMoko. Whilst it is booting a simple splash screen is displayed, showing the Neo's logo and a progress bar. Once booted, the XWindows system is started, and the screen changes to show the logo and a Please wait message (as we saw in Figure 1.4). We will then see the main OpenMoko application, called Today, as annotated in Figure 3.1.

The Neo's screen is now actually displaying a couple of running applications. In general, the OpenMoko interface consists of a top Panel and an application area where the various OpenMoko applications open their own windows. Each application, in fact, generally occupies all of the space of the screen. The Panel occupies the top part of the screen, but is essentially transparent, sitting on top of the title of bar of the application. In Figure 3.1 an application (called Today) is open. Notice that the name of the application is shown in the application's title bar and the Panel displays a collection of icons that sit in the title bar on the right.

The default Today application presents a summary of missed calls and new messages, as well as a list of tasks from our calendar. The row of icons along the top can be used to open other common applications and a row of tabs along the bottom to select different pages from the application (Home page, Main Menu page, and Application Manager.

Figure 3.1: The OpenMoko's Today Application
Image neo_today_annotated

The Panel is a standard OpenMoko application, and in fact is a computer program called matchbox-panel-2. The general user does not need to know this, nor would they ever type these program names into a computer terminal, but it is useful to have a little bit of a conceptual model of how the OpenMoko system fits together. To get adventurous, though, have a look at Section 15.3, beginning page [*].

The Panel appears as a titlebar for the running application, and includes a digital clock, a collection of information and connectivity icons for Bluetooth (local area wireless connectivity), USB (cable connectivity to a host computer), GPS (satellite-based location system), GSM (mobile phone system), and a battery status.

OpenMoko uses the so-called matchbox window manager sitting on top of the X window system for displaying the graphical components of each of the applications.

Applications written for OpenMoko either aim to be finger-based applications (and thus tend to have larger buttons for you to touch with your finger) or stylus-based (and thus have smaller buttons and more traditional menu items etc.). Many of the most commonly used applications are finger-based applications, so that for common usage we don't need to use our stylus.

Another characteristic of OpenMoko applications is that they monitor your changes and immediately save them so that you will not need to explicitly save anything. It will just happen.

To close an application a quick press of the POWER button is all that is needed (except for the Today application for which this does not have any effect). To switch to another currently running application press the AUX button. The Today application can also be used to switch to or close other applications (see the Manager tab). Also, for all applications other than Today, a tap in the top left of the title bar will display a menu of currently running applications that we can choose to switch to.


Application Look and Feel

The OpenMokoWiki includes guidelines for the user interface. Here we provide a user's overview of what to expect in interacting with OpenMoko applications.

Many OpenMoko applications divide the screen into two main panels for displaying information. The Contacts application is an example (Figure 3.2). The top panel is used to display a list of entries, and the bottom panel is used to display details of the selected entry. The top title bar includes menus while the dividing bar starts with a search facility button, followed by application specific buttons. The lower part of the dividing bar includes a latch to drag up and down, to change the displayed proportions of each of the main panels.

Figure 3.2: Contacts application
Image QEMU_contacts

The title bar includes the application's name on the left portion. The right portion includes an indication of what is being displayed in the top panel, and will only appear if there is the option to filter that is displayed.

Each application has a menu accessible by tapping the left hand end of the application title bar (where the application name is displayed). The menu will include various items but at a minimum it includes a Close item, which will always be the last item in the list. Other items are grouped according to function, as in Figure 3.3

Figure 3.3: Contacts menu
Image QEMU_contacts_menu

To collapse the menu (i.e., to make it disappear without making a choice) you can tap anywhere else on the touch screen.

If there is a menu available on the right of the application title bar (as indicated by the down pointing arrow that is visible in Figure 3.3) then it will be used to filter or to alter what you are seeing within the application. Figure 3.4 shows the Calculator application that has no such filter menu.

Figure 3.4: Calculator has no filter menu
Image QEMU_calculator

Figure 3.5 shows the simple search filter for the Contacts application, and Figure 3.6 shows a different kind of filter where we select a particular message (i.e., mail) box for the Messages application.

Figure 3.5: Contacts filter
Image QEMU_contacts_filter


Image QEMU_messages_filter
Figure 3.6: Messages filter

Keyboard

The OpenMoko Keyboard is an application that can be called upon at any time to provide textual entry. It is useful in applications such as Contacts and Terminal.

The keyboard is displayed when we need to enter text into some text field. It is automatically displayed. The default keyboard is a finger-based keyboard, with good sized keys, as illustrated in Figure 3.7 in use with the Messages application where the To: field and the beginnings of a message have been typed using the keyboard.

Figure 3.7: Keyboard with Messages application
Image QEMU_messages_keyboard

The buttons on the right allow us to choose between a number of keyboards, selecting from all capitals and lowercase typewriter mode, numeric mode and symbol mode. The lower button will display a Chinese keyboard!

A stylus-based keyboard is also available. It includes access to a typical computer keyboard layout, including the Control key, Alt, Tab, Esc, and caps lock. To choose this keyboard tap to at the right end of the keyboard icon next to the main menu. A menu will pop up. Choose the second keyboard option. The finger-based keyboard will be replaced by the stylus-based keyboard shown in Figure 3.8. Notice also the cursor keys in the bottom right corner of the keyboard.

Figure 3.8: Stylus keyboard
Image QEMU_messages_keyboard_stylus

The third type of ``keyboard'' is the stroke recogniser. Choosing this option from the same keyboard menu which we used to choose the stylus-based keyboard, replaces the keyboard region with a blank pad. In this pad we can use our finger or stylus to trace out letters which will generally be recognised and displayed in the relevant application. We can delete the last letter by gesturing a minus sign (--) running backwards (i.e., from right to left). For a carriage return, gesture a diagonal line running toward the bottom left corner.

Settings

Timezone

To set the timezone for OpenMoko we need to have the timezones package installed and the relevant timezone package for our locality. For me this was timezone-australia. We also need to link the appropriate timezone to the configuration file for it to take effect:

neo$ ipkg update
neo$ ipkg install timezones && ipkg install timezone-australia
neo$ ln -s /usr/share/zoneinfo/Australia/Sydney /etc/localtime

To automatically get the correct time set on the smartphone we can install the ntpclient package:

neo$ ipkg install ntpclient
neo$ ntpclient -s -h pool.ntp.org
39322 70493.047 331195.0 8.0 181866358562.5 95581.1 0

This ntpclient program produces some informative output. The numbers are, repsectively, and using UTC, the number of days since 1900 (39,322), the number of seconds since midnight (70,493.047), the elapsed time for NTP transaction (331,195 microseconds), the internal server delay (8 microseconds), the clock difference between your computer and the NTP server (181,866,358,562.5 microseconds--i.e., the clock was very wrong), the dispersion reported by server (95581.1 microseconds), and the smartphone's adjtimex frequency.

Now run the command again to see that little adjustment is required:

neo$ ntpclient -s -h pool.ntp.org
39324 80045.708 437477.0 23.0 182643.0 37292.5 0

After installing the timezone we might also note that the date format changes to our local format. See Figure 3.9.


Image neo_today_tasks_example


Figure 3.9: Today using local date format.


Web Browser

The Web application on the Neo1973 GTA01Bv4 will load unencrypted pages for directly specified URLs, but some links and form submissions crash the browser and we can't yet add bookmarks.

Figure 11.1: Web application
Image QEMU_web

Terminal

GNU/Linux developers always feel comfortable when there is a command line! But a command line is not for everyone. Normally we are a lot more productive using a command line, but we need to remember a lot more as well, which is one of the main benefits of the graphical user interfaces!

The Terminal application within OpenMoko (the program name is XnullXXnullXprogramsapplications (application)programsbuttons (button)programsfiles (file)programspaths (path)programsprograms (program)programsmenus (menu)XnullXprogramsprogramsgtkterm2) is a standard X window system terminal where users can enter GNU/Linux commands and directly start OpenMoko applications (e.g., openmoko-dialer) from the command line. To start the terminal application, select the Terminal item from the Main Menu.

Control characters and backspaces appear as empty boxes on the screen which needs some termcap tuning. Remote shells are just fine. A quick fix to remove the empty boxes is to hide the keyboard and then to make it appear again (e.g., by cycling through other applications), or a simple Ctrl-L. The backspaces then have their effect!

Because an embedded system like OpenMoko needs to be very memory efficient the basic set of GNU/Linux commands needs to be very efficiently implemented. BusyBox provides a full suite of common GNU/Linux commands, but implemented as a single program, and generally with fewer of the not so common options for each of the programs. Each program will usually work in much the same way as the full GNU/Linux counterpart. Programs include: ash (the shell), date (to display and set the date), ls (to list the contents of a directory), ps (to list the currently running processes), and very many more.

For example, to set the date of the Neo1973 you can:

neo$ date -s 082921182007

setting the date and time to 29 August 2007, 21:18. Be sure to also synchronise this with the time stored in the hardware with:

neo$ hwclock --systohc

We can also use ssh from our USB connected computer to connect to the ssh-server running on the Neo1973. OpenMoko uses the DropBear implementation of ssh.

Programs like rsync are used to copy files to and from the Neo. From the Neo you can also ssh to itself. Note that there is no password for the root user, by default. A good idea to change this.

Figure 15.1: Terminal application.
Image QEMU_terminal



No comments: