#ff0000 26  2007 . - #000655   (  SMS  j2me)
#000655  SMS  J2ME!
#def  SMS-  ,  ,  .   160         70   ,   ,    , , .        ,         .   ,    ,           SMS.   

    ,         ,           .         .      .          : , ,  . 

        8   1 ,   ,      256 . 

       7 ,      128. 

       2 ,      - 65536.             ,   , ,  ,         .     unicode. 

   SMS   ,           .     SMS-      1120 ,      .   1120/7 = 160. 

      , , ,      Unicode      .        1120/16 = 70. 

Unicode        ,          . 
 Unicode

    ,          .    :        ,   0  9,    : ".,!?-_"/:@".   ,        160 ,   . 

      .    64       1120   186  . 

    64    ,       ,     .    ,       ,         .     ,        (   ),      Shift. 

,   32       ""  "".      .        . ?   (:          ). 

    26       "a"  "z". ..  2         ""    "b". 

     32     41.   0  9               0  9, ,  , .    0  9  3  (,   ).         ?      -.       22  .        . 

   :  "/",  "/ ",  "/"   " ". 

 ,   ,   ,    : " Lexa   - 128. ",  ,  . 

[ ] [/][ ]lexa[/]  [/] - [/ ]128.[/ ] [/] 
   Shift  .    -   ,   -   .        "  ". 

     " ",    .   ,    "/    6 . 

 Unicode     33*2 = 66 .      41*6/8=31 . ,       ,       .    46        18.  18      3   ,   .          4 ,        3. 

      ?  :           ( , ,   )   ""  "". 

  ,  ,             . 


      SMS-           J2ME,     .   ,       . ,   .        ,    ,         ,  ,     .            . 
     ,      ,     .      .         . , ,       SMS     .           . ,            . ,  ,    ,   :). 
 

       , ,     .       WTK    bin  ktoolbar.exe.      "New Project"    , sms_test,     .     ,  "ok".        . 

        .        apps/sms_test/src.            ,       . 

,          : 
  ,       
         

          Wireless Messaging API.      : 
MessageConnection        . 
MessageListener -        
Message -     ,      . 
TextMessage -   . 
BinaryMessage -   . 

    SMS- c   API: 

try{
String addr = "sms://+1234567890";
MessageConnection conn = (MessageConnection) Connector.open (addr);
TextMessage msg = (TextMessage)conn.newMessage (MessageConnection.TEXT_MESSAGE);
msg.setPayloadText ("Hello World!");
conn.send (msg);
}
catch (Exception e) {} 

 ,    : 
  
  
  
  

        ,    BinaryMessage.     : 

byte[] bin_msg;
try{
String addr = "sms://+1234567890:5151";
MessageConnection conn = (MessageConnection) Connector.open (addr);
BinaryMessage msg = (BinaryMessage)conn.newMessage (MessageConnection.BINARY_MESSAGE);
msg.setPayloadData (bin_msg);
conn.send (msg);
}
catch (Exception e) {}

   ,         ":5151".   ,     .   ,     SMS-,     ,       .       .   ,   ,           .         ,      . 

 ,      5151       : 

try{
String addr = "sms://:5151";
MessageConnection conn = (MessageConnection) Connector.open (addr);
Message msg = null;
while (!ex){
msg = conn.receive();
if (msg instanceof TextMessage){
TextMessage txt_msg = (TextMessage)msg;
String text = txt_msg.getPayloadText();
txt_msg.setPayloadText ("Received: " + text);
conn.send(txt_msg);
}
}
}
catch (Exception e) {}

      .                  .     ,    ,     .       Push Registry,         .            . 

 ,    .  ,       ,    jad-   : 

MIDlet-Push-1: sms://:5151, sms_test, *

 ,    ,      sms  5151 ,    sms_test     .            ( ,  ,        ).     ,  , ,           . 
  

 ,  Push Registry        MIDP  2.0.       1.0             .           ,       . 

 ,   ,             . , ,    Siemens 65            ,        . ,     (, ,      ). 

      ,      MIDP 2.0      .           ,    Internet Explorer  Netscape Navigator.    JavaScript  HTML,     -     ,              . 

 ,   ,           , -,          . 
INFO

 numberOfSegments  MessageConnection  ,         .