Beispiel #1
0
  private void init() {
    ci = CommonInfo.getInstance();

    option.setOpenGps(true); // 打开gps
    option.setCoorType("bd09ll"); // 设置坐标类型
    option.setScanSpan(60000);

    mLocClient.registerLocationListener(myListener);
    mLocClient.setLocOption(option);
    mLocClient.start();
  }
Beispiel #2
0
  /** 开始定位服务, activity的onResume中设置监听,用于回调 */
  public void startLocatingActive(OnLocationUpdateListener loclistener, int wait) {
    ci = CommonInfo.getInstance();

    option.setOpenGps(true); // 打开gps
    option.setCoorType("bd09ll"); // 设置坐标类型
    option.setScanSpan(wait);

    mLocClient.registerLocationListener(myListener);
    mLocClient.setLocOption(option);
    mLocClient.start();
    mLocClient.requestLocation();
    LocListener = loclistener;
  }
Beispiel #3
0
 public LocationData getLocation() {
   ci = CommonInfo.getInstance();
   return ci.myLoc;
 }
Beispiel #4
0
 public void saveLocation() {
   ci = CommonInfo.getInstance();
   // ci.persist();
 }