Hey guys,
I've been programming desktop Java for 4 years now, and I'm not
embarking on a project in Android Java. The first stage of this is to
get a client connecting to a basic echo server running on Desktop
Java. I've messed about with it for a few days, and finally reverted
to just trying to get the socket connecting using the basic hello
android example. So far this is what I have:-
package com.example.helloandroid;
import java.io.*;
import java.net.Socket;
import java.net.UnknownHostException;
import android.app.Activity;
import android.os.Bundle;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
try {
super.onCreate(savedInstanceState);
Socket socket = new Socket("10.0.2.2", 1234);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
setContentView(R.layout.main);
}
}
I've got
<uses-permission android:name="android.permission.INTERNET" />
in the manifest, so I don't think that's the problem. I'm pretty much
stumped.
Thanks for any help!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en