Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Tuesday, October 10, 2017

upload Imge or text by using php and Rest Api... final




FileHandler.php
====================


<?php

class FileHandler
{

    private $con;

    public function __construct()
    {
        require_once dirname(__FILE__) . '/DbConnect.php';

        $db = new DbConnect();
        $this->con = $db->connect();
    }


    public function saveFile($file, $extension, $desc)
    {
        $name = round(microtime(true) * 1000) . '.' . $extension;
        $filedest = dirname(__FILE__) . UPLOAD_PATH . $name;
        move_uploaded_file($file, $filedest);

        $url = $server_ip = gethostbyname(gethostname());

        $stmt = $this->con->prepare("INSERT INTO images (description, image) VALUES (?, ?)");
        $stmt->bind_param("ss", $desc, $name);
        if ($stmt->execute()){
return true;
}
else{
 
   //error !! don't go further
   var_dump($this->db->error);

}
            
        return false;
    }
 public function saveFil($file, $extension, $sname, $phone)
    {
        $name = round(microtime(true) * 1000) . '.' . $extension;
        $filedest = dirname(__FILE__) . UPLOAD_PATH . $name;
        move_uploaded_file($file, $filedest);

        $url = $server_ip = gethostbyname(gethostname());

        $stmt = $this->con->prepare("INSERT INTO image(sname,image,phone) VALUES (?, ?, ?)");
        $stmt->bind_param("sss", $sname, $name,$phone);
        if ($stmt->execute()){
return true;
}
else{
 
   //error !! don't go further
//secho $this->db->error;

}
            
        return false;
    }
//$sname,$email, $phone,$roll,$session,$year,$homedst

 public function saveCSE($file, $extension, $sname, $email, $phone,$roll,$year,$homedst)
    {
        $name = round(microtime(true) * 1000) . '.' . $extension;
        $filedest = dirname(__FILE__) . UPLOAD_PATH . $name;
        move_uploaded_file($file, $filedest);

        $url = $server_ip = gethostbyname(gethostname());

        $stmt = $this->con->prepare("INSERT INTO csestudent(sname,image,email, phone,roll,year,homedst) VALUES (?, ?, ?, ?, ?, ?, ?)");
        $stmt->bind_param("sssssss", $sname,$name,$email, $phone,$roll,$year,$homedst);
        if ($stmt->execute()){
return true;
}
else{
 
   //error !! don't go further
//echo $this->db->error;

}
            
        return false;
    }
    public function get($phone, $roll)
    {
        $stmt = $this->con->prepare("SELECT phone, roll, image FROM csestudent where phone= $phone || roll= $roll");
        $stmt->execute();
         $stmt->bind_result($phone,$roll,$image);

        $images = array();

        while ($stmt->fetch()) {

            $temp = array();
            $absurl = 'http://' . gethostbyname(gethostname()) . '/ImageUploadApi' . UPLOAD_PATH . $image;
            $temp['phone'] = $phone;
            $temp['roll'] = $roll;
            $temp['image'] = $absurl;
            array_push($images, $temp);
        }

        return $images;
    }
    public function getAllFiles()
    {
        $stmt = $this->con->prepare("SELECT id, description, image FROM images ORDER BY id DESC");
        $stmt->execute();
        $stmt->bind_result($id, $desc, $image);

        $images = array();

        while ($stmt->fetch()) {

            $temp = array();
            $absurl = 'http://' . gethostbyname(gethostname()) . '/ImageUploadApi' . UPLOAD_PATH . $image;
            $temp['id'] = $id;
            $temp['desc'] = $desc;
            $temp['image'] = $absurl;
            array_push($images, $temp);
        }

        return $images;
    }

}

?>

Api.php
==================

<?php


require_once dirname(__FILE__) . '/FileHandler.php';

$response = array();

