我的应用程序没有连接到Java Servlet

时间:2018-06-02 10:14:55

标签: java android

我正在制作Android应用程序并尝试连接到java servlet以用作后端,但它无法正常工作。当我按下logIn按钮时,它显示错误的密码。它没有连接到java servlet并从db检查密码。 Java项目部署在Tomcat上。

这是Android Activity的代码,LoginActivity.java

import android.content.Intent;

import android.os.AsyncTask;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class LoginActivity extends AppCompatActivity {

    // UI references
    private EditText emailEditText;
    private EditText passwordEditText;
    //private Button loginButton;

    private UserLoginTask mAuthTask = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        emailEditText = (EditText) findViewById(R.id.emailEditText);
        passwordEditText = (EditText) findViewById(R.id.passwordEditText);
        Log.e("tag", "onCreate: ");
    }

    /**
     * Attempts to sign in or register the account specified by the login form.
     * If there are form errors (invalid email, missing fields, etc.), the
     * errors are presented and no actual login attempt is made.
     */
    public void login(View view) {
        if (mAuthTask != null) {
            return;
        }

        // Reset errors.
        emailEditText.setError(null);
        passwordEditText.setError(null);

        // Store values at the time of the login attempt.
        String email = emailEditText.getText().toString();
        String password = passwordEditText.getText().toString();

        boolean cancel = false;
        View focusView = null;

        // Check for a valid password, if the user entered one.

        // Check for a valid email address.
        if (TextUtils.isEmpty(email)) {
            emailEditText.setError(getString(R.string.email_empty_error));
            focusView = emailEditText;
            cancel = true;
        } else if (!isEmailValid(email)) {
            emailEditText.setError(getString(R.string.email_error));
            focusView = emailEditText;
            cancel = true;
        }

        if (cancel) {
            focusView.requestFocus();
        } else {
            Log.e("tag", "doInBackground: " );
            mAuthTask = new UserLoginTask(email, password);
            mAuthTask.execute((Void) null);
        }
    }

    /**
     * Represents an asynchronous login/registration task used to authenticate
     * the user.
     */
    public class UserLoginTask extends AsyncTask<Void, Void, Boolean> {

        private final String mEmail;
        private final String mPassword;

        UserLoginTask(String email, String password) {

            mEmail = email;
            mPassword = password;
        }

        @Override
        protected Boolean doInBackground(Void... params) {
            // TODO: attempt authentication against a network service.
            Log.e("tag", "doInBackground: " );
            StringBuilder sb = new StringBuilder();
            JSONObject json = null;

            try {

                URL url = new URL("http://10.0.2.2:8080/cart/LoginServletAndroid?email="
                        +mEmail+"&pass="+mPassword);
                // Simulate network access.
                HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
                urlConnection.setRequestMethod("GET");
                urlConnection.setRequestProperty("Accept", "application/json");
                urlConnection.connect();
                Log.e("tag", "doInBackground: " );
                int status = urlConnection.getResponseCode();

                switch (status) {
                    case 200:
                        Log.e("tag", "doInBackground: status 200" );
                        break;
                    case 201:
                        Log.e("tag", "doInBackground: status 201" );
                        BufferedReader br = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));

                        String line;
                        while ((line = br.readLine()) != null) {
                            sb.append(line + "\n");
                        }
                        br.close();
                        json = new JSONObject(sb.toString());
                        if(json.getBoolean("auth"))
                            return true;
                }
            } catch (Exception e) {
                e.printStackTrace();
                return false;
            }
            return false;
        }

        @Override
        protected void onPostExecute(final Boolean success) {
            Log.e("tag", "doInBackground: " );
            mAuthTask = null;
            if (success) {
                Intent intent = new Intent(getApplicationContext(), MovieSearchActivity.class);
                startActivity(intent);
            } else {
                passwordEditText.setError(getString(R.string.password_error));
                passwordEditText.requestFocus();
            }
        }

        @Override
        protected void onCancelled() {
            mAuthTask = null;
        }
    }

    private boolean isEmailValid(String email)
    {
        return email.contains("@");
    }

}

