diff --git a/app/build.gradle b/app/build.gradle
index fbad7bf00fe1dee539b30fb9c62bfb3510301802..aceb0e07b63897bc9d2236648c90b7e0cd1d7cab 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -31,8 +31,10 @@ dependencies {
     compile 'com.android.support:support-annotations:25.3.1'
     compile 'com.google.android.gms:play-services-maps:10.0.1'
     compile 'com.google.firebase:firebase-database:10.0.1'
+    compile 'com.google.firebase:firebase-auth:10.0.1'
     testCompile 'junit:junit:4.12'
 }
 
 
+
 apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
diff --git a/app/src/main/java/com/example/chan24/smartplanner/DatabaseHelper.java b/app/src/main/java/com/example/chan24/smartplanner/DatabaseHelper.java
deleted file mode 100644
index 4e50b513f5a8e8bb2b6f59ba4ea253439a159cd0..0000000000000000000000000000000000000000
--- a/app/src/main/java/com/example/chan24/smartplanner/DatabaseHelper.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.example.chan24.smartplanner;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteOpenHelper;
-
-/**
- * Created by Niharika on 17-04-2017.
- */
-
-public class DatabaseHelper extends SQLiteOpenHelper {
-    final static public String dbname = "UserDetails";
-    final static public String tablename ="RegisterDetails";
-    final static public String col1 ="Username";
-    final static public String col2 ="Password";
-    final static public String col3= "Mail";
-    //final static public String col4= "Age";
-    //final static public String col5="Sex";
-    //final static public String col6="Phone";
-    public static final String query="create table "+tablename+" (Username varchar(50) primary key ,Password varchar(50),Mail varchar(60))";
-
-    public DatabaseHelper(Context context) {
-        super(context, dbname, null, 1);
-    }
-
-    @Override
-    public void onCreate(SQLiteDatabase db) {
-    db.execSQL(query);
-    }
-
-    @Override
-    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
-    onCreate(db);
-    }
-
-    public boolean insertdata(String username ,String password,String mail)
-    {
-        SQLiteDatabase db = this.getWritableDatabase();
-        ContentValues cv= new ContentValues();
-        cv.put(col1,username);
-        cv.put(col2,password);
-        cv.put(col3,mail);
-
-        long res=db.insert(tablename,null,cv);
-        if(res==-1)
-            return false;
-        else
-            return true;
-
-    }
-    Cursor retriving()
-    {
-        SQLiteDatabase db =this.getWritableDatabase();
-        Cursor c =db.rawQuery("select * from "+tablename,null);
-        return c;
-
-    }
-
-}
diff --git a/app/src/main/java/com/example/chan24/smartplanner/LoginActivity.java b/app/src/main/java/com/example/chan24/smartplanner/LoginActivity.java
index 1ef1a7bf15b38e3674e70af20602c3cbc0900aa2..93ad074c3ff1e72346d3fdae445fef28d479b556 100644
--- a/app/src/main/java/com/example/chan24/smartplanner/LoginActivity.java
+++ b/app/src/main/java/com/example/chan24/smartplanner/LoginActivity.java
@@ -2,8 +2,7 @@
 package com.example.chan24.smartplanner;
 
 import android.content.Intent;
-import android.database.Cursor;
-import android.support.v7.app.AlertDialog;
+import android.support.annotation.NonNull;
 import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.view.View;
@@ -13,16 +12,22 @@ import android.widget.EditText;
 import android.widget.TextView;
 import android.widget.Toast;
 
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+
 
 public class LoginActivity extends AppCompatActivity {
-    DatabaseHelper db =new DatabaseHelper(this);
+
+    FirebaseAuth firebaseAuth;
 
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_login);
-        final EditText name = (EditText)findViewById(R.id.name);
+        final EditText name = (EditText)findViewById(R.id.email);
         final EditText password = (EditText)findViewById(R.id.password);
         final Button login = (Button)findViewById(R.id.login);
         final TextView register = (TextView)findViewById(R.id.reg);
@@ -34,35 +39,35 @@ public class LoginActivity extends AppCompatActivity {
 
             }
         });