if (isset($_GET['apicall'])) {
    switch ($_GET['apicall']) {
        case 'upload':

            if (isset($_POST['desc']) && strlen($_POST['desc']) > 0 && $_FILES['image']['error'] === UPLOAD_ERR_OK) {
                $upload = new FileHandler();

                $file = $_FILES['image']['tmp_name'];

                $desc = $_POST['desc'];

                if ($upload->saveFile($file, getFileExtension($_FILES['image']['name']), $desc)) {
                    $response['error'] = false;
                    $response['message'] = 'File Uploaded Successfullly';
                }

            } else {
                $response['error'] = true;
                $response['message'] = 'Required parameters are not available';
            }

            break;
case 'uploadimage':

            if (isset($_POST['sname']) && strlen($_POST['sname']) > 0 && $_FILES['image']['error'] === UPLOAD_ERR_OK) {
                $upload = new FileHandler();

                $file = $_FILES['image']['tmp_name'];

                $sname = $_POST['sname'];
                $phone = $_POST['phone'];
          

                if ($upload->saveFil($file, getFileExtension($_FILES['image']['name']), $sname, $phone)) {
                    $response['error'] = false;
                    $response['message'] = 'File Uploaded Successfullly';
                }

            } else {
                $response['error'] = true;
                $response['message'] = 'Required parameters are not available';
            }

            break;
case 'csestu':
//$email, $phone,$roll,$session,$year,$homedst

            if (isset($_POST['sname']) && strlen($_POST['sname']) > 0 && $_FILES['image']['error'] === UPLOAD_ERR_OK) {
                $upload = new FileHandler();

                $file = $_FILES['image']['tmp_name'];

                $sname = $_POST['sname'];
                $email = $_POST['email'];
                $phone = $_POST['phone'];
                $roll = $_POST['roll'];
              
                $year = $_POST['year'];
                $homedst = $_POST['homedst'];
$response['check'] = $email.$phone;

                if ($upload->saveCSE($file, getFileExtension($_FILES['image']['name']), $sname, $email, $phone,$roll,$year,$homedst)) {
                   
   $response['error'] = false;
                    $response['message'] = 'File Uploaded Successfullly';
                }

            } else {
                $response['error'] = true;
                $response['message'] = 'Required parameters are not available';
            }

            break;
//get info from server
case 'checkinfo':
// , $phone,$roll

            if (isset($_POST['phone']) && strlen($_POST['phone']) > 0) {
                $upload = new FileHandler();

                $phone = $_POST['phone'];
                $roll = $_POST['roll'];
                
              
             
  
   $response['error'] = false;
                   $response['message'] = $upload->get($phone,$roll);
           
}
            break;


        case 'getallimages':

            $upload = new FileHandler();
            $response['error'] = false;
            $response['images'] = $upload->getAllFiles();

            break;
default:
                $response['error'] = true;
                $response['message'] = 'sory are not available';
break;
    }
}

echo json_encode($response);

function getFileExtension($file)
{
    $path_parts = pathinfo($file);
    return $path_parts['extension'];
}

?>

====================0===================






Constants.php
================

<?php

define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'imageupload');

define('UPLOAD_PATH', '/uploads/');

?>

DbConnect.php
===========

<?php

class DbConnect
{
    private $con;

    public function connect()
    {
        require_once dirname(__FILE__) . '/Constants.php';

        $this->con = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);

        if (mysqli_connect_errno()) {
            echo 'Failed to connect ' . mysqli_connect_error();
            return null;
        }



        return $this->con;
    }
}

?>





Sunday, October 8, 2017

Image upload in PHP and MySql using Rest API in post man



Constants.php
----------------------

<?php

define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'imageupload');

define('UPLOAD_PATH', '/uploads/');

?>


DbConnect.php
-----------------------
<?php

class DbConnect
{
    private $con;

    public function connect()
    {
        require_once dirname(__FILE__) . '/Constants.php';

        $this->con = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);

        if (mysqli_connect_errno()) {
            echo 'Failed to connect ' . mysqli_connect_error();
            return null;
        }



        return $this->con;
    }
}

?>



FileHandler.php
------------------------

<?php

class FileHandler
{

    private $con;

    public function __construct()
    {
        require_once dirname(__FILE__) . '/DbConnect.php';

        $db = new DbConnect();
        $this->con = $db->connect();
    }


    public function saveFile($file, $extension, $desc)
    {
        $name = round(microtime(true) * 1000) . '.' . $extension;
        $filedest = dirname(__FILE__) . UPLOAD_PATH . $name;
        move_uploaded_file($file, $filedest);

        $url = $server_ip = gethostbyname(gethostname());

        $stmt = $this->con->prepare("INSERT INTO images (description, image) VALUES (?, ?)");
        $stmt->bind_param("ss", $desc, $name);
        if ($stmt->execute()){
return true;
}
else{

   //error !! don't go further
   var_dump($this->db->error);

}
         
        return false;
    }