activity_login.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_login"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"

    tools:context="com.example.along.myfablix.LoginActivity"
    android:orientation="vertical">

    <TextView
        android:text="@string/login_page"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:id="@+id/textView"
        android:gravity="center"
        android:layout_gravity="center_horizontal"
        android:textSize="28sp"
        android:textStyle="normal|bold"
        android:textColor="@color/colorPrimary" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textEmailAddress"
        android:ems="10"
        android:id="@+id/emailEditText"
        android:layout_gravity="center_horizontal"
        android:hint="@string/email_text" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPassword"
        android:ems="10"
        android:id="@+id/passwordEditText"
        android:layout_gravity="center_horizontal"
        android:hint="@string/password_text" />

    <Button
        android:text="@string/login_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/loginButton"
        android:gravity="center"
        android:layout_gravity="center_horizontal"
        android:onClick="login" />
</LinearLayout>

这是java servlet,LoginServletAndoid.java:

package Servlet;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.jasypt.util.password.StrongPasswordEncryptor;

import com.google.gson.Gson;

import helper.CartItem;
import helper.Customer;
import helper.LoginResponse;

/**
 * Servlet implementation class LoginServletAndroid
 */
@WebServlet("/LoginServletAndroid")
public class LoginServletAndroid extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#HttpServlet()
     */
    public LoginServletAndroid() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String loginUser = "root";
        String loginPasswd = "root";
        String loginUrl = "jdbc:mysql://localhost:3306/moviedb";
        LoginResponse auth = new  LoginResponse();
        try {

            Class.forName("com.mysql.jdbc.Driver").newInstance();

            Connection connection = DriverManager.getConnection(loginUrl,loginUser,loginPasswd);
            Statement statement = connection.createStatement();

            String email = request.getParameter("email");
            String password = request.getParameter("pass");
            System.out.println(email);
            System.out.println(password);
            String query ="SELECT * from customers where email=?";

            PreparedStatement pst=connection.prepareStatement(query);
            pst.setString(1, email);
            ResultSet result = pst.executeQuery();
            response.setContentType("application/json");
            response.setCharacterEncoding("UTF-8");

            boolean success = false;

            if(result.next()) {
                Customer cust= new Customer();
                HttpSession session = request.getSession();//save user email in session scope
                ArrayList<CartItem> items = new ArrayList<CartItem>();

                cust.setId(result.getInt(1));
                cust.setFname(result.getString(2));
                cust.setLname(result.getString(3));
                cust.setCcid(result.getString(4));
                cust.setAddress(result.getString(5));
                cust.setEmail(result.getString(6));
                cust.setPassword(result.getString(7));

                session.setAttribute("items", items);
                session.setAttribute("email", email);
                session.setAttribute("cust", cust);

                // get the encrypted password from the database
                String encryptedPassword = result.getString("password");
                System.out.println(encryptedPassword);
                // use the same encryptor to compare the user input password with encrypted password stored in DB
                success = new StrongPasswordEncryptor().checkPassword(password, encryptedPassword);
                System.out.println(success);

                if(success) {
                    auth.setAuth(true);
                String json = new Gson().toJson(auth);

                response.getWriter().write(json);
                }
                else
                {
                    auth.setAuth(false);
                    String json = new Gson().toJson(auth);

                    response.getWriter().write(json);
                }
            }
        }
         catch (Exception e) {
            String json = new Gson().toJson(e.getMessage());

            response.getWriter().write(json);
    }







    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}

当我运行应用程序时,这是logcat。

