Compare commits
21 Commits
18f7e176f2
...
69e9e55aac
Author | SHA1 | Date |
---|---|---|
Xie Changrong | 69e9e55aac | 3 years ago |
Xie Changrong | d1f1936b09 | 3 years ago |
Xie Changrong | 7889a9e970 | 3 years ago |
Xie Changrong | fe9633f168 | 3 years ago |
Xie Changrong | 515900cd21 | 3 years ago |
meickrq7f | 907367270c | 3 years ago |
Li Tianhong | a8f0156c52 | 3 years ago |
meickrq7f | 78e75ccd7b | 3 years ago |
HuaTao | 6a708f9eb5 | 3 years ago |
Xie Changrong | 31287ba213 | 3 years ago |
Xie Changrong | c9b91966e7 | 3 years ago |
Xie Changrong | 1bee5f4b6d | 3 years ago |
Xie Changrong | 6d497797da | 3 years ago |
FanYiWe | 432db2dbd9 | 3 years ago |
FanYiWe | 999025cef6 | 3 years ago |
FanYiWe | f710a75090 | 3 years ago |
meickrq7f | 3b1e54fea7 | 3 years ago |
XCR | dde3be2d62 | 3 years ago |
meickrq7f | 1061e38ead | 3 years ago |
XCR | 9f18899626 | 3 years ago |
pyxu2pz5g | 13c0def691 | 3 years ago |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 9.0 KiB |
@ -0,0 +1,20 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.example.logistics",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" type="text/javascript">
|
||||
|
||||
function callJS(){
|
||||
var ros = new ROSLIB.Ros({
|
||||
url : 'ws://192.168.43.20:9090'
|
||||
});
|
||||
|
||||
ros.on('connection', function() {
|
||||
console.log('Connected to websocket server.');
|
||||
});
|
||||
|
||||
ros.on('error', function(error) {
|
||||
console.log('Error connecting to websocket server: ', error);
|
||||
});
|
||||
|
||||
ros.on('close', function() {
|
||||
console.log('Connection to websocket server closed.');
|
||||
});
|
||||
|
||||
// 发布一个话题
|
||||
|
||||
|
||||
|
||||
var move_base= new ROSLIB.ActionClient({
|
||||
ros : ros,
|
||||
serverName : '/move_base',
|
||||
actionName : 'move_base_msgs/MoveBaseAction'
|
||||
});
|
||||
|
||||
var currentTime = new Date();
|
||||
var secs = Math.floor(currentTime.getTime()/1000)
|
||||
var nsecs = Math.round(1000000000*(currentTime.getTime()/1000-secs))
|
||||
|
||||
var goal = new ROSLIB.Goal({
|
||||
actionClient: move_base,
|
||||
goalMessage:{
|
||||
target_pose:{
|
||||
header:{
|
||||
frame_id:'map',
|
||||
stamp:{
|
||||
secs: secs,
|
||||
nsecs:nsecs
|
||||
}
|
||||
},
|
||||
pose:{
|
||||
position:{
|
||||
x:-3.97, //-0.743 -0.0273 取件点
|
||||
y:1.68, //3.00 -0.09
|
||||
z:0.000
|
||||
},
|
||||
orientation:{
|
||||
x:0.000,
|
||||
y:0.000,
|
||||
z:0.000,
|
||||
w:1.000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
goal.on('feedback', function(feedback) {
|
||||
console.log('Feedback: ' + feedback.sequence);
|
||||
});
|
||||
|
||||
goal.on('result', function(result) {
|
||||
console.log('Final Result: ' + result.sequence);
|
||||
});
|
||||
|
||||
ros.on('connection', function() {
|
||||
console.log('Connected to websocket server.');
|
||||
});
|
||||
|
||||
ros.on('error', function(error) {
|
||||
console.log('Error connecting to websocket server: ', error);
|
||||
});
|
||||
|
||||
ros.on('close', function() {
|
||||
console.log('Connection to websocket server closed.');
|
||||
});
|
||||
|
||||
//goal.send();
|
||||
|
||||
var cmdVel = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/cmd_vel',
|
||||
messageType : 'geometry_msgs/Twist'
|
||||
});
|
||||
|
||||
var twist = new ROSLIB.Message({
|
||||
linear : {
|
||||
x : 0.2,
|
||||
y : 0.0,
|
||||
z : 0.0
|
||||
},
|
||||
angular : {
|
||||
x : 0.0,
|
||||
y : 0.0,
|
||||
z : 0.0
|
||||
}
|
||||
});
|
||||
cmdVel.publish(twist);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Simple roslib Example</h1>
|
||||
<p>Check your Web Console for output.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,86 +0,0 @@
|
||||
package com.example.logistics.dao;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.logistics.tools.DBOpenHelper;
|
||||
import com.example.logistics.tools.MD5Utils;
|
||||
import com.example.logistics.ui.MainActivity;
|
||||
import com.example.logistics.ui.MenuActivity;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class goodDao {
|
||||
|
||||
private static final String TAG = "goodDao";
|
||||
|
||||
public int search(String id, String phonenum, Context context){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
|
||||
int msg = 0;
|
||||
try{
|
||||
String sql = "select * from goods where id = ?";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
if(ps != null){
|
||||
Log.e(TAG, "id: " + id);
|
||||
ps.setInt(1,Integer.parseInt(id));
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
int count = rs.getMetaData().getColumnCount();
|
||||
while(rs.next()){
|
||||
for(int i = 1; i <= count; i++){
|
||||
String field = rs.getMetaData().getColumnName(i);
|
||||
map.put(field, rs.getString(field));
|
||||
}
|
||||
}
|
||||
connection.close();
|
||||
ps.close();
|
||||
if(map.size() != 0){
|
||||
StringBuilder s = new StringBuilder();
|
||||
for(String key:map.keySet()){
|
||||
if(key.equals("phonenum")){
|
||||
String strphone = String.valueOf(map.get(key));
|
||||
Log.d("abc", strphone);
|
||||
if(phonenum.equals(strphone.substring(7,11))){
|
||||
msg = 1; //phonenum correct
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle("快件位置");
|
||||
builder.setMessage("\n第 "+ map.get("shelfnum")+ " 号货架\n第 " + map.get("floornum")+ " 层");
|
||||
Looper.prepare();
|
||||
builder.show();
|
||||
Looper.loop();
|
||||
}else{
|
||||
msg = 2; //phonenum incorrect
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "result is null");
|
||||
msg = 3; //result is null
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "ps is null");
|
||||
msg = 0;
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "connection is null");
|
||||
msg = 0;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Log.d(TAG, "search bug: " + e.getMessage());
|
||||
msg = 0;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package com.example.logistics.dao;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.logistics.entity.User;
|
||||
import com.example.logistics.tools.DBOpenHelper;
|
||||
import com.example.logistics.tools.MD5Utils;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class operationDao {
|
||||
private static final String TAG = "operationDao";
|
||||
|
||||
public boolean add(String pickupcode, String phonenum){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
try{
|
||||
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
||||
|
||||
Date date = new Date();
|
||||
|
||||
String time = format1.format(date);
|
||||
|
||||
String sql = "insert into operations(pickupcode, phonenum, time) values (?,?,?)";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
|
||||
if(ps != null){
|
||||
ps.setString(1, pickupcode);
|
||||
ps.setString(2, phonenum);
|
||||
ps.setString(3, time);
|
||||
|
||||
int rs = ps.executeUpdate();
|
||||
if(rs > 0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "异常 add operation");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
package com.example.logistics.manager;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.logistics.tools.DBOpenHelper;
|
||||
import com.example.logistics.tools.MD5Utils;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class goodManager {
|
||||
|
||||
private static final String TAG = "goodDao";
|
||||
|
||||
public int search(String id, String phonenum, Context context){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
|
||||
|
||||
int msg = 0;
|
||||
try{
|
||||
String sql = "select * from goods where id = ?";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
if(ps != null){
|
||||
Log.e(TAG, "id: " + id);
|
||||
ps.setInt(1,Integer.parseInt(id));
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
int count = rs.getMetaData().getColumnCount();
|
||||
while(rs.next()){
|
||||
for(int i = 1; i <= count; i++){
|
||||
String field = rs.getMetaData().getColumnName(i);
|
||||
map.put(field, rs.getString(field));
|
||||
}
|
||||
}
|
||||
connection.close();
|
||||
ps.close();
|
||||
if(map.size() != 0){
|
||||
StringBuilder s = new StringBuilder();
|
||||
for(String key:map.keySet()){
|
||||
if(key.equals("phonenum")){
|
||||
String strphone = String.valueOf(map.get(key));
|
||||
Log.d("abc", strphone);
|
||||
if(phonenum.equals(strphone.substring(7,11))){
|
||||
msg = 1; //phonenum correct
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle("快件位置");
|
||||
builder.setMessage("\n第 "+ map.get("shelfnum")+ " 号货架\n第 " + map.get("floornum")+ " 层");
|
||||
Looper.prepare();
|
||||
builder.show();
|
||||
Looper.loop();
|
||||
}else{
|
||||
msg = 2; //phonenum incorrect
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "result is null");
|
||||
msg = 3; //result is null
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "ps is null");
|
||||
msg = 0;
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "connection is null");
|
||||
msg = 0;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Log.d(TAG, "search bug: " + e.getMessage());
|
||||
msg = 0;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public boolean delete(String pickupcode){
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
try{
|
||||
String sql = "delete from goods where id = ?";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
if(ps != null){
|
||||
Log.e(TAG, "pickupcode: " + pickupcode);
|
||||
ps.setString(1,pickupcode);
|
||||
|
||||
ps.executeUpdate();
|
||||
|
||||
connection.close();
|
||||
ps.close();
|
||||
return true;
|
||||
}else{
|
||||
Log.e(TAG, "ps is null");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "connection is null");
|
||||
return false;
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
Log.d(TAG, "delete bug" + e.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> nopick(String phonenum){
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
|
||||
List<Map<String, Object>> datalist;
|
||||
datalist = new ArrayList<Map<String, Object>>();
|
||||
try{
|
||||
String sql = "select * from goods where phonenum = ?";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
if(ps != null){
|
||||
Log.e(TAG, "phonenum: " + phonenum);
|
||||
ps.setString(1,phonenum);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
int count = rs.getMetaData().getColumnCount();
|
||||
while(rs.next()){
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
for(int i = 1; i <= count; i++){
|
||||
String field = rs.getMetaData().getColumnName(i);
|
||||
if(field.equals("id")){
|
||||
map.put(field, rs.getString(field));
|
||||
}
|
||||
if(field.equals("time")) {
|
||||
map.put(field, rs.getString(field));
|
||||
}
|
||||
}
|
||||
datalist.add(map);
|
||||
}
|
||||
connection.close();
|
||||
ps.close();
|
||||
}else{
|
||||
Log.e(TAG, "ps is null");
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "connection is null");
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Log.d(TAG, "search bug: " + e.getMessage());
|
||||
}
|
||||
return datalist;
|
||||
}
|
||||
|
||||
public int pickup(String pickupcode, String phonenum){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
|
||||
int msg = 0;
|
||||
try{
|
||||
String sql = "select * from goods where id=?";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
if(ps != null){
|
||||
Log.e(TAG, "pickupcode: " + pickupcode);
|
||||
ps.setInt(1,Integer.parseInt(pickupcode));
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
int count = rs.getMetaData().getColumnCount();
|
||||
while(rs.next()){
|
||||
for(int i = 1; i <= count; i++){
|
||||
String field = rs.getMetaData().getColumnName(i);
|
||||
map.put(field, rs.getString(field));
|
||||
}
|
||||
}
|
||||
connection.close();
|
||||
ps.close();
|
||||
if(map.size() != 0){
|
||||
StringBuilder s = new StringBuilder();
|
||||
for(String key:map.keySet()){
|
||||
if(key.equals("phonenum")){
|
||||
if(phonenum.equals(map.get(key).toString().substring(7,11))){
|
||||
msg = 1; //password correct
|
||||
}else{
|
||||
msg = 2; //password incorrect
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "result is null");
|
||||
msg = 3; //result is null
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "ps is null");
|
||||
msg = 0;
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "connection is null");
|
||||
msg = 0;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Log.d(TAG, "login bug: " + e.getMessage());
|
||||
msg = 0;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.example.logistics.manager;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.logistics.tools.DBOpenHelper;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class operationManager {
|
||||
private static final String TAG = "operationDao";
|
||||
|
||||
public boolean add(String pickupcode, String phonenum){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
try{
|
||||
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
||||
|
||||
Date date = new Date();
|
||||
|
||||
String time = format1.format(date);
|
||||
|
||||
String sql = "insert into operations(pickupcode, phonenum, time) values (?,?,?)";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
|
||||
if(ps != null){
|
||||
ps.setString(1, pickupcode);
|
||||
ps.setString(2, phonenum);
|
||||
ps.setString(3, time);
|
||||
|
||||
int rs = ps.executeUpdate();
|
||||
if(rs > 0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "异常 add operation");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> history(String phonenum){
|
||||
|
||||
Connection connection = DBOpenHelper.getConn();
|
||||
|
||||
List<Map<String, Object>> datalist;
|
||||
datalist = new ArrayList<Map<String, Object>>();
|
||||
try{
|
||||
String sql = "select * from operations where phonenum = ?";
|
||||
|
||||
if(connection != null){
|
||||
PreparedStatement ps = connection.prepareStatement(sql);
|
||||
if(ps != null){
|
||||
Log.e(TAG, "phonenum: " + phonenum);
|
||||
ps.setString(1,phonenum);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
int count = rs.getMetaData().getColumnCount();
|
||||
while(rs.next()){
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
for(int i = 1; i <= count; i++){
|
||||
String field = rs.getMetaData().getColumnName(i);
|
||||
if(field.equals("pickupcode")){
|
||||
map.put(field, rs.getString(field));
|
||||
}
|
||||
if(field.equals("time")) {
|
||||
map.put(field, rs.getString(field));
|
||||
}
|
||||
}
|
||||
datalist.add(map);
|
||||
}
|
||||
connection.close();
|
||||
ps.close();
|
||||
}else{
|
||||
Log.e(TAG, "ps is null");
|
||||
}
|
||||
}else{
|
||||
Log.e(TAG, "connection is null");
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Log.d(TAG, "search bug: " + e.getMessage());
|
||||
}
|
||||
return datalist;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.example.logistics.tools;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.drafts.Draft_6455;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
public class JWebSocketClient extends WebSocketClient {
|
||||
public JWebSocketClient(URI serverUri) {
|
||||
super(serverUri, new Draft_6455());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen(ServerHandshake handshakedata) {
|
||||
Log.e("JWebSocketClient", "onOpen()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String message) {
|
||||
Log.e("JWebSocketClient", "onMessage()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(int code, String reason, boolean remote) {
|
||||
Log.e("JWebSocketClient", "onClose()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
Log.e("JWebSocketClient", "onError()");
|
||||
}
|
||||
}
|