    public function getAllFiles()
    {
        $stmt = $this->con->prepare("SELECT id, description, url FROM images ORDER BY id DESC");
        $stmt->execute();
        $stmt->bind_result($id, $desc, $url);

        $images = array();

        while ($stmt->fetch()) {

            $temp = array();
            $absurl = 'http://' . gethostbyname(gethostname()) . '/ImageUploadApi' . UPLOAD_PATH . $url;
            $temp['id'] = $id;
            $temp['desc'] = $desc;
            $temp['url'] = $absurl;
            array_push($images, $temp);
        }

        return $images;
    }

}

?>


Api.php
---------------------

<?php


require_once dirname(__FILE__) . '/FileHandler.php';

$response = array();

if (isset($_GET['apicall'])) {
    switch ($_GET['apicall']) {
        case 'upload':

            if (isset($_POST['desc']) && strlen($_POST['desc']) > 0 && $_FILES['image']['error'] === UPLOAD_ERR_OK) {
                $upload = new FileHandler();

                $file = $_FILES['image']['tmp_name'];

                $desc = $_POST['desc'];

                if ($upload->saveFile($file, getFileExtension($_FILES['image']['name']), $desc)) {
                    $response['error'] = false;
                    $response['message'] = 'File Uploaded Successfullly';
                }

            } else {
                $response['error'] = true;
                $response['message'] = 'Required parameters are not available';
            }

            break;

        case 'getallimages':

            $upload = new FileHandler();
            $response['error'] = false;
            $response['images'] = $upload->getAllFiles();

            break;
    }
}

echo json_encode($response);

function getFileExtension($file)
{
    $path_parts = pathinfo($file);
    return $path_parts['extension'];
}

?>




Wednesday, September 27, 2017

loginRegistration retrofit and MySql Slim Framwork

 

import com.google.gson.annotations.Expose;

/** * Created by Amirul on 26-Sep-17. */
public class LoginModel  {

    @Expose    private String status;
    @Expose    private String login;

    /**     * @return The status     */    public String getStatus() {
        return status;
    }

    /**     * @param status The status     */    public void setStatus(String status) {
        this.status = status;
    }

    /**     * @return The login     */    public String getLogin() {
        return login;
    }

    /**     * @param login The login     */    public void setLogin(String login) {
        this.login = login;
    }
}



package com.edupointbd.amirul.registerlogin.rest_Interface;

import com.edupointbd.amirul.registerlogin.model.LoginModel;

import retrofit.Callback;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.POST;

/** * Created by Amirul on 26-Sep-17. */
public interface RestInterface {
    //chnage your IP here if you working on local    // String url = "http://192.168.43.175/register-login/v1";    //For Hosting give the complete path before index.php    String url = "http://your domain name/register-login/v1";

    @FormUrlEncoded    @POST("/login")
    void Login(@Field("email") String email,
               @Field("pass") String pass, Callback<LoginModel> cb);

    @FormUrlEncoded    @POST("/signup")
    void SignUp(@Field("name") String name, @Field("email") String email,
                @Field("pass") String pass, Callback<LoginModel> pm);

}



---------------------------------------
 

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;

import com.edupointbd.amirul.registerlogin.model.LoginModel;
import com.edupointbd.amirul.registerlogin.rest_Interface.RestInterface;

