Wednesday 27 September 2017

JSON PARSING SIMPLE





-----------------------------AgencySignInActivity.java------------------

package com.dollop.syzygy.agency.activity;

import android.content.Intent;
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 com.dollop.syzygy.agency.R;
import com.dollop.syzygy.agency.Volley.Helper;
import com.dollop.syzygy.agency.Volley.JSONParser;
import com.dollop.syzygy.agency.WebServiceURL;
import com.dollop.syzygy.agency.utilis.SaveData;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

import butterknife.ButterKnife;

public class AgencySignInActivity extends BaseActivity {
    Button agencySignInBtn;
    EditText AgencyUserNameId, AgencyPassId;

    @Override
    protected int getContentResId() {
        return R.layout.activity_agency_sign_in;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        setToolbarWithBackButton("SignIn");
        SaveData.saveUserType("AgencyLogin");
        AgencyUserNameId = (EditText) findViewById(R.id.AgencyUserNameId);
        AgencyPassId = (EditText) findViewById(R.id.AgencyPassId);
        agencySignInBtn = (Button) findViewById(R.id.agencySignInBtn);
        agencySignInBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String UserName = AgencyUserNameId.getText().toString();
                String Password = AgencyPassId.getText().toString();


                if (UserAccount.isEmpty(AgencyUserNameId, AgencyPassId)) {
                    if (UserAccount.isPasswordValid(AgencyPassId)) {
                        loginAgencyGiver();
                    } else {
                        UserAccount.EditTextPointer.setError("Password must contain 6 chracter!");
                        UserAccount.EditTextPointer.requestFocus();
                    }

                } else {
                    UserAccount.EditTextPointer.setError("Fields Can't be Empty!");
                    UserAccount.EditTextPointer.requestFocus();

                }
            }
        });
    }

    private void loginAgencyGiver() {
        new JSONParser(this).parseVollyStringRequestWithautProgressBar(WebServiceURL.URL.Login_Url, 1, getParms(), new Helper() {

            @Override
            public void backResponse(String response) {
                try {
                    JSONObject mainobject = new JSONObject(response);
                    int status = mainobject.getInt("status");
                    String message = mainobject.getString("message");
                    String Token = mainobject.getString("Token");
                    Log.e("Token", "..." + Token);
                    SaveData.saveToken(Token);
                    if (status == 200) {

                        Toast.makeText(AgencySignInActivity.this, "Agency Login successfully...", Toast.LENGTH_SHORT).show();
                        Intent intent = new Intent(AgencySignInActivity.this, NavigrationAgencyActivity.class);
                        startActivity(intent);
                        finish();
                    } else {
                        Toast.makeText(AgencySignInActivity.this, "Sorry Id And Password Not Match..", Toast.LENGTH_SHORT).show();

                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
        });
    }

    private Map<String, String> getParms() {

        HashMap<String, String> params = new HashMap<>();
        params.put("authority_id", "4");
        params.put("user_name", AgencyUserNameId.getText().toString());
        params.put("password", AgencyPassId.getText().toString());

        return params;
    }

}




-------------------------Helper.class------------------


package com.dollop.syzygy.agency.Volley;

/**
 * Created by CRUD Technology on 10/5/2015.
 */
public interface Helper {
    public void backResponse(String response);
}





--------------------------JSONParser.class-------------


package com.dollop.syzygy.agency.Volley;

import android.content.Context;
import android.util.Log;

import com.afollestad.materialdialogs.MaterialDialog;
import com.android.volley.AuthFailureError;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.StringRequest;
import com.dollop.syzygy.agency.AppController;
import com.dollop.syzygy.agency.R;

import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;


public class JSONParser {

    static InputStream is = null;
    static JSONObject jObj = null, response;
    static String json = "";
    private Context cx;

    // constructor
    public JSONParser(Context cx) {
        this.cx = cx;
    }


    // function get json from url
    // by making HTTP POST or GET mehtod


    public static String convertInputStreamToString(InputStream inputStream)
            throws IOException {
        BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(inputStream));
        String line = "";
        String result = "";
        while ((line = bufferedReader.readLine()) != null)
            result += line;
        inputStream.close();
        return result;

    }

    public void parseVollyJSONObject(String url, int method, final JSONObject param, final Helper h) {
        //method GET=0,POST=1
       /* String perameters;
        if (param == null) {
            perameters = null;
        } else {
            perameters = param.toString();
        }*/
        if (method == 0 || method == 1) {
            final JsonObjectRequest jsObjRequest = new JsonObjectRequest
                    (method, url, param, new Response.Listener<JSONObject>() {

                        @Override
                        public void onResponse(JSONObject response) {
                            //Log.e("Response: ", response.toString());
                            if (response != null) {
                                h.backResponse(response.toString());

                            } else {
                                M.E("Something went wrong.!");
                            }
                        }

                    }, new Response.ErrorListener() {

                        @Override
                        public void onErrorResponse(VolleyError error) {
                            String err = (error.getMessage() == null) ? "Parse Fail" : error.getMessage();
                            h.backResponse("error");
                            Log.e("sdcard-err2:", err);
                            M.E("Something went wrong.!");
                        }
                    }) {
                @Override
                public Map<String, String> getHeaders() throws AuthFailureError {
                    HashMap<String, String> headers = new HashMap<String, String>();
                    headers.put("Content-Type", "application/json; charset=utf-8");
                    return headers;
                }
            };

            jsObjRequest.setShouldCache(true);
            // Adding request to request queue
            AppController.getInstance().
                    addToRequestQueue(jsObjRequest);
        } else {
            M.E("Invalid Request Method");
        }
    }

    public void parseVollyStringRequest(String url, int method, final Map<String, String> params, final Helper h) {
        //method GET=0,POST=1
        if (NetworkUtil.getConnectivityStatus(cx)) {
            if (method == 0 || method == 1) {
                final MaterialDialog materialDialog = M.initProgressDialog(cx);
                final StringRequest jsObjRequest = new StringRequest
                        (method, url, new Response.Listener<String>() {
                            @Override
                            public void onResponse(String response) {
                                //M.E("Response: " + response.toString());
                                if (response != null) {
                                    materialDialog.dismiss();
                                    h.backResponse(response.toString());
                                } else {
                                    M.E("Invalid Request Method");
                                }
                            }
                        }, new Response.ErrorListener() {

                            @Override
                            public void onErrorResponse(VolleyError error) {
                                String err = (error.getMessage() == null) ? "Parse Fail" : error.getMessage();
                                materialDialog.dismiss();
                                h.backResponse("error");
                                M.E("sdcard-err2:" + err);
                                M.E("Something went wrong.!");
                            }
                        }) {
                    @Override
                    protected Map<String, String> getParams() throws AuthFailureError {


                        //returning parameters
                        return params;
                    }
                };
                // Adding request to request queue
                AppController.getInstance().addToRequestQueue(jsObjRequest);


            } else {
                M.E("Invalid Request Method");
            }
        } else {
            M.T(cx, cx.getString(R.string.no_internet));
        }
    }

    public void parseVollyStringRequestWithautProgressBar(String url, int method, final Map<String, String> params, final Helper h) {
        //method GET=0,POST=1
        if (NetworkUtil.getConnectivityStatus(cx)) {
            if (method == 0 || method == 1) {
                final MaterialDialog materialDialog = M.initProgressDialog(cx);
                final StringRequest jsObjRequest = new StringRequest
                        (method, url, new Response.Listener<String>() {
                            @Override
                            public void onResponse(String response) {
                                //M.E("Response: " + response.toString());
                                if (response != null) {
                                    materialDialog.dismiss();
                                    h.backResponse(response.toString());
                                } else {
                                    M.E("Invalid Request Method");
                                }
                            }
                        }, new Response.ErrorListener() {

                            @Override
                            public void onErrorResponse(VolleyError error) {
                                String err = (error.getMessage() == null) ? "Parse Fail" : error.getMessage();
//                                materialDialog.dismiss();
                                h.backResponse("error");
                                M.E("sdcard-err2:" + err);
                                M.E("Something went wrong.!");
                            }
                        }) {
                    @Override
                    protected Map<String, String> getParams() throws AuthFailureError {


                        //returning parameters
                        return params;
                    }
                };
                // Adding request to request queue
                AppController.getInstance().addToRequestQueue(jsObjRequest);


            } else {
                M.E("Invalid Request Method");
            }
        } else {
            M.T(cx, cx.getString(R.string.no_internet));
        }
    }
}




--------------------M.class-----------------


package com.dollop.syzygy.agency.Volley;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import com.afollestad.materialdialogs.MaterialDialog;


/**
 * Created by Sohel on 9/17/2015.
 */
public class M {
    public static void I(Context cx, Class<?> startActivity, Bundle data) {
        Intent i = new Intent(cx, startActivity);
        if (data != null)
            i.putExtras(data);
        cx.startActivity(i);
    }

    public static void E(String msg) {
        Log.e("Log.E By Sohel ", msg);
    }


    public static void T(Context c, String msg) {
        Toast.makeText(c, msg, Toast.LENGTH_SHORT).show();
    }



    public static MaterialDialog initProgressDialog(Context c) {
        return new MaterialDialog.Builder(c)
                .title("Please wait...")
                .autoDismiss(false)
                .content("Wait for a moment.")
                .progress(true, 0)
                .show();
    }
//    public static void Popup(Context c,View V, String msg, String title) {
//        final Dialog dialog = new Dialog(c);
//        dialog.setContentView(R.layout.activity_popup);
//        dialog.setTitle(title);
//        final TextView textId = (TextView) dialog.findViewById(R.id.textId);
//        textId.setText(msg);
//        new Handler().postDelayed(new Runnable() {
//                                      @Override
//                                      public void run() {
//                                          dialog.dismiss();
//                                      }
//                                  }
//
//                , 3000);
//
//        dialog.show();
//
//    }
    public static void share(Context c, String subject, String shareBody) {
        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        sharingIntent.setType("text/plain");
        sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
        sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
        c.startActivity(Intent.createChooser(sharingIntent, "Share via"));
    }
}



----------------------------NetworkUtil.class-----------






package com.dollop.syzygy.agency.Volley;


/**
 * Created by CRUD Technology on 8/22/2015.
 */

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkInfo;
import android.os.Build;

public class NetworkUtil {

   public static Boolean getConnectivityStatus(Context context) {
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Network[] networks = connectivityManager.getAllNetworks();
            NetworkInfo networkInfo;
            for (Network mNetwork : networks) {
                networkInfo = connectivityManager.getNetworkInfo(mNetwork);
                if (networkInfo.getState().equals(NetworkInfo.State.CONNECTED)) {
                    return true;
                }
            }
        } else {
            if (connectivityManager != null) {
                //noinspection deprecation
                NetworkInfo[] info = connectivityManager.getAllNetworkInfo();
                if (info != null) {
                    for (NetworkInfo anInfo : info) {
                        if (anInfo.getState() == NetworkInfo.State.CONNECTED) {
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
}





----------------AppController.class---------



package com.dollop.syzygy.agency;

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.support.annotation.IntDef;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Created by androidsys1 on 3/31/2017.
 */

public class AppController extends MultiDexApplication {

    private static AppController mInstance;
    public static int invoiceId = 0;
    private RequestQueue mRequestQueue;
    public static final String TAG = AppController.class.getSimpleName();

    public static synchronized AppController getInstance() {
        return mInstance;
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);

    }

    @Retention(RetentionPolicy.SOURCE)
    @IntDef(
            {GRANTED, DENIED, BLOCKED})
    public @interface PermissionStatus {
    }

    public static final int GRANTED = 0;
    public static final int DENIED = 1;
    public static final int BLOCKED = 2;

    @PermissionStatus
    public static int getPermissionStatus(Activity activity, String androidPermissionName) {
        if (ContextCompat.checkSelfPermission(activity, androidPermissionName) != PackageManager.PERMISSION_GRANTED) {
            if (!ActivityCompat.shouldShowRequestPermissionRationale(activity, androidPermissionName)) {
                return BLOCKED;
            }
            return DENIED;
        }
        return GRANTED;
    }

    public RequestQueue getRequestQueue() {
        if (mRequestQueue == null) {
            mRequestQueue = Volley.newRequestQueue(getApplicationContext());
        }

        return mRequestQueue;
    }

    public <T> void addToRequestQueue(Request<T> req, String tag) {
        req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
        getRequestQueue().add(req);
    }

    public <T> void addToRequestQueue(Request<T> req) {
        req.setTag(TAG);
        getRequestQueue().add(req);
    }


    @Override
    public void onCreate() {
        MultiDex.install(this);
        super.onCreate();
        mInstance = this;


    }

    public void handleUncaughtException(Thread thread, Throwable e) {
        e.printStackTrace();
    }

}



---------------WebServiceURL.class-----------




package com.dollop.syzygy.agency;

/**
 * Created by androidsys1 on 4/24/2017.
 */

public class WebServiceURL {
    public interface URL {
        public static String host_Url = "http://activegrowthinc.com/careApp/";
//        public static String GetOtp_Url = host_Url + "getOtp";
//        public static String MatechOtpAndRegister_Url = host_Url + "matchOtpAndRegistration";
        public static String Login_Url = host_Url + "login";
        public static String GetCaregiverAccordingToAgency = host_Url + "getCaregiverAccordingToAgency";
        public static String AddPayment = host_Url + "addPayment";
        public static String GetAgency = host_Url + "getAgency";
//        public static String HireCareGiverHistroy_Url = host_Url + "hireCareGiverHistory";
//        public static String GetEmerGencyClientContact_Url = host_Url + "getEmergencyNo";
//        public static String Client_ForgotPassword_Url = host_Url + "forgot_password";
//        public static String Client_MatchOtp = host_Url + "matchOtp";
//        public static String Client_ChangePasword_Url = host_Url + "change_password";


    }
}



-----------------SaveData.class--------------



package com.dollop.syzygy.agency.utilis;

import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import com.dollop.syzygy.agency.AppController;


/**
 * Created by Rahul jain on 24-04-2017.
 */

public class SaveData {
    private static final String USERTYPE = "user_type";
    private static final String TOKEN = "token_id";
    static SharedPreferences prefs;

    public static SharedPreferences getInstance() {

        if (prefs == null) {

            prefs = PreferenceManager.getDefaultSharedPreferences(AppController.getInstance());

        }

        return prefs;

    }

    public static String getUserTpye() {
        return getInstance().getString(USERTYPE, null);
    }

    public static void saveUserType(String user_type) {
        SharedPreferences.Editor editor = getInstance().edit();
        editor.putString(USERTYPE, user_type);
        editor.apply();
    }
    public static String getToken() {
        return getInstance().getString(TOKEN, null);
    }

    public static void saveToken(String user_type) {
        SharedPreferences.Editor editor = getInstance().edit();
        editor.putString(TOKEN, user_type);
        editor.apply();
    }
}





-------------build.gradle--------------------




apply plugin: 'com.android.application'
android {
    compileSdkVersion 26    buildToolsVersion "26.0.1"    defaultConfig {
        applicationId "com.dollop.syzygy.agency"        minSdkVersion 15        targetSdkVersion 26        versionCode 1        versionName "1.0"        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }
    }
}

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.android.support:design:25.3.1'    compile 'com.google.android.gms:play-services:11.0.2'    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.google.android.gms:play-services-maps:9.4.0'    compile 'com.jakewharton:butterknife:8.5.1'    compile 'com.android.support:cardview-v7:25.1.1'
    testCompile 'junit:junit:4.12'    compile 'com.afollestad.material-dialogs:core:0.9.0.1'    compile 'com.mcxiaoke.volley:library-aar:1.0.0'    compile 'com.android.support:multidex:1.0.1'
}






---------------AndroidManifest.xml----------



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

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:name=".AppController"
        android:allowBackup="true"
        android:icon="@drawable/agencynew"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

        <!-- <activity android:name=".Activity.SplashActivity"> -->
        <activity android:name=".Intro.WelcomeAgencyActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".activity.NavigrationAgencyActivity"
            android:label="@string/title_activity_navigration_agency"
            android:theme="@style/AppTheme" />
        <activity android:name=".activity.ActiveUserAgencyActivity" />
        <activity android:name=".activity.TrustBudgesActivity" />
        <activity android:name=".activity.AgencyProfileActivity" />
        <activity android:name=".activity.AgencySignInActivity" />
        <activity android:name=".activity.AgencyfragmentActivity" />
        <!-- <activity android:name=".Intro.WelcomeAgencyActivity"></activity> -->
        <activity android:name=".activity.SplashActivity"></activity>
        <activity android:name=".activity.AgencyPaymentActivity"></activity>
    </application>

</manifest>


NEW DATABASE



-------------------------AllDetailActivity.java--------


package com.example.meenakshi.databaseloginsignup.activity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.example.meenakshi.databaseloginsignup.BaseActivity;
import com.example.meenakshi.databaseloginsignup.R;
import com.example.meenakshi.databaseloginsignup.database.LoginDataHelper;
import com.example.meenakshi.databaseloginsignup.database.LoginModel;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class AllDetailActivity extends BaseActivity {

    @BindView(R.id.Emailget)
    EditText Emailget;
    @BindView(R.id.Passwordget)
    EditText Passwordget;
    @BindView(R.id.deleteentryBt)
    Button deleteentryBt;
    @BindView(R.id.UpdateentryBt)
    Button UpdateentryBt;
    LoginModel loginModel;
    LoginDataHelper loginDataHelper;
    @BindView(R.id.Headingget)
    EditText Headingget;
    ArrayList<LoginModel> datas = new ArrayList<>();


    @Override
    protected int getContentResId() {
        return R.layout.activity_all_detail;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        setToolbarWithBackButton("all data");
        datas = loginDataHelper.getInstance().getLoginDetail();
        datas.size();
        Log.e("++++++++++", "" + datas.size());
        Emailget.setText(datas.get(datas.size() - 1).getEmail());
        Passwordget.setText(datas.get(datas.size() - 1).getPassword());
        Headingget.setText(datas.get(datas.size()-1).getHeading());
        deleteentryBt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LoginDataHelper.getInstance().delete(Emailget.getText().toString());
                datas.size();
                Log.e("-----------------", "" + datas.size());

            }
        });
//        Passwordget.setText(loginDataHelper.getLoginDetail().get(0).getPassword());


    }
}



