Ejemplo n.º 1
0
  private boolean sendNewMsgWithPic(String str, FileUploaderHttpHelper.ProgressListener listener)
      throws WeiboException {
    String url = URLHelper.STATUSES_UPLOAD;
    Map<String, String> map = new HashMap<String, String>();
    map.put("access_token", access_token);
    map.put("status", str);
    if (geoBean != null) {
      map.put("lat", String.valueOf(geoBean.getLat()));
      map.put("long", String.valueOf(geoBean.getLon()));
    }

    return HttpUtility.getInstance().executeUploadTask(url, map, pic, listener);
  }
Ejemplo n.º 2
0
  public boolean sendNewMsg(String str, FileUploaderHttpHelper.ProgressListener listener)
      throws WeiboException {

    if (!TextUtils.isEmpty(pic)) {
      return sendNewMsgWithPic(str, listener);
    }
    String url = URLHelper.STATUSES_UPDATE;
    Map<String, String> map = new HashMap<String, String>();
    map.put("access_token", access_token);
    map.put("status", str);
    if (geoBean != null) {
      map.put("lat", String.valueOf(geoBean.getLat()));
      map.put("long", String.valueOf(geoBean.getLon()));
    }

    HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, url, map);
    return true;
  }
Ejemplo n.º 3
0
    @Override
    protected String doInBackground(Void... params) {

      Geocoder geocoder = new Geocoder(WriteWeiboActivity.this, Locale.getDefault());

      List<Address> addresses = null;
      try {
        addresses = geocoder.getFromLocation(geoBean.getLat(), geoBean.getLon(), 1);
      } catch (IOException e) {
        cancel(true);
      }
      if (addresses != null && addresses.size() > 0) {
        Address address = addresses.get(0);

        StringBuilder builder = new StringBuilder();
        int size = address.getMaxAddressLineIndex();
        for (int i = 0; i < size; i++) {
          builder.append(address.getAddressLine(i));
        }
        return builder.toString();
      }

      return "";
    }
Ejemplo n.º 4
0
 public LocationInfoDao(GeoBean bean) {
   this.latlng[0] = bean.getLat();
   this.latlng[1] = bean.getLon();
 }