I didn't say it, but yes I already have the emulator running before I
run the connection test.
I haven't installed any Activity/Service yet for handling the SMS
message, but since the
emulator is running, I would expect the socket connection to be made.

--Ken

On Apr 9, 10:43 pm, "John P." <[EMAIL PROTECTED]> wrote:
> You need something on the other end accepting a connection request on
> port 5554.  In your case, run the emulator first.
>
> On Apr 9, 9:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > Inhttp://groups.google.com/group/android-beginners/browse_thread/thread...
> > 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 android-beginners@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to