------------------------MainActivity.java-------------


package com.example.meenakshi.databaseloginsignup.activity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.example.meenakshi.databaseloginsignup.BaseActivity;
import com.example.meenakshi.databaseloginsignup.database.LoginDataHelper;
import com.example.meenakshi.databaseloginsignup.R;
import com.example.meenakshi.databaseloginsignup.database.LoginModel;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MainActivity extends BaseActivity {

    @BindView(R.id.EmailEt)
    EditText EmailEt;
    @BindView(R.id.PasswordEt)
    EditText PasswordEt;
    @BindView(R.id.LoginBt)
    Button LoginBt;
    @BindView(R.id.SignupTv)
    TextView SignupTv;
    LoginDataHelper loginDataHelper;
    LoginModel loginModel;
    ArrayList<LoginModel> datas;

    @Override
    protected int getContentResId() {
        return R.layout.activity_main;
    }

    @Override
    protected void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        setToolbarWithBackButton("Login");
        SignupTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, SignUpActivity.class);
                startActivity(intent);
            }
        });
        LoginBt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Log.e("^^^^^^^^^^^^^^^^^^^","");

          /*      startActivity(new Intent(MainActivity.this, AllDetailActivity.class));*/
                String email = EmailEt.getText().toString();
                String password = PasswordEt.getText().toString();
                loginDataHelper=LoginDataHelper.getInstance();


                if ((loginDataHelper.checkAccount(email,password)))
                {
                    startActivity(new Intent(MainActivity.this, AllDetailActivity.class));
                }
