Hi,
This is the code snippet, in which I was doing debugging,
I have put the breakpoint at the first line of the class "LiveTalkClient" (i.e. private final String ipAddress = "127.0.0.1"; // ip of server pc. )
The break point will be hit properly, but after that when I start using F6, it is going to some file like Instrumentation.class , ActivityThread.class.
Actually it is going to a Class File Editor
Please see the attached snapshot for details.
Using java Syntax Highlighting
package com.lnt.livetalkclient;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.app.Activity;
import android.os.Bundle;
public class LiveTalkClient extends Activity implements OnClickListener{
private final String ipAddress = "127.0.0.1"; // ip of server pc.
private final int port = 6666;
EditText mLocation;
Button mConnect;
Socket kkSocket;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
mConnect = (Button) findViewById(R.id.connect_button);
mConnect.setOnClickListener(this);
}
public void onClick(View view) {
try {
kkSocket = new Socket(ipAddress, port);
Connection clientConnect = new Connection(kkSocket);
errorMessage("Socket created successfully with Server IP:" + ipAddress);
} catch (UnknownHostException e) {
errorMessage("Unknown host" + ipAddress);
} catch (IOException e) {
errorMessage("Couldn't get I/O for the connection to: " + ipAddress);
}
}
private void errorMessage(String msg) {
this.showAlert("Error!", msg, "OK", true);
System.err.println("Error:" + msg);
}
}
Parsed in 0.038 seconds, using
GeSHi 1.0.8.4
[img]E:\ANDROID\Debugging[/img]