-1

I want to know the change of network cell areas. I don't want to run GPS thing. On normal mobile service without 3G/4G data. Can i know my location.

I know the 2G connection is not that powerful,But my application will work in a space where i am not very sure Data based 3G/4G connections will come.

So I am looking for something in 2G. Making a request on 2G seems bad idea because of Low data rate. so if i can know the cell area.

sKhan
  • 9,694
  • 16
  • 55
  • 53
Nbajam 2015
  • 360
  • 4
  • 20

1 Answers1

0

Try this:

network location provider. This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup. Requires either of the permissions android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.

Location nwLocation = appLocationService
                        .getLocation(LocationManager.NETWORK_PROVIDER);

                if (nwLocation != null) {
                    double latitude = nwLocation.getLatitude();
                    double longitude = nwLocation.getLongitude();
                    Toast.makeText(
                            getApplicationContext(),
                            "Mobile Location (NW): \nLatitude: " + latitude
                                    + "\nLongitude: " + longitude,
                            Toast.LENGTH_LONG).show();
                } else {
                    //Log.e("elsepart","not getting");
                }

            }
        });
Androider
  • 3,833
  • 2
  • 14
  • 24