コード例 #1
0
  public static void e(int errorcode, String msg, Throwable e, CommonAdVO vo) {
    if (msg != null) {
      if (SwitchConfig.LOG) {
        if (e != null) {
          msg += e.getMessage();
        }
        Log.e(TAG, msg);
      }

      if (SwitchConfig.ERROR && context != null) {
        HashMap<String, String> data = new HashMap<String, String>();
        int etype = errorcode / 100;
        data.put("etype", etype + "");
        data.put("ecode", errorcode + "");
        data.put("emsg", Utils.base64Encode(msg));
        data.put("etime", System.currentTimeMillis() + "");

        if (e != null) {
          data.put("exception", Utils.base64Encode(e.getMessage()));
          String trace = Utils.stackTraceToString(e);
          data.put("trace", Utils.base64Encode(trace));
        }

        data.putAll(getBasicParameters());

        if (vo != null) {
          data.putAll(getAdParameters(vo));
        }

        final HashMap<String, String> logdata = data;

        new Thread(
                new Runnable() {
                  @Override
                  public void run() {
                    LogUploader.postLog(logdata, context, true);
                  }
                })
            .start();
      }
    }
  }
コード例 #2
0
  private void onAdShowed() {
    QHADLog.d("Video ad onAdShowed ");
    if (!isShowed) {
      long currentTime = Utils.getCurrentTime();

      if (currentTime - vo.mid < StaticConfig.MAX_REQUEST_SHOW_INTERVAL * 1000) {
        QhAdModel.getInstance().getTrackManager().RegisterTrack(vo, TrackType.IMP_AD);
        isShowed = true;
      }
    }
  }
コード例 #3
0
  /**
   * 获取基本参数
   *
   * @return
   */
  private static HashMap<String, String> getBasicParameters() {
    HashMap<String, String> map = new HashMap<String, String>();

    map.put("apppackagename", Utils.getAppPackageName());
    map.put("appname", Utils.getAppname());
    map.put("appv", Utils.getAppVersion());
    map.put("sdkv", StaticConfig.SDK_VERSION);
    map.put("channel", StaticConfig.CHANNEL_ID);
    map.put("os", Utils.getSysteminfo());
    map.put("imei", Utils.getIMEI());
    map.put("imei_md5", Utils.getIMEIWhitMD5());
    map.put("imsi", Utils.getIMSI());
    map.put("imsi_md5", Utils.getIMSIWhitMD5());
    map.put("mac", Utils.getMac());
    map.put("mac_md5", Utils.getMacWhitMD5());
    map.put("model", Utils.getProductModel());
    map.put("screenwidth", Utils.getDeviceScreenSizeWithString(true));
    map.put("screenheight", Utils.getDeviceScreenSizeWithString(false));
    map.put("so", Utils.getScreenOrientation());
    map.put("density", Utils.getDeviceDensity() + "");
    map.put("appname", Utils.getAppname());
    map.put("apppkg", Utils.getAppPackageName());
    map.put("net", Utils.getCurrentNetWorkInfo());
    map.put("androidid", Utils.getAndroidid());
    map.put("androidid_md5", Utils.getAndroididWithMD5());
    map.put("longitude", StaticConfig.longitude);
    map.put("latitude", StaticConfig.latitude);
    map.put("brand", Utils.getBrand());
    map.put("carrier", Utils.getNetworkOperator());
    map.put("m2id", Utils.getm2id());
    map.put("serialid", Utils.getDeviceSerial());
    map.put("devicetype", Utils.getDeviceType() + "");
    map.put("rmac", Utils.getRouteMac());
    map.put("rssid", Utils.getRouteSSID());

    return map;
  }