Saturday, June 30, 2012

Groovy 2.0 is realesed


The new version of the popular programming language Groove has been released.

The following are some of the changes in the version 2.0 of the Groovy programming language.
  • Add static type checking to the language: what is this? well this is the capacity that the compiler can check the signatures and the types of the method this does not mean that the compiler make a static compilation. 
  • Static compilation: this means that the method that is market with the @CompileStatic annotation would be compiled in a static way and refers to all the static linking of the compilation. 
  • Covers the new language features of java 7 to be aligned with the Java language interoperability. 
    • Add Multi Catch Block, Binary Literals, 
  • InvokeDinamis: in the new version the groovy compiler adds the JVM instruction for invokedinamics calls, gain in the future from the optimizations of the JVM for this bytecode instruction.  
  • Modular Groovy: the modularization of groovy will be permit to the runtime to organize and divide the runtime in several modules permits to groovy to be adapted to new Environment and performance requirements. 
Enjoy of groovy 2.0 and see the following link Groovy 2.0 for more information.





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.




    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...