import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class LoginActivity extends ActionBarActivity {

    EditText email,pass;

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

        email=(EditText)findViewById(R.id.input_email);
        pass=(EditText)findViewById(R.id.input_password);


        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ffffff")));
        getSupportActionBar().setTitle(Html.fromHtml("<font color='#e12929'>Sign In</font>"));


    }




    // When Button Login clicked    public void Signin(View v){

        //Calling method of field validation        if(CheckFieldValidation()) {

            //progressBar.setVisibility(View.VISIBLE);            setContentView(R.layout.progressbar_layout);
            //making object of RestAdapter            RestAdapter adapter = new RestAdapter.Builder().setEndpoint(RestInterface.url).build();

            //Creating Rest Services            final RestInterface restInterface = adapter.create(RestInterface.class);

            //Calling method to get check login            restInterface.Login(email.getText().toString(), pass.getText().toString(), new Callback<LoginModel>() {
                @Override                public void success(LoginModel model, Response response) {

                    finish();
                    startActivity(getIntent());

                    email.setText("");
                    pass.setText("");


                    if (model.getStatus().equals("1")) {  //login Success
                        Toast.makeText(LoginActivity.this, "Login In SuccessFully", Toast.LENGTH_SHORT).show();
                        Intent i = new Intent(LoginActivity.this,AfterLoginActivity.class);
                        startActivity(i);

                    } else if (model.getStatus().equals("0"))  // login failure                    {
                        Toast.makeText(LoginActivity.this, "Invalid UserName/Pass ", Toast.LENGTH_SHORT).show();
                    }


                }

                @Override                public void failure(RetrofitError error) {
                    finish();
                    startActivity(getIntent());
                    String merror = error.getMessage();
                    Toast.makeText(LoginActivity.this, merror, Toast.LENGTH_LONG).show();
                }
            });
        }
    }

    //When Button Sign up clicked    public void SignUp(View v){

        Intent i= new Intent(LoginActivity.this,SignupActivity.class);
        startActivity(i);


    }

    //checking field are empty    private boolean CheckFieldValidation(){

        boolean valid=true;
        if(email.getText().toString().equals("")){
            email.setError("Can't be Empty");
            valid=false;
        }else if(pass.getText().toString().equals("")){
            pass.setError("Can't be Empty");
            valid=false;
        }

        return valid;

    }

}




xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:background="#E43F3F"    android:fitsSystemWindows="true"    android:fillViewport="false">

    <LinearLayout        android:orientation="vertical"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingTop="56dp"        android:paddingLeft="24dp"        android:paddingRight="24dp">

        <ImageView android:src="@mipmap/ic_launcher"            android:layout_width="wrap_content"            android:layout_height="100dp"            android:layout_marginBottom="24dp"            android:layout_gravity="center_horizontal" />

        <!-- Email Label -->        <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_marginTop="8dp"            android:layout_marginBottom="8dp">
            <EditText android:id="@+id/input_email"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:inputType="textEmailAddress"                android:singleLine="true"                android:textColor="#ffffff"                android:textColorHint="#ffffff"                android:hint="Email" />
        </LinearLayout>

        <!-- Password Label -->        <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_marginTop="8dp"            android:layout_marginBottom="8dp">
            <EditText android:id="@+id/input_password"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:inputType="textPassword"                android:singleLine="true"                android:textColor="#ffffff"                android:textColorHint="#ffffff"                android:hint="Password"/>
        </LinearLayout>



        <android.support.v7.widget.AppCompatButton            android:id="@+id/btn_login"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:background="#C62828"            android:textColor="#ffffff"            android:textStyle="bold"            android:onClick="Signin"            android:layout_marginTop="24dp"            android:layout_marginBottom="24dp"            android:padding="12dp"            android:text="Login"/>

        <android.support.v7.widget.AppCompatButton            android:id="@+id/btn_signup"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:textColor="#C62828"            android:background="#ffffff"            android:textStyle="bold"            android:onClick="SignUp"            android:layout_marginBottom="24dp"            android:padding="12dp"            android:text="Not a member? Click here"/>

    </LinearLayout>
</ScrollView>


===========================================================

package com.edupointbd.amirul.registerlogin;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;

import com.edupointbd.amirul.registerlogin.model.LoginModel;
import com.edupointbd.amirul.registerlogin.rest_Interface.RestInterface;

