Beispiel #1
0
        @Override
        public void onSuccess(int type, ResBean result) {
          switch (type) {
            case Const.ReqType.DEVICE_REPORT:
              if (result.isSuccess()) {
                LocalDeviceManager deviceManager = LocalDeviceManager.getInstance(appContext);
                deviceManager.updateDeviceInfoReport(
                    appContext, System.currentTimeMillis(), Config.getApiVersion());
              } else {
                // TODO: error handle
              }
              break;

            case Const.ReqType.DEVICE_UPDATE_VERSION:
              if (result.isSuccess()) {
                LocalDeviceManager deviceManager = LocalDeviceManager.getInstance(appContext);
                deviceManager.updateDeviceInfoReport(
                    appContext, System.currentTimeMillis(), Config.getApiVersion());
              } else {
                LocalDeviceManager deviceManager = LocalDeviceManager.getInstance(appContext);
                deviceManager.clearDeviceInfoReport(appContext);
              }
              break;
          }
        }
Beispiel #2
0
 public void updateAppVersion() {
   RequestAttributes<ResBean> attrs = new RequestAttributes(appContext);
   attrs.setUrl(RequestURL.URL_DEVICE_UPDATE_APP_VERSION);
   attrs.setType(Const.ReqType.DEVICE_UPDATE_VERSION);
   attrs.setConverter(new GeneralConverter());
   RequestParams params = new RequestParams();
   params.add("device_id", DeviceInfo.getDeviceId(appContext));
   params.add("app_name", Const.APP_NAME_REQ);
   params.add("app_version", Config.getApiVersion());
   attrs.setParams(params);
   HttpRequestHelper.excutePostRequest(attrs, requestListener);
 }
Beispiel #3
0
 public void reportDeviceInfo() {
   RequestAttributes<ResBean> attrs = new RequestAttributes(appContext);
   attrs.setUrl(RequestURL.URL_DEVICE_REPORT);
   attrs.setType(Const.ReqType.DEVICE_REPORT);
   attrs.setConverter(new GeneralConverter());
   RequestParams params = new RequestParams();
   params.add("app_type", "1");
   params.add("app_name", Const.APP_NAME_REQ);
   params.add("device_id", DeviceInfo.getDeviceId(appContext));
   params.add("device_version", DeviceInfo.getDeviceModel());
   params.add("device_brand", DeviceInfo.getBrand());
   params.add("os_version", DeviceInfo.getAndroidVersion());
   params.add("app_version", Config.getApiVersion());
   params.add("ext", DeviceInfo.getExtInfo(appContext));
   attrs.setParams(params);
   HttpRequestHelper.excutePostRequest(attrs, requestListener);
 }