close

Android ~ GPS定位 與 網路定位
參考自:
http://www.moke.tw/wordpress/computer/advanced/279

//--------------------------   
   
    private LocationManager lms;
//    private String bestProvider = LocationManager.GPS_PROVIDER;    //最佳資訊提供者  取得GPS模組定位
    private String bestProvider = LocationManager.NETWORK_PROVIDER ;    //最佳資訊提供者 取得NET模組定位
   
    private void locationServiceInitial()
    {
        lms = (LocationManager) getSystemService(LOCATION_SERVICE);    //取得系統定位服務
        Criteria criteria = new Criteria();    //資訊提供者選取標準
        bestProvider = lms.getBestProvider(criteria, true);    //選擇精準度最高的提供者
        Location location = lms.getLastKnownLocation(bestProvider);
        getLocation_display(location);
    }
   

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 prague12 的頭像
    prague12

    prague12

    prague12 發表在 痞客邦 留言(0) 人氣()