• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android gps break socket

worker

Lurker
When I try to get GPS-coordinates on device with Android I get break the socket's connection.
The problem is reproduced on the Samsung Galaxy i9000(Android version: 2.3.4).
Isn't reproduced on LG P500(Android version: 2.3.3).
Source code for GPS coordinate retrieving (started in a main thread):
private final long MIN_TIME = 60000;
private final long MIN_DISTANCE = 10;

_locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);

try {
_locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER, MIN_TIME, MIN_DISTANCE, _gpsListener);
} catch (Exception e) {
System.out.println(e.toString());
}
Source code for socket (started as separate service)^
_socket = new Socket();
_socket.setSoTimeout(200);
InetSocketAddress sockaddr = new InetSocketAddress(_ip, _port);
_socket.connect(sockaddr, 4000);

Someone faced with this problem?
It is associated with the version of android or is is a hardware problem?
 
Back
Top Bottom