DaLi Zhang

Greenhorn
+ Follow
since Nov 23, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by DaLi Zhang

Hi Anthony,

I used to try the port redirection. The same way as you have written. But I still can not get any incoming message. There will be an error when the system try to do this:

DatagramSocket socket = new DatagramSocket(SERVERPORT, serverAddr);

it only works when the serverAddr is '127.0.0.1'.

If you have successfully set up the connection, can you show me some part of your code?? Thanks a lot.

Best,
Echo
13 years ago
11-21 14:31:47.323: ERROR/UDP(217): java.net.SocketException: Permission denied (maybe missing INTERNET permission)

It seems like you have not add the permission onto your application. try to do this way
In your manifest.xml file, add this sentence
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
you can find other examples from android SDK doc

By the way, the DatagramSocket CAN be created when you are using '127.0.0.1' in emulator, but if you change it to your host machine's IP address, it still report
errors. I have not figure out the reason yet. Hope some other people can help.

Best,
Echo
13 years ago