示例#1
0
  private void log(BDLocation location) {
    StringBuffer sb = new StringBuffer(256);
    sb.append("time : ");
    sb.append(location.getTime());
    sb.append("\nerror code : ");
    sb.append(location.getLocType());
    sb.append("\nlatitude : ");
    sb.append(location.getLatitude());
    sb.append("\nlontitude : ");
    sb.append(location.getLongitude());
    sb.append("\nradius : ");
    sb.append(location.getRadius());
    sb.append("\ncity : ");
    sb.append(location.getProvince());
    sb.append(location.getCity());
    sb.append(location.getDistrict());
    if (location.getLocType() == BDLocation.TypeGpsLocation) {
      sb.append("\nspeed : ");
      sb.append(location.getSpeed());
      sb.append("\nsatellite : ");
      sb.append(location.getSatelliteNumber());
    } else if (location.getLocType() == BDLocation.TypeNetWorkLocation) {
      sb.append("\naddr : ");
      sb.append(location.getAddrStr());
    }

    MMLog.autoDebug(sb.toString());
  }
示例#2
0
  private void writeCfg() {
    if (pointD == null) {
      return;
    }

    try {
      ModuleMgr.getCfgMgr().setString("LM_longitude", String.valueOf(pointD.longitude));
      ModuleMgr.getCfgMgr().setString("LM_latitude", String.valueOf(pointD.latitude));

      ModuleMgr.getCfgMgr().setString("LM_province", pointD.province);
      ModuleMgr.getCfgMgr().setString("LM_city", pointD.city);
      ModuleMgr.getCfgMgr().setString("LM_district", pointD.district);

      ModuleMgr.getCfgMgr().setString("LM_addr", pointD.addr);

      ModuleMgr.getCfgMgr().setBoolean("LM_Fix_use", useFixPlace);
      ModuleMgr.getCfgMgr().setString("LM_Fix_latitude", String.valueOf(fixPlace.latitude));
      ModuleMgr.getCfgMgr().setString("LM_Fix_longitude", String.valueOf(fixPlace.longitude));
    } catch (Exception e) {
      MMLog.printThrowable(e);
    }
  }
示例#3
0
 @Override
 public String getJson(BaseMessage message) {
   try {
     JSONObject json = new JSONObject();
     json.put("type", message.getType());
     json.put("f_uid", ((GiftExMessage) message).getF_uid());
     json.put("t_uid", ((GiftExMessage) message).getT_uid());
     json.put("gid", ((GiftExMessage) message).getGid());
     json.put("cost", ((GiftExMessage) message).getCost());
     json.put("gift_res", ((GiftExMessage) message).getGift_res());
     json.put("gift_record_id", ((GiftExMessage) message).getGift_record_id());
     json.put("gift_name", ((GiftExMessage) message).getGift_name());
     json.put("gift_info", ((GiftExMessage) message).getGift_info());
     json.put("gift_img", ((GiftExMessage) message).getGift_img());
     json.put("f_nickname", ((GiftExMessage) message).getF_nickname());
     json.put("t_nickname", ((GiftExMessage) message).getT_nickname());
     json.put("tm", getTimeStr());
     return json.toString();
   } catch (JSONException e) {
     MMLog.printThrowable(e);
   }
   return null;
 }
示例#4
0
  private void readCfg() {
    if (pointD == null) {
      pointD = new PointD();
    }

    try {
      pointD.longitude = Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_longitude", "1000"));
      pointD.latitude = Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_latitude", "1000"));

      pointD.province = ModuleMgr.getCfgMgr().getString("LM_province", "");
      pointD.city = ModuleMgr.getCfgMgr().getString("LM_city", "");
      pointD.district = ModuleMgr.getCfgMgr().getString("LM_district", "");

      pointD.addr = ModuleMgr.getCfgMgr().getString("LM_addr", "");

      useFixPlace = ModuleMgr.getCfgMgr().getBoolean("LM_Fix_use", false);
      fixPlace.longitude =
          Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_Fix_latitude", "1000"));
      fixPlace.latitude =
          Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_Fix_longitude", "1000"));
    } catch (Exception e) {
      MMLog.printThrowable(e);
    }
  }