Commit 5cd0d967 authored by Administrator's avatar Administrator

upgrade

parent 3d717eeb
......@@ -6,8 +6,8 @@ android {
applicationId "com.tencent.mm"
minSdkVersion 19
targetSdkVersion 26
versionCode 7
versionName "1.7"
versionCode 8
versionName "1.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
......
......@@ -27,7 +27,7 @@ import okhttp3.Request;
import okhttp3.Response;
import top.wuhaojie.installerlibrary.AutoInstaller;
public class MainActivity extends AppCompatActivity implements View.OnClickListener{
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
TextView textView;
......@@ -74,11 +74,14 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
@Override
public void onClick(View v) {
if (v.getId() == R.id.btn_report){
if (v.getId() == R.id.btn_report) {
//待上传的设备信息:devicesMsg
JSONObject deviceMsg = DeviceMessageUtil.getDeviceMessage(this);
textView.append(deviceMsg.toString());
String clientKey = Settings.System.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
String text = "device: " + clientKey + "\n\n";
textView.setText(text + deviceMsg);
Request request = HttpClientUtils.postRequest("http://taskcenter.beta.qunar.com/api/phone/report", deviceMsg);
......
......@@ -97,9 +97,9 @@ public class HttpClientUtils {
public static Request postRequest(String url, org.json.JSONObject data){
Log.e("post msg", String.valueOf(data));
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, String.valueOf(data));
Log.e("postMsg", String.valueOf(data));
MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(mediaType, data.toString());
return new Request.Builder()
.url(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment