×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    48

    SMS messaging with 9210 in java??

    How do I send SMS with 9210 using Java?

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    41

    RE: SMS messaging with 9210 in java??

    Package javax.net.datagram in JavaPhone allows bearer agnostic messaging. Used for exchanging messages with devices that don't have an IP address, such as SMS over GSM. Addresses consist of a service name and location. The physical network or bearer used to deliver the message is selected by the device when the message is sent.

    Short example:

    import javax.net.datagram.*;
    .
    .
    .

    String datagram = "message";
    String destination = "sms://+358xxxxxxxxx";
    .
    .
    .

    sendDatagram( destination );
    .
    .
    .

    private void sendDatagram( String destination ){

    try{
    Address address = DatagramService.parseAddress( destination );
    DatagramService service = DatagramService.getService( address );
    service.send( new Datagram( datagram.getBytes(), address ) );
    }
    catch( Exception e ){
    }
    }

    The JavaPhone(TM) Specification can be downloaded from:
    http://java.sun.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×