-------------------------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);
}
}
}
<?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"
No comments:
Post a Comment