06-02 15:02:00.303 5764-5764/? E/tag: onCreate: 
06-02 15:02:00.309 2061-2061/com.bluestacks.appguidance D/GuidanceScreen..AppLaunchReceiver: same as previous package, returning com.example.along.myfablix
06-02 15:02:00.348 1809-2009/system_process D/ActivityManager: cleanUpApplicationRecord -- 5666
06-02 15:02:00.405 1809-1819/system_process I/art: Background partial concurrent mark sweep GC freed 18144(3MB) AllocSpace objects, 265(5MB) LOS objects, 33% free, 8MB/13MB, paused 1.053ms total 128.891ms
06-02 15:02:00.405 5764-5811/? I/OpenGLRenderer: Initialized EGL, version 1.4
06-02 15:02:00.405 5764-5811/? D/OpenGLRenderer: Swap behavior 1
06-02 15:02:00.405 5764-5811/? I/PGA: PgaSocketInit: opened /dev/bstpgaipc: fd = 45
    Attempting to create new SOCKET connection pid = 5764, tid = 5811
06-02 15:02:00.408 5764-5811/? I/PGA: PgaSocketInitClientPgaIpc: data mapped to 0xaa1c0000
    New SOCKET connection: com.example.along.myfablix (pid 5764, tid 5811)
06-02 15:02:00.424 5779-5805/? D/ApplicationLoaders: ignored Vulkan layer search path /data/priv-downloads/com.google.android.gms/lib/x86:/system/fake-libs:/data/priv-downloads/com.google.android.gms/com.google.android.gms.apk!/lib/x86:/system/lib:/vendor/lib:/data/downloads:/data/priv-downloads for namespace 0xb654e090
06-02 15:02:00.432 5764-5764/? W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
06-02 15:02:00.704 1809-1830/system_process D/WindowManager: topDisplayedActivityInfo, appToken: Token{3662662 ActivityRecord{1d2c12d u0 com.example.along.myfablix/.LoginActivity t21}}
06-02 15:02:00.709 1809-3014/system_process D/InputMethodManagerService: packageName=com.example.along.myfablix, activityName=.LoginActivity
06-02 15:02:00.722 1809-3011/system_process D/InputMethodManagerService: packageName=com.example.along.myfablix, activityName=.LoginActivity
    ime_enabled = true is same as last value, no change
06-02 15:02:00.734 1809-1830/system_process I/ActivityManager: Displayed com.example.along.myfablix/.LoginActivity: +883ms
06-02 15:02:00.753 1907-1907/com.android.inputmethod.latin I/LatinIME: Starting input. Cursor position = -1,-1
06-02 15:02:00.769 1809-1809/system_process D/NotificationService: In writeNotificationInfo: pkgName android
06-02 15:02:00.774 1975-1975/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Service: startService called with arg: notification
    New Notification has been observed, informing frontend now
06-02 15:02:00.789 1907-1907/com.android.inputmethod.latin I/LatinIME: Starting input. Cursor position = 0,0
06-02 15:02:00.789 1809-1809/system_process D/NotificationService: In writeNotificationInfo: pkgName android
06-02 15:02:00.792 1809-1809/system_process D/NotificationService: In writeNotificationInfo: pkgName android
06-02 15:02:00.794 1975-1975/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Service: startService called with arg: notification
    New Notification has been observed, informing frontend now
06-02 15:02:00.810 1975-1975/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Service: startService called with arg: notification
    New Notification has been observed, informing frontend now
06-02 15:02:00.835 2482-2822/com.google.android.gms I/Icing: Indexing 4A5DADA6E9D2F130C1CBECC0FA1E6BDE3BFAF4A4 from com.google.android.gms
06-02 15:02:00.872 2482-2822/com.google.android.gms I/Icing: Indexing done 4A5DADA6E9D2F130C1CBECC0FA1E6BDE3BFAF4A4
06-02 15:02:00.996 1809-3014/system_process W/art: Long monitor contention with owner Binder:1809_4 (2009) at void com.android.server.am.ActivityManagerService.activityStopped(android.os.IBinder, android.os.Bundle, android.os.PersistableBundle, java.lang.CharSequence)(ActivityManagerService.java:7091) waiters=0 in int com.android.server.am.ActivityManagerService.stopService(android.app.IApplicationThread, android.content.Intent, java.lang.String, int) for 122ms
06-02 15:02:04.421 2375-2375/com.google.android.gms.persistent I/WearableService: Wearable Services stopping
06-02 15:02:08.655 1809-2013/system_process I/ActivityManager: Killing 5249:com.android.vending/u0a2 (adj 906): empty #5
06-02 15:02:08.709 2406-2406/? D/appstatsd: inotify event: 00000008
06-02 15:02:08.712 2406-2406/? D/appstatsd: File copied successfully
06-02 15:02:08.713 1809-2009/system_process D/ActivityManager: cleanUpApplicationRecord -- 5249
06-02 15:02:09.117 1975-5822/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-httpd: command: unmuteappplayer
06-02 15:02:09.124 1975-5822/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application: in isSystemReady, isBootCompleted true External storage status: mounted  External storage dir :/storage/emulated/0  isExternalStorageRemovable:false
    returning from waitForSystemReady,  isSystemReady = true