//else {
//                    Log.e("^^^^^^^^^^^^^^^^^^^","%%%%%%%%%%%%%%");
//                }

            }
        });
    }
}






----------SignUpActivity.java---------------


package com.example.meenakshi.databaseloginsignup.activity;

import android.content.Intent;
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 com.example.meenakshi.databaseloginsignup.BaseActivity;
import com.example.meenakshi.databaseloginsignup.R;
import com.example.meenakshi.databaseloginsignup.database.LoginDataHelper;
import com.example.meenakshi.databaseloginsignup.database.LoginModel;

import butterknife.BindView;
import butterknife.ButterKnife;

public class SignUpActivity extends BaseActivity {

    @BindView(R.id.EmailSignupEt)
    EditText EmailSignupEt;
    @BindView(R.id.PasswordSignupEt)
    EditText PasswordSignupEt;
    @BindView(R.id.ConfirmPasswordSignupEt)
    EditText ConfirmPasswordSignupEt;
    @BindView(R.id.SignUPButton)
    Button SignUPButton;
    LoginModel loginModel;
    LoginDataHelper loginDataHelper;

    @Override
    protected int getContentResId() {
        return R.layout.activity_sign_up;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        setToolbarWithBackButton("SignUp");
        SignUPButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Log.e("$$$$$$$$$$$","============="+EmailSignupEt.getText().toString());
                LoginModel loginModel=new LoginModel();
                loginModel.setEmail(EmailSignupEt.getText().toString());
                loginModel.setPassword(PasswordSignupEt.getText().toString());
                loginModel.setHeading(ConfirmPasswordSignupEt.getText().toString());
                LoginDataHelper.getInstance().insertClientDetail(loginModel);
                Toast.makeText(SignUpActivity.this, "entry successfully", Toast.LENGTH_SHORT).show();
                Intent intent=new Intent(SignUpActivity.this,MainActivity.class);
                startActivity(intent);
            }
        });

    }
}





