我读到谷歌地图在不久的将来不会免费用于网站 - 这让我想到如果用于Android开发的谷歌地图API仍然是免费的吗?
我需要在我的应用程序中找到一个GPS位置,这个位置不需要准确(只有大约1km的精度),但我需要它非常快!(1S-5S)
我注册了这个监听器:
mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
mlocManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, mlocListener);
Run Code Online (Sandbox Code Playgroud)
但是找到修复需要很长时间!有没有人知道一种方法,我可以更快地找到位置(我基本上只需要设备所在的当前城镇).谢谢!
当我请求Cell ID和LAC信息时,在某些设备上我无法检索它们.
我用这个代码:
TelephonyManager tm =(TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
location = (GsmCellLocation) tm.getCellLocation();
cellID = location.getCid();
lac = location.getLac();
Run Code Online (Sandbox Code Playgroud)