Hi All,
In
http://groups.google.com/group/android-beginners/browse_thread/thread/8a78b5766408ebb6
Digit suggested:
| you typically access the console by doing "telnet localhost 5554",
but the
| cool thing is that you can also do that programmatically. what I
mean is
| that your program can do the following:
| 1/ connect to TCP port 5554 on localhost
| 2/ write the command "sms send <senderPhoneNumber> <textMessage>"
followed
| by a newline character (i.e. '\n') followed by "quit\n"
| 3/ read any answer character from the connection (necessary on
Windows to
| avoid really weird Winsock-specific socket shutdown issues) until
you
| encounter an error (which means the connection was closed)
I'm having trouble with Step 1/. I get "Connection Refused" when I
try the following simple test:
public class TestConsoleConnect
{
public static void main(String[] args){
InetAddress lh = null;
Socket skt = null;
try {
lh = InetAddress.getLocalHost();
} catch (UnknownHostException uhe){ }
try {
skt = new Socket( lh, 5554);
} catch (IOException ioe) {
System.out.println(ioe);
} finally { try { if (skt != null){ skt.close(); }
} catch (Exception e){ } }
}
}
I'm running on Mac OS X 10.5 with SDK m5-rc15_mac-x86.
What am I missing or misunderstanding?
Thanks in advance,
Ken Bowen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---