---------------DataManager.class----------------


package com.example.meenakshi.databaseloginsignup.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;


public class DataManager extends SQLiteOpenHelper {
    public static final int DATABASE_VERSION = 5;
    public static final String DATABASE_NAME = "CollegeLife";

    public DataManager(Context context, String name, CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        LoginModel.creteTable(db);
//        UserDetailModel.creteTable(db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int paramInt1, int paramInt2) {
        LoginModel.dropTable(db);
//        UserDetailModel.dropTable(db);
//        SavedData.clear();
        onCreate(db);
    }


}

package com.example.meenakshi.databaseloginsignup.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;


public class DataManager extends SQLiteOpenHelper {
    public static final int DATABASE_VERSION = 5;
    public static final String DATABASE_NAME = "CollegeLife";

    public DataManager(Context context, String name, CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        LoginModel.creteTable(db);
//        UserDetailModel.creteTable(db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int paramInt1, int paramInt2) {
        LoginModel.dropTable(db);
//        UserDetailModel.dropTable(db);
//        SavedData.clear();
        onCreate(db);
    }


}




-----------------------------LoginDataHelper.class-------

package com.example.meenakshi.databaseloginsignup.database;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import java.util.ArrayList;

/**
 * Created by Meenakshi on 21/03/2017.
 */

