Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Widget
Project
Project
Details
Activity
Releases
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
Android Widget
Widget
Commits
5310ed4d
Commit
5310ed4d
authored
Dec 21, 2021
by
张圣龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
63bb8567
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
MsgWebSocketIOTUtil.kt
...ain/java/com/zhimai/websocket/util/MsgWebSocketIOTUtil.kt
+10
-0
NetWorkUtils.java
...src/main/java/com/zhimai/websocket/util/NetWorkUtils.java
+4
-5
No files found.
websocket/src/main/java/com/zhimai/websocket/util/MsgWebSocketIOTUtil.kt
0 → 100644
View file @
5310ed4d
package
com.zhimai.websocket.util
/**
* Explain:IOT socket
* Created on 2021/12/21.
* @author zhangshenglong
* 第一版只做socket ping,用于设备监听
*/
class
MsgWebSocketIOTUtil
{
}
\ No newline at end of file
websocket/src/main/java/com/zhimai/websocket/util/NetWorkUtils.java
View file @
5310ed4d
...
@@ -16,12 +16,11 @@ public class NetWorkUtils {
...
@@ -16,12 +16,11 @@ public class NetWorkUtils {
if
(
cm
==
null
)
{
if
(
cm
==
null
)
{
return
false
;
return
false
;
}
}
NetworkInfo
networkInfo
=
cm
.
getActiveNetworkInfo
();
try
{
if
(
networkInfo
!=
null
)
{
return
cm
.
getActiveNetworkInfo
().
isAvailable
();
return
networkInfo
.
isAvailable
();
}
catch
(
Exception
e
){
return
false
;
}
}
return
false
;
}
}
public
static
boolean
isOffline
(
Context
context
)
{
public
static
boolean
isOffline
(
Context
context
)
{
...
...
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