why my login is not work in my app in localhost with xampp : I have created a app which can users to login by entering their email and password and the database for the activity was created from php my admin with xampp. The database name is user and table name is details.I test it by entering email and password which is in the database.But it doesn't make any reaction.Following I have included login.php, conn.php, login.java, backgroundWorker.java class.

##login.xml code##

    <?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:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#1647a3"
        android:orientation="vertical"
        android:paddingEnd="2sp"
        android:paddingStart="2sp"
        tools:context="com.example.xxxxxx.xxxxxxxxxxx.login"
        android:weightSum="1">


    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="7sp"
        android:contentDescription="@string/icon"
        android:paddingEnd="10sp"
        android:paddingStart="10sp"
        android:src="@drawable/icon"
        tools:ignore="InefficientWeight"
        android:layout_weight="0.52" />

    <TextView
        android:id="@+id/txt_itst"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:freezesText="true"
        android:paddingEnd="10sp"
        android:paddingStart="10sp"
        android:fontFamily="sans-serif-smallcaps"
        android:text="@string/app_name"
        android:textAlignment="center"
        android:textColor="#cac6bc"
        android:textSize="32sp" />

    <TextView
            android:id="@+id/txtLogin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20sp"
            android:paddingBottom="4sp"
            android:paddingEnd="16sp"
            android:paddingStart="16sp"
            android:text="@string/login_nw"
            android:textColor="#212121"
            android:textSize="16sp" />

    <EditText
        android:id="@+id/Et_email"
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:layout_marginEnd="5sp"
        android:layout_marginStart="5sp"
        android:layout_marginTop="5sp"
        android:background="@drawable/passord"
        android:cursorVisible="false"
        android:ems="10"
        android:hint="@string/e_mail"
        android:inputType="textEmailAddress"
        android:paddingEnd="15sp"
        android:paddingStart="20sp"
        android:textColor="#d9d6d6"
        android:textColorHint="#292828" />


    <EditText
            android:id="@+id/Password"
            android:layout_width="match_parent"
            android:layout_height="35dp"
            android:layout_marginEnd="5dp"
            android:textColor="#d9d6d6"
            android:layout_marginStart="5dp"
            android:layout_marginTop="20dp"
            android:background="@drawable/passord"
            android:cursorVisible="false"
            android:ems="10"
            android:hint="@string/pass_w"
            android:inputType="textPassword"
            android:paddingEnd="15dp"
            android:paddingStart="20dp"
            android:textColorHint="#292828" />

        <Button
            android:id="@+id/B_login"
            android:layout_width="match_parent"
            android:layout_height="36dp"
            android:layout_marginEnd="5dp"
            android:layout_marginStart="5dp"
            android:layout_marginTop="20dp"
            android:background="@drawable/passord"
            android:text="@string/lgn"
            android:textColor="#ffffff"
            android:textSize="20sp" />

        <Button
            android:id="@+id/B_register"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_marginEnd="5dp"
            android:layout_marginStart="5dp"
            android:layout_marginTop="20dp"
            android:background="@android:color/transparent"
            android:text="@string/reg_now"
            android:textColor="#ffffff"
            android:textSize="20sp" />


    </LinearLayout>
##login.java##

    package com.example.sayuru.itstimetobeginsinanotherday;

    import android.content.Intent;
    import android.support.v7.app.AlertDialog;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import com.android.volley.RequestQueue;
    import com.android.volley.Response;
    import com.android.volley.toolbox.Volley;
    import org.json.JSONException;
    import org.json.JSONObject;
    
    
     public class login extends AppCompatActivity {
 
     EditText Etemail, Etpassword;

     @Override
     protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        Etemail=(EditText)findViewById(R.id.Et_username);
        Etpassword=(EditText)findViewById(R.id.Et_pssword);

     }

     public void onLogin(View view){
      String email=Etemail.getText().toString();
      String password=Etpassword.getText().toString();
      String type="login";
      BagroundWorker bagroundWorker=new BagroundWorker(this);
      bagroundWorker.execute(type, email, password);
     }
     }
##BackgroundWorker.java class##

    package com.example.xxxxx.xxxxxxxxxxx;

    import android.content.Context;
    import android.os.AsyncTask;
    import android.support.v7.app.AlertDialog;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLEncoder;



    public class BagroundWorker extends AsyncTask<String, Void, String> {
     Context context;
     AlertDialog alertDialog;
     BagroundWorker(Context ctx){
        context=ctx;
    }
    @Override
    protected String doInBackground(String... params) {
        String type=params[0];
        String login_url="http:// 10.0.2.2/login.php";
        if (type.equals("login")){
            try {
                String email=params[1];
                String password=params[2];
                URL url=new URL(login_url);
                HttpURLConnection httpURLConnection=
    (HttpURLConnection)url.openConnection();
                httpURLConnection.setRequestMethod("POST");
                httpURLConnection.setDoOutput(true);
                httpURLConnection.setDoOutput(true);
                OutputStream outputStream=httpURLConnection.getOutputStream();
                BufferedWriter bufferedWriter=new BufferedWriter(new 
    OutputStreamWriter(outputStream, "UTF-8"));
                String post_data= URLEncoder.encode("email","UTF-
    8")+"="+URLEncoder.encode(email,"UTF-8")+"&"
                        +URLEncoder.encode("password","UTF-
    8")+"="+URLEncoder.encode(password,"UTF-8");
                bufferedWriter.write(post_data);
                bufferedWriter.flush();
                bufferedWriter.close();
                outputStream.close();
                InputStream inputStream=httpURLConnection.getInputStream();
                BufferedReader bufferedReader=new BufferedReader(new 
    InputStreamReader(inputStream,"iso-8859-1"));
                String result="";
                String line="";
                while ((line=bufferedReader.readLine())!=null){
                    result +=line;
                }
                bufferedReader.close();
                inputStream.close();
                httpURLConnection.disconnect();
                return result;

            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    @Override
    protected void onPreExecute() {
        alertDialog=new AlertDialog.Builder(context).create();
        alertDialog.setTitle("login status");
    }

    @Override
    protected void onPostExecute(String result) {
        alertDialog.setMessage(result);
        alertDialog.show();
    }

    @Override
    protected void onProgressUpdate(Void... values) {
        super.onProgressUpdate(values);
     }
    }
##conn.php to communicate with server##

    <?php 
    $db_name = "user";
    $mysql_username = "root";
    $mysql_password = "";
    $server_name = "localhost";
    $conn = mysqli_connect($server_name, $mysql_username, 
    $mysql_password,$db_name);

 
    ?>

##login.php to login with server##

    

    <?php 
    require "conn.php";
    $user_email = $_POST["email"];
    $user_pass = $_POST["password"];
    $mysql_qry = "select * from details where email like '$user_email' and 
    password 
    like '$user_pass';";
    $result = mysqli_query($conn ,$mysql_qry);
    if(mysqli_num_rows($result) > 0) {
    echo "login success !!!!! Welcome user";
    }
    else {
    echo "login not success";
    }
 
    ?>







