Hi,
I'm new at android development, and i've got some problems. I've been
searching in this group but i couldn't find anything about my issue,
sorry if repeated.
I'm doing an IRC client just to try Android SDK. In the main UI i've
got a textView where i put the server responses.
To connect to the irc server, i use a socket.
The problem is that i can't see any responses written in the textView
while if i debug it, i see it's working correctly.
My code is:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
text = (TextView) findViewById(R.id.text);
try{
Socket socket = new Socket(SERVER, PORT);
input = new BufferedReader(new InputStreamReader
(socket.getInputStream()));
output = new PrintWriter(socket.getOutputStream(), true);
String reply = connect();
text.setText(reply);
} catch(Exception ex){
ex.printStackTrace();
text.append(ex.getMessage());
}
}
private String sendCommand(String msg){
String reply = "";
try{
output.println(msg);
reply = input.readLine();
}catch (Exception ex){
text.append(ex.getMessage());
}
output.flush();
return reply;
}
private String connect (){
reply = sendCommand("PASS NOPASS\n\r");
reply += sendCommand("NICK " +NICK+"\n\r");
reply += sendCommand("USER "+NICK+EOF );
reply += sendCommand ("JOIN #misatofans");
return reply;
}
Sorry for my bad english and thanks in antticipation
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---