Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .gradle/5.4.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/5.4.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/5.4.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/5.4.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/5.4.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/5.4.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
<activity
android:name=".ProfileActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".ForgotPasswordActivity"
<activity
android:name=".ForgotPasswordActivity"
android:screenOrientation="portrait" />
</application>

Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/com/example/login/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
Expand All @@ -19,6 +20,8 @@
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;

//import android.widget.Toolbar;

Expand All @@ -38,12 +41,15 @@ public class MainActivity extends AppCompatActivity {

FirebaseAuth firebaseAuth;

DatabaseReference databseUser;

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

databseUser = FirebaseDatabase.getInstance().getReference("userx");

FirebaseAuth firebaseauth = FirebaseAuth.getInstance();
FirebaseUser firebaseUser = firebaseauth.getCurrentUser();
if(firebaseUser != null){
Expand All @@ -69,6 +75,26 @@ protected void onCreate(Bundle savedInstanceState) {
signup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

String name = fullname.getText().toString();
String aadhar = aadharno.getText().toString();
String phn = phone.getText().toString();
String add = address.getText().toString();
String passwd = password.getText().toString();
String mail = email.getText().toString();
if(!TextUtils.isEmpty(name)&&!TextUtils.isEmpty(aadhar)&&!TextUtils.isEmpty(phn)&&!TextUtils.isEmpty(add)
&&!TextUtils.isEmpty(passwd)&&!TextUtils.isEmpty(mail)){

String idx = databseUser.getKey();

user User = new user(idx,name,aadhar,phn,add,passwd,mail);

databseUser.child(aadhar).setValue(User);

Toast.makeText(MainActivity.this,"Added",Toast.LENGTH_LONG).show();
}else{
Toast.makeText(MainActivity.this,"Field is empty",Toast.LENGTH_LONG).show();
}
progressBar.setVisibility(View.VISIBLE);
firebaseAuth.createUserWithEmailAndPassword(email.getText().toString(), password.getText().toString()).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
Expand Down
51 changes: 51 additions & 0 deletions app/src/main/java/com/example/login/user.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.example.login;

public class user {

String id2;
String name2;
String aadhar2;
String phn2;
String add2;
String mail2;
String passwd2;

public user(){ }

public user(String id2,String name2, String aadhar2, String phn2, String add2, String passwd2, String mail2) {
this.name2 = name2;
this.aadhar2 = aadhar2;
this.phn2 = phn2;
this.add2 = add2;
this.passwd2 = passwd2;
this.mail2 = mail2;
}

public String getName2() {
return name2;
}

public String getAadhar2() {
return aadhar2;
}

public String getPhn2() {
return phn2;
}

public String getAdd2() {
return add2;
}

public String getId2() {
return id2;
}

public String getMail2() {
return mail2;
}

public String getPasswd2() {
return passwd2;
}
}
4 changes: 2 additions & 2 deletions local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Thu Jan 16 19:31:35 IST 2020
sdk.dir=C\:\\Users\\Sonu\\AppData\\Local\\Android\\Sdk
#Thu Jan 16 19:50:00 IST 2020
sdk.dir=E\:\\AndroidStudio SDK