1. Are you ready for the Galaxy S20? Here is everything we know so far!

Android gps break socket

Discussion in 'Android Devices' started by worker, Dec 26, 2011.

  1. worker

    worker Lurker
    Thread Starter

    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?
     



    1. Download the Forums for Android™ app!


      Download

       

Samsung Galaxy S Forum

Features and specs are not yet known.

unknown
Release Date
0
Reviews
Loading...
Similar Threads - Android gps break
  1. Scadica
    Replies:
    0
    Views:
    132
  2. SrLimon
    Replies:
    0
    Views:
    144
  3. Olive
    Replies:
    2
    Views:
    159
  4. charlington
    Replies:
    5
    Views:
    234
  5. whois1230
    Replies:
    4
    Views:
    244
  6. catchingup
    Replies:
    1
    Views:
    804
  7. jsmith50
    Replies:
    6
    Views:
    2,655
  8. Raza Shaikh
    Replies:
    1
    Views:
    2,851
  9. haniya
    Replies:
    0
    Views:
    1,864
  10. haniya
    Replies:
    1
    Views:
    1,216

Share This Page

Loading...