android需要多客户端之间通信,后台是javaweb项目,怎么加进去socekt呢?
我在web.xml里添加了listener监听,但项目就留运行不起来了,那如何实现使用socket完成需求呢,或者说怎么将socket加入到javaweb后台项目中...
我在web.xml里添加了listener监听,但项目就留运行不起来了,那如何实现使用socket完成需求呢,或者说怎么将socket加入到javaweb后台项目中
展开
1个回答
展开全部
android studio端
package com.example.z_t.mytest3;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.IOException;
import java.io.StringReader;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class FirstActivity extends AppCompatActivity {
private EditText username;
private EditText password;
private String uname;
private String pwd;
private String result;
private String re;
private boolean res;
package com.example.z_t.mytest3;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.IOException;
import java.io.StringReader;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class FirstActivity extends AppCompatActivity {
private EditText username;
private EditText password;
private String uname;
private String pwd;
private String result;
private String re;
private boolean res;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询