06-02 15:02:09.124 1975-5822/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-httpd: response: {"result":"ok"}
06-02 15:02:09.142 1975-5823/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-httpd: command: runex com.example.along.myfablix/com.example.along.myfablix.LoginActivity
06-02 15:02:09.147 1975-5823/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application: in isSystemReady, isBootCompleted true External storage status: mounted  External storage dir :/storage/emulated/0  isExternalStorageRemovable:false
    returning from waitForSystemReady,  isSystemReady = true
06-02 15:02:09.147 1975-5823/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-CommandHandler: gamemanager compatible mode
    recentTask.size(): 2
06-02 15:02:09.148 1975-5823/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-CommandHandler: pkg found in recent tasks
    moving 21 to front
06-02 15:02:09.150 1975-5823/com.bluestacks.BstCommandProcessor E/Sensor-AccelerometerUI: java.io.IOException: Connection refused
06-02 15:02:09.158 1975-5823/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-CommandHandler: Sending startService intent with data: Intent { act=com.bluestacks.home.svc pkg=com.bluestacks.home }
    Broadcasting START_APP intent with data: {"package":"com.example.along.myfablix","isArmApp":false} isArmApp: false
06-02 15:02:09.158 1975-5823/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-httpd: response: {"result":"ok"}
06-02 15:02:11.068 1809-3343/system_process D/InputMethodManagerService: packageName=com.example.along.myfablix, activityName=.LoginActivity
    ime_enabled = true is same as last value, no change
06-02 15:02:11.077 1809-1809/system_process D/NotificationService: In writeNotificationInfo: pkgName android
06-02 15:02:11.079 1975-1975/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Service: startService called with arg: notification
    New Notification has been observed, informing frontend now
06-02 15:02:12.452 1975-5682/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application: INSTALL_APP event sent to Agent for pkg :com.example.along.myfablixat time :Sat Jun 02 15:02:12 GMT+05:00 2018
06-02 15:02:13.791 1975-5821/com.bluestacks.BstCommandProcessor E/BstCommandProcessor-Application: Error encountered while deleting file
06-02 15:02:15.002 1809-1877/system_process W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-02 15:02:15.007 1809-3011/system_process D/InputMethodManagerService: packageName=com.example.along.myfablix, activityName=.LoginActivity
    ime_enabled = true is same as last value, no change
06-02 15:02:15.010 5764-5764/? W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
06-02 15:02:15.011 1907-1907/com.android.inputmethod.latin I/LatinIME: Starting input. Cursor position = 0,0
06-02 15:02:15.014 1809-1809/system_process D/NotificationService: In writeNotificationInfo: pkgName android
06-02 15:02:15.018 1975-1975/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Service: startService called with arg: notification
    New Notification has been observed, informing frontend now
