« November 2008 | Main | January 2009 »

December 2008

22 December 2008

JPDialer is ready for download

Now JPDialer, Android version of Dialer, is ready for download from my web site.

What is JPDialer? For whom is it? JPDialer is a dial utility that converts “+” sign to an appropriate international call prefix. If you match all of the following conditions, you may need this application:

  • You are using any Android based mobile phone.

  • You are going to make a phone call from Japan.

  • You are using a SIM card from Japanese mobile phone operator.

  • You are going to make a phone call to a phone number that begins with “+” sign.

  • You do not like to edit manually the phone number before making a phone call.

Please enjoy :)

| | TrackBack (0)

19 December 2008

Making a phone call programmatically from Android - JPDialer

Recently I got a T-Mobile G1, Google Android mobile phone. For my study of Android platform, I started to port my MIDP applications to Android. The first target was Dialer, which was so small that it should be easily ported. By the way, as the name “Dialer” is used by Android’s standard telephony application, I named Android version of my application “JPDialer”.

In order to make a phone call to a particular phone number programmatically from an Android mobile phone, Context.startActivity() method is used with specifying an Intent.ACTION_DIAL or Intent.ACTION_CALL, and a phone number. If you would use the latter Intent, you need to add CALL_PHONE permission to your application’s manifest. The following code snippet can place a phone call:

Continue reading "Making a phone call programmatically from Android - JPDialer"

| | TrackBack (0)

18 December 2008

Profiling main screen - Expense Report (6)

The more I have used the Expense Report application and have added expenses, the longer Sony Ericsson W890i has taken to show the main screen. Although I suppose it, it is slower than expectation.  W890i takes 7 seconds to display 50 expense items while Nokia E51 takes 3 seconds. The user can feel like being kept waiting so long if the duration exceeds 5 seconds. Furthermore, because I have not optimised the implementation, the main screen will be instantiated every time the user goes back to it. It means that the user has to wait very long time for the main screen after any operation.

Which part really took so long time? I have measured profiling data so that I could find out the bottleneck in the main screen.

Continue reading "Profiling main screen - Expense Report (6)"

| | TrackBack (0)

15 December 2008

Soft key labels - Expense Report (5)

As a small change in Expense Report version 0.5.1, I have revised soft key labels so that even small screen handsets can display them without truncation.

In the market, there are still many mobile phones with small screens like 220x176 pixels, 2 inches diagonal. Six Latin letters or two Far-Eastern letters are typically suitable for soft key labels so that such small screen can properly display them. Again, this is just a typical case because Latin letters are usually shown with proportional fonts, which means that the width of letters differ from one to another.


In MIDP-2.x, command labels can have two forms: one is short form for soft key labels on the bottom of the screen, the other is long form for command menu screen. I also have added long labels so that MIDP-2.x devices can display more self-contained labels.


| | TrackBack (0)

12 December 2008

Sony CMD-J70

CMD-J70 from Sony was the first GSM mobile phone that I bought in Europe. The ecosystem of GSM was very much interesting to me. In Japan, there was no GSM service offered. In contrast with GSM world, every single handset was tightly coupled with each contract. You could not use your handset if you moved from an operator to the next one, because, all mobile phones were designed for a specific operator.


Continue reading "Sony CMD-J70"

| | TrackBack (0)

Improvement of multilingual support - Expense Report (4)

Besides reorganisation of the internal state management, I also modified the following during development of Expense Report version 0.5.0:

  • The user can select the language when the application is invoked for the first time.
  • The user can delete two or more expenses at the same time.
  • From the version information screen, the user can launch web browser and connect the application's web site so that the user can learn the latest information of the application. (This works only for MIDP-2.x handsets.)

Until Expense Report version 0.4.2, the application's default language depended on the mobile phone's language setting. While the language for labels on the screen can be changed after the first invocation, the language for preset data such as expense type names cannot be changed. This means that the user needed to set the language of the handset properly before he/she attempted to install Expense Report. Version 0.5.0 onwards ask the user which language is preferable when the application is first time invoked. Preset data will be initialised in accordance with the user’s language selection.

Secondly, I added a new screen so that the user can delete two or more expenses at the same time on. By this feature, the user can delete all expenses with preserving preference settings. By pressing “Mark multiple expenses” command on the main screen, the application goes to the screen that has check boxes attached to each expense. The user can press “Mark all expenses” command and subsequently “Delete selected expenses” command, so that selected expenses will be deleted. Because the type of instantiated List object cannot get altered, MULTIPLE type List is prepared for this purpose in addition to the IMPLICIT type one that is used for the main screen.


Version information screen was prepared separately for MIDP-1.0 and MIDP-2.x. The first one relies on Alert while the other does on Form. The latter has a link to the application's web site and it can launch the web browser by calling MIDlet.platformRequest() method. Usually it connects the English web page, but it connects the Japanese one if the application's language is set to Japanese.


| | TrackBack (0)

11 December 2008

Reorganisation of internal state management - Expense Report (3)

After releasing Expense Report version 0.4.2, I decided to reorganise the internal state management. Because, the following two major functionalities remained to be added, which expected to be so complicated that implementation could get much confused:

  • Synchronisation between mobile phones.
  • Exporting data for PC software.

Both required asynchronous I/O, and did the users many steps to operate. I needed to prepare for mechanism that could afford adding such complicated features.

Previously, pressing command buttons by the user only triggered state transition. Therefore, all state transition occurred inside CommandListener.commandAction() method. Since asynchronous operations were going to be introduced, I decided to reorganise the internal state management. Finally, I got a huge switch-case block, which looked as if it was a window procedure in Windows programming. It must be later split into several pieces, or be replaced with table-driven state machine, or I have to rewrite it by using the State design pattern.

| | TrackBack (0)

02 December 2008

List.append() - Fragmentation in MIDP

They say that Java ME has been fragmented due to proprietary extensions by manufactures and network operators. In reality, not only proprietary extensions but also MIDP, which should be a baseline, has been fragmented. This article describes an example that I have experienced with List class in Expense Report project.

I defined DataBountList class that extends List, which is for displaying expense summary. While List has string labels and icons for each item, DataBoundList additionally has arbitrary objects bound to items. In the case of Expense Report, each item is bound to an object that represents each expense.

Continue reading "List.append() - Fragmentation in MIDP"

| | TrackBack (0)

« November 2008 | Main | January 2009 »