actually, they do:
see http://weblogs.java.net/bl
Main Topics
Browse All TopicsI need to do the following:
- from a PC/Server send an SMS message to a phone (I will have the phone number)
- this SMS message must be sent to a specific port# on that phone (this enables my J2ME app to handle the message as it arrives as required by the project)
- this phone is on the Nextel/IDEN network (but anyone who knows how to do it with other networks is welcome to tell me how they do it)
- no commecial SMS services
There seems to be lots of paid SMS Gateways.
There seems to be lots of APIs that specifically allow SMS through email BUT I need that additional feature of sending an SMS message to a PORT number.
In short, my J2ME Midlet needs to receive SMS messages from a PC/Server and accordingly it must be a phone-number/port-number address.
Any help is greatly appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
actually, they do:
see http://weblogs.java.net/bl
ncoo is WRONG!!
THere are ports on the phone, and this is possible ONLY in GSM networks
This is possible by the use of EMS - in which the normal SMS gets a UDH - User Data Header.
Depending on the header value, the message can be sent to a certain port. (and from a certain port)
Here is the Midlet code for the same :
This is the code you require to RECEIVE messages sent to a certain port. Here the listening port is 8899.
import java.io.IOException;
import java.util.Date;
import java.util.Vector;
import javax.microedition.io.Conn
import javax.microedition.lcdui.C
import javax.microedition.lcdui.D
import javax.microedition.lcdui.D
import javax.microedition.lcdui.F
import javax.microedition.lcdui.S
import javax.microedition.midlet.
import javax.wireless.messaging.M
import javax.wireless.messaging.M
import javax.wireless.messaging.M
import javax.wireless.messaging.T
public class IncMessageHandler implements MessageListener
{
private Display disp;
private MIDlet mid;
private boolean processing = false;
Vector queue = new Vector(10);
private MessageConnection conn = null;
public IncMessageHandler(Display display, MIDlet midlet)
{
this.disp = display;
this.mid = midlet;
init();
}
public void init()
{
try
{
conn = (MessageConnection) Connector.open("sms://:889
conn.setMessageListener(th
}
catch (Exception e)
{
try
{
conn.close();
}
catch (Exception e1)
{
}
}
}
public void notifyIncomingMessage(Mess
{
Message msg = null;
try
{
msg = conn.receive();
if (msg instanceof TextMessage)
{
TextMessage tmsg = (TextMessage) msg;
queue.addElement(tmsg);
processMessage();
}
}
catch (Exception e)
{
}
}
private void processMessage()
{
try
{
if (processing)
{
return;
}
processing = true;
if (queue == null || queue.size() <= 0)
{
return;
}
Object head = queue.elementAt(0);
queue.removeElementAt(0);
TextMessage tmsg = (TextMessage) head;
//Here is the message that you received, with the from, text and the date fields
String from = tmsg.getAddress();
String text = tmsg.getPayloadText();
Date date = tmsg.getTimestamp();
//Process here as required
}
catch (Throwable t)
{
}
finally
{
processing = false;
}
processMessage();
}
public void cleanup()
{
try
{
conn.close();
}
catch (IOException e1)
{
}
}
}
To send TO a certain port, FROM another do this :
This sends message FROM port 5000 to port 8899 of the recipient
String to = //address of the recipient
String message = "text message to be sent";
try
{
MessageConnection clientConn = (MessageConnection) Connector
.open("sms://:5000");
TextMessage tmsg = (TextMessage) clientConn
.newMessage(MessageConnect
tmsg.setAddress("sms://"+t
tmsg.setPayloadText(messag
clientConn.send(tmsg);
}
catch -blah blah
In case you want your application to startup based on a message received on a certain port, you need to use the PushRegistry :
import javax.microedition.io.Push
PushRegistry.registerConne
This will result in your application starting up on receiving a SMS on 8899
Business Accounts
Answer for Membership
by: ncooPosted on 2007-06-04 at 12:05:33ID: 19211090
Mobile phone numbers don't have port numbers in the same way web servers do. It would be quite a cool feature though if they did though.
You may be getting confused with PAC codes.
"PAC is Porting Authorisation Code. It is required to transfer your number from your current service provider to the new service provider."