Saturday, June 30, 2012

Ussd in J2ME or JME

First of all we need to define what does USSD stand for and what is the meaning of that.

USSD stands for Unstructured Supplementary Service Data. This means that the protocol doesn't define the data layout send in the protocol. For this reason different telecommunications providers have different protocol layouts.

The format of the message start with the * character and end with the # character if you need several fields in the data layout of the protocol you use the * character to divide the different fields for example:

*123*24389745*10000*1020#

Well, if you are thinking in make an application using the Ussd protocol, you need to know that J2ME or JME doesn't support it, and the following are the reason:

In the JSR 120 for messaging the specifications tell us the following:






  • Short Message Service (SMS)
  • Unstructured Supplementary Service Data (USSD)
  • Cell Broadcast Service (CBS)


  • But the specification does not tell us that the USSD protocol needs to be implemented by the provider API company as Nokia or Motorola. So this means that if you want to use the JSR API 120, for sending USSD messages you are not able to do that.

    JSR 205 is the new generation of the JSR 120 but this JSR doesn't define or implement something about the USSD protocol this new JSR was made for the inclusion of the MMS protocol only.

    Other method used to send USSD message is using the platformRequest method of the Midlet  class, the following is an example of how to use it:

    try{
        platformRequest("tel:*248*78945632*7895#" )
    }
    catch(Exception e){
        e.printStackTrace();
    }

    Well, what is the problem with the previous code?, the problem is that you are not able to send the *248*78945632*7895# because the specifications for the tel URL tell us that only numeric digits can be sent in the tel: URL. If you use this method, you can receive a message like Invalid phone numbers, this depends of the phone Midlet implementation.

    These are some of the reason why the USSD messages cannot be sent in the JME world if you have any questions, please just let me know.




    No comments:

    Post a Comment

    Revolutionizing Stream Pipelines with Custom Intermediate Operations JEP 473: Stream Gatherers (Second Preview)

    Introduction In the ever-evolving scene of Java improvement, the Stream API has been a foundation of utilitarian programming paradigms sin...