Tuesday, May 20, 2008
Characters are not always what they seem
In tracking down the issue a developer logged out the pound sign at various points in the code. They all appeared as ? marks. So it seemed that the moment the pound sign was created it was converted. It turned out that this was a wild goose chase. The byte value fro the pound sign was correct. The operating system was converting it when it wrote it to the screen or log file. It seems obvious now that this should happen, but it was not that obvious at the time.
It is very important to always specify the character set when converting byte values to characters. If you are not sure of the character set to use UTF-8 should be adequate for most applications.
In Java web applications you also need to ensure that the HTTPServletRequest's character set is set otherwise some characters sent to the server in the GET or POST requests will not convert correctly. This needs to be done before reading any parameter values from the request.
The other common place to set the character set is when reading and writing files or reading and writing data from a network connection.
SMS message lengths
SMS messages use a 7-bit alphabet and the majority of characters fit into one byte. There are as always exceptions such as the euro symbol or a square bracket. This alphabet is specified in the GSM 03.38 specification.
Have a look at http://www.dreamfabric.com/sms/default_alphabet.html to see the full alphabet.
Tuesday, May 13, 2008
Processing incoming requests
An example of an asynchronous channel would be SMS. The mobile phone sends a SMS to the server via the mobile network operator's infrastructure, the server process the request and then establishes a connection to the mobile network operator to send out the reply SMS. The incoming and out going SMS are not tied together in any way other than by the data they contain.
An example of a synchronous channel would be HTTP over GRPS. Here a connection is opened, the HTTP request data is sent to the server, the server processes the request and sends the response data down the connection and the connection is closed.
For asynchronous communication your application will require a level of internat thread management. This is difficult to achieve using many web scripting languages such as php whereas for synchronous communication you can get away with a web scripting language. To build an application that supports both types of communication requires a lot of thread management and synchronization techniques.
Friday, May 9, 2008
Security for mobile applications
Off-deck applications
In general off-deck applications are easy to use, but require more bandwidth and this could be expensive. It is critical to look at the cost of communication when building this type of application. The Fundamo mobile banking and payment system supports a wide range of channels and each of these have been tuned to reduce the bandwidth of the communication.
I will look at each channel in more detail in later posts and explain how they work and communicate to the server, but in my next blog I will look at the security aspect of the communication. Security is crucial for m-commerce, m-payments and m-banking systems.
Wednesday, May 7, 2008
On-deck applications
One you decide on the application framework you will need to look at the differences in screen resolution for the phones used by your customer base.
For the above reasons on-deck applications are difficult if your application has a wide user base. Java ME is probably supported my the widest variety phones, but ways to managed the screen resolutions will need to be built into your application. In the past the Java classes present in the virtual machines differ from one phone manufacturer to the next. This adds to the complexity of your deployment because classes might be missing or clash with existing ones. The bottom line is that there is an ongoing overhead to test new phones as they become available and manage the screen resolution and packaging differences.
Tuesday, May 6, 2008
Future proofing your m-commerce application
It is essential to abstract the communication and user interface rendering layer from the business process of the application as one would in a typical web application. This is critical whether you are writing an on-deck (mobile device resident) application or a thin client application. What makes this more complicated is that your application will need to deal with multiple communication and user interface rendering implementations concurrently.
My suggestion would be to employ agile development processes. If you have not read Lean Software Development: An Agile Toolkit by Mark and Tom Poppendieck then I strongly recommend reading it. One of the tools they cover is in how to delay decisions as long as possible during the development process. One of the benefits of this is that it forces interfaces to be build thereby abstracting the decision. So by using this tool changes in the communication mechanism and/or the user interface will not impact the rest of your application. Future devices with new user interfaces or ways of sending your application data can also easily be added.
Why is m-Commerce not like e-Commerce
With m-Commerce you are dealing with a wide variety of potential devices. Most of devices that will use your system are probably not even built yet. There are a lot of different mobile phones and devices and each one has different criteria in terms of screen size, supported colors and input mechanisms. How do you write a user interface that will work with a wide variety of devices and look good? More importantly in the time it takes to build your m-commerce application a whole new set of device will have been developed. How do you deal with that added complexity?
Then there is the communication to the back-end server. Will your application communicate using HTTP/S, SMS, USSD or another one of the many protocols supported by mobile devices? How will this data be securely transmitted to your back-end server? In future posts I will be looking at how you can decide what to support and how to implement some of these solutions.