public class LoginDataHelper {

    private static LoginDataHelper instance;
    private SQLiteDatabase db;
    private DataManager dm;
    Context cx;

    public LoginDataHelper(Context cx) {
        instance = this;
        this.cx = cx;
        dm = new DataManager(cx, DataManager.DATABASE_NAME, null, DataManager.DATABASE_VERSION);
    }


    public static LoginDataHelper getInstance() {
        return instance;
    }

    public void open() {
        db = dm.getWritableDatabase();
    }

    public void close() {
        db.close();
    }

    public void read() {
        db = dm.getReadableDatabase();
    }

    public void delete(String email) {
        open();
        db.delete(LoginModel.TABLE_NAME, LoginModel.KEY_USER_EMAIL + " = '" + email + "'", null);
//        db.execSQL("DELETE FROM " + CartModel.TABLE_NAME + " WHERE " + CartModel.KEY_PACKAGE_ID + "= '" + packageId);
        close();
    }

    public boolean isExist(String email) {
        Cursor clientCur = db.rawQuery("SELECT * FROM " + LoginModel.TABLE_NAME + " WHERE email = '" + email + "'", null);
        boolean exist = (clientCur.getCount() > 0);
        clientCur.close();
        return exist;
    }

    public void insertClientDetail(LoginModel loginModel) {
        open();
        ContentValues values = new ContentValues();
        values.put(loginModel.KEY_USER_EMAIL, loginModel.getEmail());
        values.put(loginModel.KEY_USER_PASSWORD, loginModel.getPassword());
        values.put(loginModel .KEY_USER_HEADING, loginModel.getHeading());
        values.put(loginModel.KEY_LOGIN_TYPE, loginModel.getLoginType());
        db.insert(loginModel.TABLE_NAME, null, values);
        close();
    }

