views:

140

answers:

1

Hi. I am working on a android project and I need to connect the gPhone with the PC using UDP socket. The same operation, sending a message to from gPhone to the PC, returns different results in different time: Sometimes succeeded and sometimes throws a SocketExcepton(The system call was cancelled). Can anyone tell me what possibly results in this SocketException?

Thanks in advance!

+1  A: 

Add this to your app's manifest:

<uses-permission android:name="android.permission.INTERNET" />
Macarse
I have added this to the manifest before asking this question. Since the sending operation succeeds sometimes (and fails sometimes), I believe the problem is not the internet permission.Thanks! :)
cat
Ok, can you post a sample code that reproduce the issue?
Macarse