import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class SignupActivity extends AppCompatActivity {

    EditText email,pass,name;

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

        email=(EditText)findViewById(R.id.input_email);
        pass=(EditText)findViewById(R.id.input_password);
        name=(EditText)findViewById(R.id.input_name);


        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ffffff")));
        getSupportActionBar().setTitle(Html.fromHtml("<font color='#e12929'>Sign Up</font>"));
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);


    }


    public void Signup(View v){


        //calling field validation method        if(CheckFieldValidation()) {

            setContentView(R.layout.progressbar_layout);
            //making object of RestAdapter            RestAdapter adapter = new RestAdapter.Builder().setEndpoint(RestInterface.url).build();

            //Creating Rest Services            final RestInterface restInterface = adapter.create(RestInterface.class);

            //Calling method to signup            restInterface.SignUp(name.getText().toString(), email.getText().toString(),
                    pass.getText().toString(), new Callback<LoginModel>() {
                        @Override                        public void success(LoginModel model, Response response) {

                            finish();
                            startActivity(getIntent());

                            email.setText("");
                            pass.setText("");
                            name.setText("");


                            if (model.getStatus().equals("1")) {  //Signup Success
                                Toast.makeText(SignupActivity.this, "Registered Successfully", Toast.LENGTH_SHORT).show();
                                finish();
                                Intent i = new Intent(SignupActivity.this, LoginActivity.class);
                                startActivity(i);

                            } else if (model.getStatus().equals("0"))  // Signup failure                            {
                                Toast.makeText(SignupActivity.this, "Email Already Registered", Toast.LENGTH_SHORT).show();
                            }


                        }

                        @Override                        public void failure(RetrofitError error) {
                            finish();
                            startActivity(getIntent());
                            String merror = error.getMessage();
                            Toast.makeText(SignupActivity.this, merror, Toast.LENGTH_LONG).show();
                        }
                    });
        }

    }

    //checking field are empty    private boolean CheckFieldValidation(){

        boolean valid=true;
        if(name.getText().toString().equals("")){
            name.setError("Can't be Empty");
            valid=false;
        }else if(email.getText().toString().equals("")){
            email.setError("Can't be Empty");
            valid=false;
        }else if(pass.getText().toString().equals("")){
            pass.setError("Can't be Empty");
            valid=false;
        }

        return valid;

    }


    @Override    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() == android.R.id.home) {
            finish();
        }
        return super.onOptionsItemSelected(menuItem);
    }



}

xml

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:background="#E43F3F"    android:fitsSystemWindows="true">

    <LinearLayout        android:orientation="vertical"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingTop="56dp"        android:paddingLeft="24dp"        android:paddingRight="24dp">

        <ImageView android:src="@drawable/ic_assignment_black_24px"            android:layout_width="100dp"            android:layout_height="100dp"            android:layout_marginBottom="24dp"            android:layout_gravity="center_horizontal" />


        <!-- Name Label -->        <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_marginTop="8dp"            android:layout_marginBottom="8dp">
            <EditText android:id="@+id/input_name"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:inputType="text"                android:singleLine="true"                android:textColor="#ffffff"                android:textColorHint="#ffffff"                android:hint="Name" />
        </LinearLayout>

        <!-- Email Label -->        <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_marginTop="8dp"            android:layout_marginBottom="8dp">
            <EditText android:id="@+id/input_email"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:inputType="textEmailAddress"                android:singleLine="true"                android:textColor="#ffffff"                android:textColorHint="#ffffff"                android:hint="Email" />
        </LinearLayout>

        <!-- Password Label -->        <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_marginTop="8dp"            android:layout_marginBottom="8dp">
            <EditText android:id="@+id/input_password"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:inputType="textPassword"                android:singleLine="true"                android:textColor="#ffffff"                android:textColorHint="#ffffff"                android:hint="Password"/>
        </LinearLayout>



        <android.support.v7.widget.AppCompatButton            android:id="@+id/btn_signup"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:background="#C62828"            android:textColor="#ffffff"            android:textStyle="bold"            android:onClick="Signup"            android:layout_marginTop="24dp"            android:layout_marginBottom="24dp"            android:padding="12dp"            android:text="Signup"/>

    </LinearLayout>
</ScrollView>

=========================================================

package com.edupointbd.amirul.registerlogin;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;

public class AfterLoginActivity extends ActionBarActivity {


    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_after_login);
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ffffff")));
        getSupportActionBar().setTitle(Html.fromHtml("<font color='#e12929'>Home</font>"));


    }

}


<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:gravity="center"    android:background="#E43F3F"    android:layout_height="match_parent">

    <TextView        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="Welcome"        android:textSize="50sp"        android:textColor="#ffffff"        android:id="@+id/textView"        android:layout_gravity="center" />
</LinearLayout>



<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.edupointbd.amirul.registerlogin">

    <uses-permission android:name="android.permission.INTERNET" />

    <application        android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:supportsRtl="true"        android:theme="@style/AppTheme">
        <activity android:name=".LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MainActivity" />
        <activity android:name=".SignupActivity" />
        <activity android:name=".AfterLoginActivity"></activity>
    </application>

</manifest>




dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'    })
    compile 'com.android.support:appcompat-v7:25.3.1'    compile 'com.squareup.retrofit:retrofit:1.9.0'    compile 'com.squareup.okhttp:okhttp:2.4.0'    testCompile 'junit:junit:4.12'}