    public void updateEntry(LoginModel loginModel) {
        // Define the updated row content.
        ContentValues updatedValues = new ContentValues();
        // Assign values for each row.
        updatedValues.put(loginModel.KEY_USER_EMAIL, loginModel.getEmail());
        updatedValues.put(loginModel.KEY_USER_PASSWORD, loginModel.getPassword());
        updatedValues.put(loginModel.KEY_LOGIN_TYPE, loginModel.getLoginType());

        String where = "EMAIL = ?";
        db.update(loginModel.TABLE_NAME, updatedValues, where, new String[]{loginModel.getEmail()});
    }

    public void updateClientDetail(LoginModel loginModel) {
        open();
        ContentValues updatedValues = new ContentValues();
        updatedValues.put(loginModel.KEY_USER_EMAIL, loginModel.getEmail());
        updatedValues.put(loginModel.KEY_USER_PASSWORD, loginModel.getPassword());
        updatedValues.put(loginModel.KEY_LOGIN_TYPE, loginModel.getLoginType());

        String where = "EMAIL = ?";
        db.update(loginModel.TABLE_NAME, updatedValues, " EMAIL  = '" + loginModel.getEmail() + "'", null);
        close();
    }

    public ArrayList<LoginModel> getLoginDetail() {
        ArrayList<LoginModel> userItem = new ArrayList<LoginModel>();
        read();
        Cursor clientCur = db.rawQuery("select * from LoginModel", null);
        if (clientCur != null && clientCur.getCount() > 0) {
            clientCur.moveToFirst();
            do {
                LoginModel loginModel = new LoginModel();
                loginModel.setEmail(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_EMAIL)));
                loginModel.setPassword(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_PASSWORD)));
                loginModel.setHeading(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_HEADING)));
                loginModel.setLoginType(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_LOGIN_TYPE)));

                userItem.add(loginModel);
            } while ((clientCur.moveToNext()));
            clientCur.close();
        }
        close();
        return userItem;
    }
//    public  boolean checkAccount(String email) {

    public  boolean checkAccount(String email,String password) {
        ArrayList<LoginModel> userItem = new ArrayList<LoginModel>();
        read();
//        Cursor clientCur = db.rawQuery("SELECT * FROM " + LoginModel.TABLE_NAME + " WHERE email = '" + email + "'", null);
        Cursor clientCur = db.rawQuery("SELECT * FROM " + LoginModel.TABLE_NAME + " WHERE email = '" + email + "'"+"AND"+" password = '"+password+"'", null);
//        Cursor clientCur = db.rawQuery("SELECT * FROM " + LoginModel.TABLE_NAME + " WHERE email = '" + email  + " password = '" + password + "'", null);

        if (clientCur != null && clientCur.getCount() > 0) {


            clientCur.moveToFirst();

            do {
                LoginModel loginModel = new LoginModel();
                loginModel.setEmail(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_EMAIL)));
                loginModel.setPassword(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_PASSWORD)));
                loginModel.setHeading(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_HEADING)));
                loginModel.setLoginType(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_LOGIN_TYPE)));

                userItem.add(loginModel);
            } while ((clientCur.moveToNext()));
            clientCur.close();
            return true;
        }else{
        close();


        }
        return false;
    }

}





----------------LoginModel.class----------

package com.example.meenakshi.databaseloginsignup.database;

import android.database.sqlite.SQLiteDatabase;

/**
 * Created by Meenakshi on 21/03/2017.
 */

public class LoginModel {


    public static final String TABLE_NAME = "LoginModel";
    public static final String KEY_ID = "_id";
    public static String KEY_USER_EMAIL = "email";
    public static String KEY_USER_PASSWORD = "password";
    public static String KEY_USER_HEADING = "Heading";
    public static String KEY_LOGIN_TYPE = "loginType";



    public static void creteTable(SQLiteDatabase db) {
        String CREATE_CLIENTTABLE = "create table " + TABLE_NAME + " ("
                + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
                + KEY_USER_EMAIL + " text, "
                + KEY_USER_PASSWORD + " text, "
                + KEY_USER_HEADING + " text, "
                + KEY_LOGIN_TYPE + " text " +
                ")";
        db.execSQL(CREATE_CLIENTTABLE);
    }

    public static void dropTable(SQLiteDatabase db) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getLoginType() {
        return loginType;
    }

    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }

    //setter gater
    private String email,password,loginType;

    public String getHeading() {
        return Heading;
    }

    public void setHeading(String heading) {
        Heading = heading;
    }

    private String Heading;


}



package com.example.meenakshi.databaseloginsignup.database;

import android.database.sqlite.SQLiteDatabase;

