Пример #1
0
 /**
  * @param context
  * @param bundle
  */
 public AbstractBaseOkHttp(@NonNull Context context, @NonNull Bundle bundle) {
   this.context = context;
   this.bundle = bundle;
   printLog = new PrintLog();
   printLog.setRequestTime(
       TimeUtils.getCurrentTimeInString(new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒")));
   request = getRequest();
   printLog.setUrl(request.urlString());
   printLog.setHeaders(
       new StringBuilder()
           .append(CONTENT_TYPE_KEY)
           .append("=")
           .append(request.header(CONTENT_TYPE_KEY))
           .toString());
   execute(getOkHttpClient(), getRequest(), getResponseCallBack());
 }
Пример #2
0
 /**
  * 打印日志,写入sd卡并提交腾讯统计服务
  *
  * @param body
  */
 protected void printLogger(String body) {
   printLog.setResponseTime(
       TimeUtils.getCurrentTimeInString(new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒")));
   printLog.setResponseBody(body);
   printLog.printLogToSdCard(context);
 }