06-02 15:02:15.206 1542-1570/? I/audio_hw_primary: choose pcmC0D0p for 0
06-02 15:02:17.899 5764-5764/? E/tag: doInBackground: 
06-02 15:02:17.914 5764-5827/? E/tag: doInBackground: 
06-02 15:02:17.925 5764-5827/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
06-02 15:02:17.932 1542-1570/? D/AudioFlinger: mixer(0xa72174c0) throttle end: throttle time(35)
06-02 15:02:18.933 5764-5827/? W/System.err: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:334)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:196)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:356)
        at java.net.Socket.connect(Socket.java:605)
        at com.android.okhttp.internal.Platform.connectSocket(Platform.java:113)
        at com.android.okhttp.Connection.connectSocket(Connection.java:196)
        at com.android.okhttp.Connection.connect(Connection.java:172)
        at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:367)
        at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:130)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:329)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:246)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:457)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:126)
        at com.example.along.myfablix.LoginActivity$UserLoginTask.doInBackground(LoginActivity.java:112)
        at com.example.along.myfablix.LoginActivity$UserLoginTask.doInBackground(LoginActivity.java:86)
        at android.os.AsyncTask$2.call(AsyncTask.java:305)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
06-02 15:02:18.935 5764-5764/? E/tag: doInBackground: 
06-02 15:02:22.801 2375-4730/com.google.android.gms.persistent E/WakeLock: release without a matched acquire!
06-02 15:02:22.804 1809-3011/system_process I/ActivityManager: Killing 5695:com.google.android.partnersetup/u0a1 (adj 906): empty #5
06-02 15:02:22.829 1809-1821/system_process D/ActivityManager: cleanUpApplicationRecord -- 5695
06-02 15:02:24.634 2375-4735/com.google.android.gms.persistent E/WakeLock: release without a matched acquire!
06-02 15:02:24.637 2375-4735/com.google.android.gms.persistent W/GCM: Resetting heartbeat counters (at min), good=0 bad=2
06-02 15:02:24.638 1809-3347/system_process D/ConnectivityService: reportNetworkConnectivity(100, false) by 10000
06-02 15:02:24.638 1809-1887/system_process D/NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: Forcing reevaluation for UID 10000
06-02 15:02:24.645 1809-5829/system_process D/NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_DNS OK 3ms, connectivitycheck.gstatic.com=74.125.200.94
06-02 15:02:24.649 1809-5828/system_process D/NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_DNS OK 7ms, www.google.com=216.58.207.4
06-02 15:02:26.410 1809-5829/system_process D/NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_HTTP http://connectivitycheck.gstatic.com/generate_204 time=1764ms ret=204 headers={null=[HTTP/1.1 204 No Content], Content-Length=[0], Date=[Sat, 02 Jun 2018 10:02:27 GMT], X-Android-Received-Millis=[1527933746410], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1527933745838]}
06-02 15:02:27.845 1809-5828/system_process D/NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_HTTPS https://www.google.com/generate_204 time=3193ms ret=204 headers={null=[HTTP/1.1 204 No Content], Alt-Svc=[quic=":443"; ma=2592000; v="43,42,41,39,35"], Content-Length=[0], Date=[Sat, 02 Jun 2018 10:02:26 GMT], X-Android-Received-Millis=[1527933747844], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1527933744652]}
06-02 15:02:28.637 1809-1887/system_process D/NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_FALLBACK http://www.google.com/gen_204 time=995ms ret=204 headers={null=[HTTP/1.1 204 No Content], Content-Length=[0], Content-Type=[text/html; charset=UTF-8], Date=[Sat, 02 Jun 2018 10:02:30 GMT], P3P=[CP="This is not a P3P policy! See g.co/p3phelp for more info."], Server=[gws], Set-Cookie=[NID=131=QncJ2SQd2g2FVKA4Wduj0W-ud-XATCGEeMd-8IJnlqhzj13ib7r1sc51LBvDb9Epk5QNUZ-avYwathoI47Vg172zHrdxOc4LwBFr8aW73asymhvElP2eln9wFnsMMW0i; expires=Sun, 02-Dec-2018 10:02:30 GMT; path=/; domain=.google.com; HttpOnly], X-Android-Received-Millis=[1527933748636], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1527933748112], X-Frame-Options=[SAMEORIGIN], X-XSS-Protection=[1; mode=block]}
06-02 15:02:28.640 1809-1870/system_process D/ConnectivityService: NetworkAgentInfo [WIFI () - 100] validation passed

0 个答案:

没有答案