Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
g4proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
g4proxy
Commits
aa691ba3
Commit
aa691ba3
authored
Apr 30, 2019
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udpate
parent
fc157a75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
MainActivity.java
app/src/main/java/com/virjar/g4proxy/MainActivity.java
+21
-2
No files found.
app/src/main/java/com/virjar/g4proxy/MainActivity.java
View file @
aa691ba3
...
...
@@ -25,6 +25,7 @@ import okhttp3.Call;
import
okhttp3.Callback
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
okhttp3.ResponseBody
;
import
top.wuhaojie.installerlibrary.AutoInstaller
;
public
class
MainActivity
extends
AppCompatActivity
implements
View
.
OnClickListener
{
...
...
@@ -77,7 +78,13 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
textView
.
setText
(
deviceMsg
.
toString
());
Request
request
=
HttpClientUtils
.
postRequest
(
"http://taskcenter.beta.qunar.com/api/phone/report"
,
deviceMsg
);
String
serverUrl
=
"https://hotelcrawl.qunar.com/api/phone/report"
;
textView
.
setText
(
serverUrl
);
textView
.
append
(
"\r\n"
+
deviceMsg
);
// Request request = HttpClientUtils.postRequest("http://taskcenter.beta.qunar.com/api/phone/report", deviceMsg);
//https://hotelcrawl.qunar.com/api/phone/report
Request
request
=
HttpClientUtils
.
postRequest
(
"https://hotelcrawl.qunar.com/api/phone/report"
,
deviceMsg
);
HttpClientUtils
.
getClient
().
newCall
(
request
).
enqueue
(
new
Callback
()
{
@Override
...
...
@@ -89,7 +96,19 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
public
void
onResponse
(
@javax
.
annotation
.
Nullable
Call
call
,
@javax
.
annotation
.
Nullable
Response
response
)
{
try
{
if
(
response
!=
null
)
{
Log
.
e
(
"report response"
,
response
.
body
().
string
());
ResponseBody
body
=
response
.
body
();
if
(
body
!=
null
)
{
final
String
responseStr
=
body
.
string
();
MainActivity
.
this
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
textView
.
append
(
"\r\n"
+
responseStr
);
}
});
Log
.
e
(
"report response"
,
responseStr
);
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment