且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

开启或关闭状态的Andr​​oid GPS

更新时间:2023-02-02 19:30:56

没有。检查GPS状态在Android上要求

No. Checking GPS Status on Android requires

android.permission.ACCESS_FINE_LOCATION

在code,检查GPS状态

The code to check the status of GPS


 LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE );
 boolean statusOfGPS = manager.isProviderEnabled(LocationManager.GPS_PROVIDER);