gps gprs 的判断

gps的判断


private void openGPSSettings() {
LocationManager alm

LocationManager alm = (LocationManager) this
.getSystemService(Context.LOCATION_SERVICE);
if (alm
.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)) {
Toast.makeText(
this , " GPS模块正常 " , Toast.LENGTH_SHORT)
.show();
return ;
}

Toast.makeText(
this , " 请开启GPS " , Toast.LENGTH_SHORT).show();
Intent intent
= new Intent(Settings.ACTION_SECURITY_SETTINGS);
startActivityForResult(intent,
0 ); // 此为设置完成后返回到获取界面

}


gprs的的判断


mTelephoneManager1.getNetworkType();

你可能感兴趣的:(gps gprs 的判断)