1

I am building an Android application and I would like to locate the phone WITHOUT the help of GPS or Internet. Instead, I would like to locate the phone with the help of the cellular signals. How can this be achieved? PS. I am kind of new. Thanks in advance.

4

1 回答 1

0

您可以请求系统根据 NetworkProvider 向您显示位置更新。可以通过使用给定的 NETWORK_PROVIDER 参数请求位置更新来完成

例如看下面:

   LocationManager mlocManager = (LocationManager)contextWrapper.getSystemService(Context.LOCATION_SERVICE); 
    mlocManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 60000, 0, this);

下面从Android文档复制

// 向位置管理器注册监听器以接收位置更新 locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener); requestLocationUpdates() 中的第一个参数是要使用的位置提供程序的类型(在这种情况下,用于蜂窝塔和基于 Wi-Fi 的位置的网络位置提供程序)。

于 2013-04-18T14:15:01.587 回答