/**
 * Created by Meenakshi on 21/03/2017.
 */

public class LoginModel {


    public static final String TABLE_NAME = "LoginModel";
    public static final String KEY_ID = "_id";
    public static String KEY_USER_EMAIL = "email";
    public static String KEY_USER_PASSWORD = "password";
    public static String KEY_USER_HEADING = "Heading";
    public static String KEY_LOGIN_TYPE = "loginType";



    public static void creteTable(SQLiteDatabase db) {
        String CREATE_CLIENTTABLE = "create table " + TABLE_NAME + " ("
                + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
                + KEY_USER_EMAIL + " text, "
                + KEY_USER_PASSWORD + " text, "
                + KEY_USER_HEADING + " text, "
                + KEY_LOGIN_TYPE + " text " +
                ")";
        db.execSQL(CREATE_CLIENTTABLE);
    }

    public static void dropTable(SQLiteDatabase db) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getLoginType() {
        return loginType;
    }

    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }

    //setter gater
    private String email,password,loginType;

    public String getHeading() {
        return Heading;
    }

    public void setHeading(String heading) {
        Heading = heading;
    }

    private String Heading;


}




-------------------------------AppController.class---------



package com.example.meenakshi.databaseloginsignup;

import android.app.Application;
import android.text.TextUtils;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.DiskBasedCache;
import com.android.volley.toolbox.Volley;
import com.example.meenakshi.databaseloginsignup.database.LoginDataHelper;


public class AppController extends Application {

    public static final String TAG = AppController.class.getSimpleName();

    private RequestQueue mRequestQueue;

    private static AppController mInstance;
    DiskBasedCache cache;

    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        new LoginDataHelper(this);
//        new UserDetailDataHelper(this);
        // Create global configuration and initialize ImageLoader with this config
    }

    public DiskBasedCache getDiskCache()
    {
        if (cache == null)
        {
            cache = new DiskBasedCache(getExternalCacheDir(), 209715200);
        }
        return cache;
    }

    public static synchronized AppController getInstance() {
        return mInstance;
    }

    public RequestQueue getRequestQueue() {
        if (mRequestQueue == null) {
            mRequestQueue = Volley.newRequestQueue(getApplicationContext());
        }

        return mRequestQueue;
    }

    public <T> void addToRequestQueue(Request<T> req, String tag) {
        req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
        getRequestQueue().add(req);
    }

    public <T> void addToRequestQueue(Request<T> req) {
        req.setTag(TAG);
        getRequestQueue().add(req);
    }

    public void cancelPendingRequests(Object tag) {
        if (mRequestQueue != null) {
            mRequestQueue.cancelAll(tag);
        }
    }
}

package com.example.meenakshi.databaseloginsignup;

import android.app.Application;
import android.text.TextUtils;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.DiskBasedCache;
import com.android.volley.toolbox.Volley;
import com.example.meenakshi.databaseloginsignup.database.LoginDataHelper;


public class AppController extends Application {

    public static final String TAG = AppController.class.getSimpleName();

    private RequestQueue mRequestQueue;

    private static AppController mInstance;
    DiskBasedCache cache;

    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        new LoginDataHelper(this);
//        new UserDetailDataHelper(this);
        // Create global configuration and initialize ImageLoader with this config
    }

    public DiskBasedCache getDiskCache()
    {
        if (cache == null)
        {
            cache = new DiskBasedCache(getExternalCacheDir(), 209715200);
        }
        return cache;
    }

    public static synchronized AppController getInstance() {
        return mInstance;
    }

    public RequestQueue getRequestQueue() {
        if (mRequestQueue == null) {
            mRequestQueue = Volley.newRequestQueue(getApplicationContext());
        }

        return mRequestQueue;
    }

    public <T> void addToRequestQueue(Request<T> req, String tag) {
        req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
        getRequestQueue().add(req);
    }

    public <T> void addToRequestQueue(Request<T> req) {
        req.setTag(TAG);
        getRequestQueue().add(req);
    }

    public void cancelPendingRequests(Object tag) {
        if (mRequestQueue != null) {
            mRequestQueue.cancelAll(tag);
        }
    }
}



---------------BaseActivity.class-----------



package com.example.meenakshi.databaseloginsignup;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;

/**
 * Created by Sohel Technology on 2/23/2016.
 */
public abstract class BaseActivity extends AppCompatActivity {
    protected Toolbar toolbar;
    protected abstract int getContentResId();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentResId());
    }

    protected void setToolbarWithBackButton(String title) {
        initToolbar();
        getSupportActionBar().setTitle(title);
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_arrow_back_white);
    }

    protected void initToolbar() {
        toolbar = (Toolbar) findViewById(R.id.tool_bar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(true);
    }

    protected void initTitleToolbar(String title) {
        toolbar = (Toolbar) findViewById(R.id.tool_bar);
        setSupportActionBar(toolbar);
//        getSupportActionBar().setDisplayShowTitleEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(false);
        getSupportActionBar().setDisplayHomeAsUpEnabled(false);
        getSupportActionBar().setTitle(title);
    }

   /* protected void initToolbar(String title) {
        initToolbar();
        CollapsingToolbarLayout mCollapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.tool_bar);
        mCollapsingToolbarLayout.setTitleEnabled(false);
        getSupportActionBar().setTitle(title);
    }
*/
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                navigateToParent();
                break;
        }
        return true;
    }

    private void navigateToParent() {
        Intent intent = NavUtils.getParentActivityIntent(this);
        if (intent == null) {
            this.finish();
        } else {
            NavUtils.navigateUpFromSameTask(this);
        }
    }

}

