调试网站状态图标调试完成
This commit is contained in:
parent
d474eb6158
commit
d51ebbd550
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 29 17:35:04 GMT 2025
|
#Sat Mar 29 19:57:40 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=15.2
|
||||||
publishVersion=15.2.1
|
publishVersion=15.2.1
|
||||||
buildCount=38
|
buildCount=63
|
||||||
baseBetaVersion=15.2.2
|
baseBetaVersion=15.2.2
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 29 17:35:04 GMT 2025
|
#Sat Mar 29 19:57:40 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=15.2
|
||||||
publishVersion=15.2.1
|
publishVersion=15.2.1
|
||||||
buildCount=38
|
buildCount=63
|
||||||
baseBetaVersion=15.2.2
|
baseBetaVersion=15.2.2
|
||||||
|
@ -68,7 +68,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
ToastUtils.show("onStartCommand");
|
//ToastUtils.show("onStartCommand");
|
||||||
// 由应用 Intent 启动时,应用可以通过下面函数实例化实际服务进程。
|
// 由应用 Intent 启动时,应用可以通过下面函数实例化实际服务进程。
|
||||||
runMainThread();
|
runMainThread();
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
|
|
||||||
synchronized void runMainThread() {
|
synchronized void runMainThread() {
|
||||||
if (mWinBollClientThread == null) {
|
if (mWinBollClientThread == null) {
|
||||||
ToastUtils.show("runMainThread()");
|
//ToastUtils.show("runMainThread()");
|
||||||
mWinBollClientThread = new WinBollClientThread();
|
mWinBollClientThread = new WinBollClientThread();
|
||||||
mWinBollClientThread.start();
|
mWinBollClientThread.start();
|
||||||
}
|
}
|
||||||
@ -91,6 +91,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
void syncWinBollClientThreadStatus() {
|
void syncWinBollClientThreadStatus() {
|
||||||
mWinBollClientServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(this);
|
mWinBollClientServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(this);
|
||||||
mIsEnableService = mWinBollClientServiceBean.isEnable();
|
mIsEnableService = mWinBollClientServiceBean.isEnable();
|
||||||
|
LogUtils.d(TAG, String.format("mIsEnableService %s", mIsEnableService));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
class WinBollClientThread extends Thread {
|
class WinBollClientThread extends Thread {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//ToastUtils.show("WinBollClientThread");
|
ToastUtils.show("WinBollClientThread");
|
||||||
super.run();
|
super.run();
|
||||||
syncWinBollClientThreadStatus();
|
syncWinBollClientThreadStatus();
|
||||||
if (mIsEnableService) {
|
if (mIsEnableService) {
|
||||||
@ -165,38 +166,40 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
|
|
||||||
LogUtils.d(TAG, "WinBollClientThread run()");
|
LogUtils.d(TAG, "WinBollClientThread run()");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 唤醒守护进程
|
// 唤醒守护进程
|
||||||
//wakeupAndBindAssistant();
|
//wakeupAndBindAssistant();
|
||||||
String username = "";
|
// String username = "";
|
||||||
String password = "";
|
// String password = "";
|
||||||
String targetUrl= "";
|
// String targetUrl= "";
|
||||||
|
//
|
||||||
if (GlobalApplication.isDebuging()) {
|
// if (GlobalApplication.isDebuging()) {
|
||||||
username = PrefUtils.getString(WinBollClientService.this, "metDevUserName", "");
|
// username = PrefUtils.getString(WinBollClientService.this, "metDevUserName", "");
|
||||||
password = PrefUtils.getString(WinBollClientService.this, "metDevUserPassword", "");
|
// password = PrefUtils.getString(WinBollClientService.this, "metDevUserPassword", "");
|
||||||
} else {
|
// } else {
|
||||||
username = "WinBoll";
|
// username = "WinBoll";
|
||||||
password = "WinBollPowerByZhanGSKen";
|
// password = "WinBollPowerByZhanGSKen";
|
||||||
}
|
// }
|
||||||
targetUrl = "https://" + (GlobalApplication.isDebuging() ?"dev.winboll": "winboll") + ".cc/api/"; // 替换为实际测试的URL
|
// targetUrl = "https://" + (GlobalApplication.isDebuging() ?"dev.winboll": "winboll") + ".cc/api/"; // 替换为实际测试的URL
|
||||||
|
//
|
||||||
while (mIsEnableService) {
|
while (mIsEnableService) {
|
||||||
// 显示运行状态
|
// 显示运行状态
|
||||||
LogUtils.d(TAG, String.format("targetUrl %s", targetUrl));
|
//LogUtils.d(TAG, String.format("targetUrl %s", targetUrl));
|
||||||
|
|
||||||
WinBollServerConnectionTestThread testThread = new WinBollServerConnectionTestThread(
|
// WinBollServerConnectionTestThread testThread = new WinBollServerConnectionTestThread(
|
||||||
targetUrl,
|
// targetUrl,
|
||||||
username,
|
// username,
|
||||||
password,
|
// password,
|
||||||
15000, // 连接超时15秒
|
// 15000, // 连接超时15秒
|
||||||
20000, // 读取超时20秒
|
// 20000, // 读取超时20秒
|
||||||
3 // 最大重试次数
|
// 3 // 最大重试次数
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
testThread.start();
|
// testThread.start();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(60 * 1000);
|
Thread.sleep(5 * 1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,21 @@ import android.view.View;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import cc.winboll.studio.libaes.winboll.WinBollClientService;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
import cc.winboll.studio.libapputils.R;
|
import cc.winboll.studio.libapputils.R;
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import okhttp3.Authenticator;
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Credentials;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import okhttp3.Route;
|
||||||
//import okhttp3.Authenticator;
|
//import okhttp3.Authenticator;
|
||||||
//import okhttp3.Credentials;
|
//import okhttp3.Credentials;
|
||||||
//import okhttp3.OkHttpClient;
|
//import okhttp3.OkHttpClient;
|
||||||
@ -110,22 +122,24 @@ public class WinBollServiceStatusView extends LinearLayout {
|
|||||||
mConnectionStatus = getConnectionStatus();
|
mConnectionStatus = getConnectionStatus();
|
||||||
//mIsConnected = false;
|
//mIsConnected = false;
|
||||||
//mWinBollServerHostConnectionStatus = WinBollServerHostConnectionStatus.DISCONNECTED;
|
//mWinBollServerHostConnectionStatus = WinBollServerHostConnectionStatus.DISCONNECTED;
|
||||||
//ToastUtils.show("initView()");
|
ToastUtils.show("initView()");
|
||||||
|
|
||||||
mViewOnClickListener = new View.OnClickListener(){
|
mViewOnClickListener = new View.OnClickListener(){
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
//ToastUtils.show("onClick()");
|
LogUtils.d(TAG, "onClick()");
|
||||||
//ToastUtils.show("mWinBollServerHostConnectionStatus : " + mWinBollServerHostConnectionStatus);
|
|
||||||
//isConnected = !isConnected;
|
|
||||||
if (mConnectionStatus == ConnectionStatus.CONNECTED) {
|
if (mConnectionStatus == ConnectionStatus.CONNECTED) {
|
||||||
ToastUtils.show("Click to stop service.");
|
LogUtils.d(TAG, "Click to stop service.");
|
||||||
WinBollClientServiceBean bean = WinBollClientServiceBean.loadWinBollClientServiceBean(mContext);
|
WinBollClientServiceBean bean = WinBollClientServiceBean.loadWinBollClientServiceBean(mContext);
|
||||||
bean.setIsEnable(false);
|
bean.setIsEnable(false);
|
||||||
WinBollClientServiceBean.saveBean(mContext, bean);
|
WinBollClientServiceBean.saveBean(mContext, bean);
|
||||||
Intent intent = new Intent(mContext, WinBollClientService.class);
|
Intent intent = new Intent(mContext, WinBollClientService.class);
|
||||||
mContext.stopService(intent);
|
mContext.stopService(intent);
|
||||||
|
stopConnectionThread();
|
||||||
|
mTextView.setText("");
|
||||||
|
setImageViewByConnection(mImageView, false);
|
||||||
mConnectionStatus = ConnectionStatus.DISCONNECTED;
|
mConnectionStatus = ConnectionStatus.DISCONNECTED;
|
||||||
|
//mConnectionStatus = ConnectionStatus.DISCONNECTED;
|
||||||
//
|
//
|
||||||
/*//ToastUtils.show("CONNECTED");
|
/*//ToastUtils.show("CONNECTED");
|
||||||
setConnectionStatusView(false);
|
setConnectionStatusView(false);
|
||||||
@ -137,25 +151,13 @@ public class WinBollServiceStatusView extends LinearLayout {
|
|||||||
ToastUtils.show("WinBoll Server Disconnected.");
|
ToastUtils.show("WinBoll Server Disconnected.");
|
||||||
}*/
|
}*/
|
||||||
} else if (mConnectionStatus == ConnectionStatus.DISCONNECTED) {
|
} else if (mConnectionStatus == ConnectionStatus.DISCONNECTED) {
|
||||||
ToastUtils.show("Click to start service.");
|
LogUtils.d(TAG, "Click to start service.");
|
||||||
WinBollClientServiceBean bean = WinBollClientServiceBean.loadWinBollClientServiceBean(mContext);
|
WinBollClientServiceBean bean = WinBollClientServiceBean.loadWinBollClientServiceBean(mContext);
|
||||||
bean.setIsEnable(true);
|
bean.setIsEnable(true);
|
||||||
WinBollClientServiceBean.saveBean(mContext, bean);
|
WinBollClientServiceBean.saveBean(mContext, bean);
|
||||||
Intent intent = new Intent(mContext, WinBollClientService.class);
|
Intent intent = new Intent(mContext, WinBollClientService.class);
|
||||||
mContext.startService(intent);
|
mContext.startService(intent);
|
||||||
mConnectionStatus = ConnectionStatus.CONNECTED;
|
startConnectionThread();
|
||||||
ToastUtils.show("startService");
|
|
||||||
/*//ToastUtils.show("DISCONNECTED");
|
|
||||||
setConnectionStatusView(true);
|
|
||||||
|
|
||||||
if (mConnectionThread == null) {
|
|
||||||
ToastUtils.show("mConnectionThread == null");
|
|
||||||
mConnectionThread = new ConnectionThread();
|
|
||||||
mWinBollServerHostConnectionStatus = WinBollServerHostConnectionStatus.START_CONNECT;
|
|
||||||
mConnectionThread.start();
|
|
||||||
}*/
|
|
||||||
} else {
|
|
||||||
ToastUtils.show("Other Click condition.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (isConnected) {
|
/*if (isConnected) {
|
||||||
@ -210,54 +212,99 @@ public class WinBollServiceStatusView extends LinearLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void requestWithBasicAuth(WinBollServiceViewHandler textViewHandler, String targetUrl, final String username, final String password) {
|
void requestWithBasicAuth(final WinBollServiceViewHandler textViewHandler, String targetUrl, final String username, final String password) {
|
||||||
// 用户名和密码,替换为实际的认证信息
|
// 用户名和密码,替换为实际的认证信息
|
||||||
//String username = "your_username";
|
//String username = "your_username";
|
||||||
//String password = "your_password";
|
//String password = "your_password";
|
||||||
|
LogUtils.d(TAG, "requestWithBasicAuth(...)");
|
||||||
|
LogUtils.d(TAG, String.format("targetUrl %s", targetUrl));
|
||||||
|
|
||||||
// OkHttpClient client = new OkHttpClient.Builder()
|
OkHttpClient client = new OkHttpClient.Builder()
|
||||||
// .authenticator(new Authenticator() {
|
.authenticator(new Authenticator() {
|
||||||
// @Override
|
@Override
|
||||||
// public Request authenticate(Route route, Response response) throws IOException {
|
public Request authenticate(Route route, Response response) throws IOException {
|
||||||
// String credential = Credentials.basic(username, password);
|
String credential = Credentials.basic(username, password);
|
||||||
// return response.request().newBuilder()
|
return response.request().newBuilder()
|
||||||
// .header("Authorization", credential)
|
.header("Authorization", credential)
|
||||||
// .build();
|
.build();
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
// .build();
|
.build();
|
||||||
|
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(targetUrl) // 替换为实际要请求的网页地址
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
//Response response = client.newCall(request).execute();
|
||||||
|
|
||||||
|
Call call = client.newCall(request);
|
||||||
|
call.enqueue(new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
// 处理网络请求失败
|
||||||
|
setImageViewByConnection(mImageView, false);
|
||||||
|
textViewHandler.postMessageText(e.getMessage());
|
||||||
|
textViewHandler.postMessageConnectionStatus(false);
|
||||||
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
|
//String sz = "请求失败,状态码: " + response.code();
|
||||||
|
//setImageViewByConnection(mImageView, false);
|
||||||
|
//LogUtils.d(TAG, sz);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
setImageViewByConnection(mImageView, false);
|
||||||
|
textViewHandler.postMessageText("Unexpected code " + response);
|
||||||
|
textViewHandler.postMessageConnectionStatus(false);
|
||||||
|
LogUtils.d(TAG, "Unexpected code " + response, Thread.currentThread().getStackTrace());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 读取响应体作为字符串,注意这里可能需要解码
|
||||||
|
String text = response.body().string();
|
||||||
|
LogUtils.d(TAG, "Develop Host Connection IP is : " + text);
|
||||||
|
mConnectionStatus = ConnectionStatus.CONNECTED;
|
||||||
|
// 获取当前时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 定义时间格式
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
|
||||||
|
// 按照指定格式格式化时间并输出
|
||||||
|
String formattedDateTime = now.format(formatter);
|
||||||
|
textViewHandler.postMessageText("ClientIP<" + formattedDateTime + ">: " + text);
|
||||||
|
textViewHandler.postMessageConnectionStatus(true);
|
||||||
|
|
||||||
|
//org.jsoup.nodes.Document doc = org.jsoup.Jsoup.parse(text);
|
||||||
|
//LogUtils.d(TAG, doc.text());
|
||||||
|
|
||||||
|
// 使用id选择器找到具有特定id的元素
|
||||||
|
//org.jsoup.nodes.Element elementWithId = doc.select("#LastRelease").first(); // 获取第一个匹配的元素
|
||||||
|
|
||||||
|
// 提取并打印元素的文本内容
|
||||||
|
//mszNewestAppPackageName = elementWithId.text();
|
||||||
|
//ToastUtils.delayedShow(text + "\n" + mszNewestAppPackageName, 5000);
|
||||||
|
|
||||||
|
//mHandler.sendMessage(mHandler.obtainMessage(MSG_APPUPDATE_CHECKED));
|
||||||
|
//System.out.println(response.body().string());
|
||||||
|
// mConnectionStatus = ConnectionStatus.CONNECTED;
|
||||||
|
// // 获取当前时间
|
||||||
|
// LocalDateTime now = LocalDateTime.now();
|
||||||
//
|
//
|
||||||
// Request request = new Request.Builder()
|
// // 定义时间格式
|
||||||
// .url(targetUrl) // 替换为实际要请求的网页地址
|
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
|
||||||
// .build();
|
// // 按照指定格式格式化时间并输出
|
||||||
//
|
// String formattedDateTime = now.format(formatter);
|
||||||
// try {
|
// //System.out.println(formattedDateTime);
|
||||||
// Response response = client.newCall(request).execute();
|
// textViewHandler.postMessageText("ClientIP<" + formattedDateTime + ">: " + response.body().string());
|
||||||
// if (response.isSuccessful()) {
|
// textViewHandler.postMessageConnectionStatus(true);
|
||||||
// //System.out.println(response.body().string());
|
} catch (Exception e) {
|
||||||
// //ToastUtils.show("Develop Host Connection IP is : " + response.body().string());
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
// // 获取当前时间
|
}
|
||||||
// LocalDateTime now = LocalDateTime.now();
|
}
|
||||||
//
|
});
|
||||||
// // 定义时间格式
|
|
||||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
|
|
||||||
// // 按照指定格式格式化时间并输出
|
|
||||||
// String formattedDateTime = now.format(formatter);
|
|
||||||
// //System.out.println(formattedDateTime);
|
|
||||||
// textViewHandler.postMessageText("ClientIP<" + formattedDateTime + ">: " + response.body().string());
|
|
||||||
// textViewHandler.postMessageConnectionStatus(true);
|
|
||||||
// } else {
|
|
||||||
// String sz = "请求失败,状态码: " + response.code();
|
|
||||||
// setImageViewByConnection(mImageView, false);
|
|
||||||
// textViewHandler.postMessageText(sz);
|
|
||||||
// textViewHandler.postMessageConnectionStatus(false);
|
|
||||||
// LogUtils.d(TAG, sz);
|
|
||||||
// }
|
|
||||||
// } catch (IOException e) {
|
|
||||||
// textViewHandler.postMessageText(e.getMessage());
|
|
||||||
// textViewHandler.postMessageConnectionStatus(false);
|
|
||||||
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class WinBollServiceViewHandler extends Handler {
|
class WinBollServiceViewHandler extends Handler {
|
||||||
@ -293,6 +340,34 @@ public class WinBollServiceStatusView extends LinearLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startConnectionThread() {
|
||||||
|
if (mConnectionStatus == ConnectionStatus.DISCONNECTED) {
|
||||||
|
mConnectionStatus = ConnectionStatus.START_CONNECT;
|
||||||
|
LogUtils.d(TAG, "startConnectionThread");
|
||||||
|
if (mConnectionThread != null) {
|
||||||
|
mConnectionThread.mIsExist = true;
|
||||||
|
}
|
||||||
|
mConnectionThread = new ConnectionThread();
|
||||||
|
mConnectionThread.start();
|
||||||
|
} else if (mConnectionStatus == ConnectionStatus.CONNECTING) {
|
||||||
|
LogUtils.d(TAG, "mConnectionStatus == ConnectionStatus.CONNECTING");
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, "Unknow mConnectionStatus, can not start ConnectionThread.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopConnectionThread() {
|
||||||
|
if (mConnectionStatus == ConnectionStatus.CONNECTED) {
|
||||||
|
LogUtils.d(TAG, "stopConnectionThread");
|
||||||
|
if (mConnectionThread != null) {
|
||||||
|
mConnectionThread.mIsExist = true;
|
||||||
|
mConnectionThread = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, "Unknow mConnectionStatus, can not start ConnectionThread.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ConnectionThread extends Thread {
|
class ConnectionThread extends Thread {
|
||||||
|
|
||||||
public volatile boolean mIsExist;
|
public volatile boolean mIsExist;
|
||||||
@ -312,13 +387,20 @@ public class WinBollServiceStatusView extends LinearLayout {
|
|||||||
while (mIsExist == false) {
|
while (mIsExist == false) {
|
||||||
if (mConnectionStatus == ConnectionStatus.START_CONNECT) {
|
if (mConnectionStatus == ConnectionStatus.START_CONNECT) {
|
||||||
mConnectionStatus = ConnectionStatus.CONNECTING;
|
mConnectionStatus = ConnectionStatus.CONNECTING;
|
||||||
ToastUtils.show("WinBoll Server Connection Start.");
|
//ToastUtils.show("WinBoll Server Connection Start.");
|
||||||
//LogUtils.d(TAG, "Develop Host Connection Start.");
|
|
||||||
String targetUrl = "https://" + mszServerHost + "/cip/?simple=true"; // 这里替换成你实际要访问的网址
|
//String targetUrl = "https://" + (GlobalApplication.isDebuging() ?"dev.winboll": "winboll") + ".cc/api/"; // 替换为实际测试的URL
|
||||||
|
//String targetUrl = "https://" + mszServerHost + "/api/"; // 这里替换成你实际要访问的网址
|
||||||
|
|
||||||
|
String targetUrl = mszServerHost + "/cip/?simple=true"; // 这里替换成你实际要访问的网址
|
||||||
|
LogUtils.d(TAG, String.format("Connection Start. targetUrl %s", targetUrl));
|
||||||
requestWithBasicAuth(mWinBollServiceViewHandler, targetUrl, _mUserName, _mPassword);
|
requestWithBasicAuth(mWinBollServiceViewHandler, targetUrl, _mUserName, _mPassword);
|
||||||
} else if (mConnectionStatus == ConnectionStatus.CONNECTED
|
} else if (mConnectionStatus == ConnectionStatus.CONNECTED
|
||||||
&& mConnectionStatus == ConnectionStatus.DISCONNECTED) {
|
|| mConnectionStatus == ConnectionStatus.DISCONNECTED) {
|
||||||
ToastUtils.show("mWinBollServerHostConnectionStatus " + mConnectionStatus);
|
//ToastUtils.show("mWinBollServerHostConnectionStatus " + mConnectionStatus);
|
||||||
|
LogUtils.d(TAG, String.format("mConnectionStatus done %s", mConnectionStatus));
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, String.format("mConnectionStatus unknow %s", mConnectionStatus));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user