-        Button b =(Button)findViewById(R.id.login);
-        b.setOnClickListener(new View.OnClickListener() {
+        login.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
 
-                    //StringBuffer str =new StringBuffer();
-                int flag=1;
                 String n=name.getText().toString();
                 String p =password.getText().toString();
-                    Cursor res=db.retriving();
-                    while(res.moveToNext())
-                    {
-                        if(n.equals(res.getString(0)))
-                        {
-                            if(p.equals(res.getString(1)))
-                            {
-                                flag =0;
-                                Intent i =new Intent(getApplicationContext(),UserArea.class);
-                                i.putExtra("name",n);
-                                startActivity(i);
-                            }
+
+                if (n.isEmpty()){
+                    Toast.makeText(getApplicationContext(),"Enter Name",Toast.LENGTH_SHORT).show();
+                    return;
+                }
+                else if (p.isEmpty()){
+                    Toast.makeText(getApplicationContext(),"Enter Password",Toast.LENGTH_SHORT).show();
+                    return;
+                }
+
+                firebaseAuth.getInstance().signInWithEmailAndPassword(n, p).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
+                    @Override
+                    public void onComplete(@NonNull Task<AuthResult> task) {
+                        if (task.isSuccessful()) {
+                            finish();
+                            startActivity(new Intent(getApplicationContext(), UserArea.class));
                         }
+                        else{
+                            Toast.makeText(getApplicationContext(),"Enter correct credentials or register and try again!",Toast.LENGTH_SHORT).show();
 
+                        }
                     }
-                    if(flag==1)
-                    {
-                        Toast.makeText(getApplicationContext(),"Enter proper details",Toast.LENGTH_SHORT).show();
-                    }
-
+                });
 
 
             }
diff --git a/app/src/main/java/com/example/chan24/smartplanner/ProfileActivity.java b/app/src/main/java/com/example/chan24/smartplanner/ProfileActivity.java
index 5c98ea097c079b3ea0c77a2762ded00800559901..19d1e7580989b61e78e79a0a25512973e10c4840 100644
--- a/app/src/main/java/com/example/chan24/smartplanner/ProfileActivity.java
+++ b/app/src/main/java/com/example/chan24/smartplanner/ProfileActivity.java
@@ -1,7 +1,6 @@
 package com.example.chan24.smartplanner;
 
 import android.content.Intent;
-import android.support.annotation.IntegerRes;
 import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.view.View;
@@ -9,23 +8,22 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
-import android.widget.TextView;
-import android.widget.Toast;
+
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
 
 
 public class ProfileActivity extends AppCompatActivity {
-    public String str="";
-    DatabaseHelper2 db=new DatabaseHelper2(this);
+    FirebaseAuth firebaseAuth;
+    FirebaseUser user;
+    DatabaseReference databaseReference;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_profile);
-        Intent i =getIntent();
-        str=i.getStringExtra("Name");
-
-        TextView uname = (TextView)findViewById(R.id.userName);
-        uname.setText(str);
 
         Button cancel =(Button)findViewById(R.id.cancel);
         cancel.setOnClickListener(new View.OnClickListener() {
@@ -44,25 +42,18 @@ public class ProfileActivity extends AppCompatActivity {
         EditText phone  = (EditText)findViewById(R.id.phone);
         RadioButton selectedRadioButton;
 
-            int selectedId = gender.getCheckedRadioButtonId();
-
-            selectedRadioButton = (RadioButton)findViewById(selectedId);
-            //Toast.makeText(getApplicationContext(), selectedRadioButton.getText().toString()+" is selected", Toast.LENGTH_SHORT).show();
-
-
-
-
-        int a= Integer.parseInt(age.getText().toString());
-        int p = Integer.parseInt(phone.getText().toString());
-        boolean res =db.insertdata(selectedRadioButton.getText().toString(),a,p);
-        if(res) {
-            //Toast.makeText(this, "Inserted ", Toast.LENGTH_SHORT).show();
-            Intent i2 =new Intent(getApplicationContext(),UserArea.class);
-            //i2.putExtra("Name",str);
-            startActivity(i2);
+        int selectedId = gender.getCheckedRadioButtonId();
+        selectedRadioButton = (RadioButton)findViewById(selectedId);
+        String a= age.getText().toString();
+        String p=phone.getText().toString();
+        String g= selectedRadioButton.getText().toString();
 
-        }
 
+        databaseReference = FirebaseDatabase.getInstance().getReference();
+        user = firebaseAuth.getCurrentUser();
 
+        databaseReference.child("Profile").child(user.getUid()).child("Age").setValue(a);
+        databaseReference.child("Profile").child(user.getUid()).child("Gender").setValue(g);
+        databaseReference.child("Profile").child(user.getUid()).child("Phone").setValue(p);
     }
 }
diff --git a/app/src/main/java/com/example/chan24/smartplanner/RegisterActivity.java b/app/src/main/java/com/example/chan24/smartplanner/RegisterActivity.java
index f77c70783983d496ba24b21fe3c7ef2f4fffd2fb..00eff6d9f97d4a861a77d90110cae44e7dcc2c99 100644
--- a/app/src/main/java/com/example/chan24/smartplanner/RegisterActivity.java
+++ b/app/src/main/java/com/example/chan24/smartplanner/RegisterActivity.java
@@ -1,8 +1,7 @@
 package com.example.chan24.smartplanner;
 
 import android.content.Intent;
-import android.database.Cursor;
-import android.support.v7.app.AlertDialog;
+import android.support.annotation.NonNull;
 import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.view.View;
@@ -10,33 +9,86 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.Toast;
 
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+
 public class RegisterActivity extends AppCompatActivity {
-    DatabaseHelper db= new DatabaseHelper(this);
+
+    private FirebaseAuth firebaseAuth;
+    private DatabaseReference databaseReference;
+    private String m;
+    private String p;
+    private String u;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_register);
-        //final EditText user = (EditText)findViewById(R.id.user);
-        //final EditText pass = (EditText)findViewById(R.id.pass);
-        //final EditText mail = (EditText)findViewById(R.id.mail);
-        //final Button signup =(Button)findViewById(R.id.signup);
 
-    }
-    public void signup(View view)
-    {
-        EditText user = (EditText)findViewById(R.id.user);
-        EditText pass = (EditText)findViewById(R.id.pass);
-        EditText mail = (EditText)findViewById(R.id.mail);
+        databaseReference= FirebaseDatabase.getInstance().getReference().child("Profile");
 
-        boolean res =db.insertdata(user.getText().toString(),pass.getText().toString(),mail.getText().toString());
-        if(res) {
-            //Toast.makeText(this, "Inserted ", Toast.LENGTH_SHORT).show();
-            Intent i =new Intent(getApplicationContext(),LoginActivity.class);
-            startActivity(i);
-        }
 
+        final EditText user = (EditText)findViewById(R.id.user);
+        final EditText pass = (EditText)findViewById(R.id.pass);
+        final EditText mail = (EditText)findViewById(R.id.mail);
+        final Button signup =(Button)findViewById(R.id.signup);
 
-    }
+        signup.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                u = user.getText().toString();
+                p = pass.getText().toString();
+                m = mail.getText().toString();
+
+                if (u.isEmpty()){
+                    Toast.makeText(getApplicationContext(),"Enter Name",Toast.LENGTH_SHORT).show();
+                    return;
+                }
+                else if (p.isEmpty()){
+                    Toast.makeText(getApplicationContext(),"Enter Password",Toast.LENGTH_SHORT).show();
+                    return;
+                }
+
+                else if (m.isEmpty()){
+                    Toast.makeText(getApplicationContext(),"Enter Password",Toast.LENGTH_SHORT).show();
+                    return;
+                }
+
+                firebaseAuth = FirebaseAuth.getInstance();
+                firebaseAuth.createUserWithEmailAndPassword(m, p).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
+                    @Override
+                    public void onComplete(@NonNull Task<AuthResult> task) {
+                        if (task.isSuccessful()) {
+                            //init cond
+                            databaseReference = FirebaseDatabase.getInstance().getReference();
+                            FirebaseUser user = firebaseAuth.getCurrentUser();
 
+                            databaseReference.child("Profile").child(user.getUid()).child("Username").setValue(u);
+                            databaseReference.child("Profile").child(user.getUid()).child("Password").setValue(p);
+                            databaseReference.child("Profile").child(user.getUid()).child("Email").setValue(m);
+                            databaseReference.child("Profile").child(user.getUid()).child("Age").setValue("");
+                            databaseReference.child("Profile").child(user.getUid()).child("Gender").setValue("");
+                            databaseReference.child("Profile").child(user.getUid()).child("Phone").setValue("");
+
+
+
+
+                            Toast.makeText(RegisterActivity.this, "Registration Successful", Toast.LENGTH_SHORT).show();
+                            finish();
+                            startActivity(new Intent(getApplicationContext(), LoginActivity.class));
+                        }
+                        else {
+                            Toast.makeText(RegisterActivity.this, "Registration Failed", Toast.LENGTH_SHORT).show();
+                        }
+                    }
+                });
+
+            }
+        });
+    }
 }
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
index 864b7b162ca6ce356644040b7cd14ff603aebd6d..15f60b6face5fd9e75457b34f83981a1b57c7049 100644
--- a/app/src/main/res/layout/activity_login.xml
+++ b/app/src/main/res/layout/activity_login.xml
@@ -11,23 +11,23 @@
     tools:context="com.example.chan24.smartplanner.LoginActivity">
 
     <EditText
+        android:id="@+id/email"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:inputType="textPersonName"
-        android:ems="10"
         android:layout_alignParentTop="true"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="59dp"
-        android:id="@+id/name"
-        android:hint="Username" />
+        android:ems="10"
+        android:hint="Email"
+        android:inputType="textPersonName" />
 
     <EditText
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:inputType="textPassword"
         android:ems="10"
-        android:layout_below="@+id/name"
-        android:layout_alignEnd="@+id/name"
+        android:layout_below="@+id/email"
+        android:layout_alignEnd="@+id/email"
         android:layout_marginTop="52dp"
         android:id="@+id/password"
         android:hint="Password" />