package com.example.meenakshi.databaseloginsignup;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;

/**
 * Created by Sohel Technology on 2/23/2016.
 */
public abstract class BaseActivity extends AppCompatActivity {
    protected Toolbar toolbar;
    protected abstract int getContentResId();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentResId());
    }

    protected void setToolbarWithBackButton(String title) {
        initToolbar();
        getSupportActionBar().setTitle(title);
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_arrow_back_white);
    }

    protected void initToolbar() {
        toolbar = (Toolbar) findViewById(R.id.tool_bar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(true);
    }

    protected void initTitleToolbar(String title) {
        toolbar = (Toolbar) findViewById(R.id.tool_bar);
        setSupportActionBar(toolbar);
//        getSupportActionBar().setDisplayShowTitleEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(false);
        getSupportActionBar().setDisplayHomeAsUpEnabled(false);
        getSupportActionBar().setTitle(title);
    }

   /* protected void initToolbar(String title) {
        initToolbar();
        CollapsingToolbarLayout mCollapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.tool_bar);
        mCollapsingToolbarLayout.setTitleEnabled(false);
        getSupportActionBar().setTitle(title);
    }
*/
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                navigateToParent();
                break;
        }
        return true;
    }

    private void navigateToParent() {
        Intent intent = NavUtils.getParentActivityIntent(this);
        if (intent == null) {
            this.finish();
        } else {
            NavUtils.navigateUpFromSameTask(this);
        }
    }

}






------------activity_all_detail.xml---------

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_all_detail"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.meenakshi.databaseloginsignup.activity.AllDetailActivity">
    <include layout="@layout/tool_bar" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_below="@+id/tool_bar"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">

        <EditText
            android:id="@+id/Emailget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Email" />

        <EditText
            android:id="@+id/Passwordget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Password" />
        <EditText
            android:id="@+id/Headingget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Heading" />
        <Button
            android:id="@+id/deleteentryBt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Delete Entry" />

        <Button
            android:id="@+id/UpdateentryBt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Update Entry" />
    </LinearLayout>
</RelativeLayout>

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_all_detail"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.meenakshi.databaseloginsignup.activity.AllDetailActivity">
    <include layout="@layout/tool_bar" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_below="@+id/tool_bar"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">

        <EditText
            android:id="@+id/Emailget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Email" />

        <EditText
            android:id="@+id/Passwordget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Password" />
        <EditText
            android:id="@+id/Headingget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Heading" />
        <Button
            android:id="@+id/deleteentryBt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Delete Entry" />

        <Button
            android:id="@+id/UpdateentryBt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Update Entry" />
    </LinearLayout>
</RelativeLayout>





----------------------activity_main.xml------------------------------------




<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.meenakshi.databaseloginsignup.activity.MainActivity">

    <include layout="@layout/tool_bar" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tool_bar"
        android:orientation="vertical"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">

        <EditText
            android:id="@+id/EmailEt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Email" />

        <EditText
            android:id="@+id/PasswordEt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Password" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/LoginBt"
            android:text="Login" />
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_marginTop="10dp"
            android:id="@+id/SignupTv"
            android:text="if you don't have account?signup"/>
    </LinearLayout>

</RelativeLayout>



----------------------------activity_sign_up.xml-------------------------



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_sign_up"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    tools:context="com.example.meenakshi.databaseloginsignup.activity.SignUpActivity">
    <include layout="@layout/tool_bar"/>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/tool_bar"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:orientation="vertical">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Email"
        android:id="@+id/EmailSignupEt"/>
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Password"
        android:id="@+id/PasswordSignupEt"/>
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Heading"
        android:id="@+id/ConfirmPasswordSignupEt"/>
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Signup"
        android:id="@+id/SignUPButton"/>
</LinearLayout>
</RelativeLayout>






-------------------tool_bar.xml-----------

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/tool_bar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="@color/colorPrimary"
    android:elevation="4dp"
    android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"/>






-----------------------build.gradle----------------------------------------

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.meenakshi.databaseloginsignup"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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:26.0.0-alpha1'
    testCompile 'junit:junit:4.12'
    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.afollestad.material-dialogs:core:0.9.4.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:recyclerview-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'

}



-------------------AndroidManifest.xml-----------------------------------




android:name=".AppController"

AutoComplete Address (Updated)

-------------------------------------Activity---------------------------------- package placeautocomplete.iteritory.com; import androi...