-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b69c4e
commit a069390
Showing
80 changed files
with
1,783 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
androidTest/java/com/project/afinal/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.project.afinal; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.project.afinal", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "672177650007", | ||
"firebase_url": "https://final-74fd5.firebaseio.com", | ||
"project_id": "final-74fd5", | ||
"storage_bucket": "final-74fd5.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:672177650007:android:37b48ce8d44fec45", | ||
"android_client_info": { | ||
"package_name": "com.siddhant.afinal" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "672177650007-dad1eh1k7dapseqenrtfrem18mb8jsi5.apps.googleusercontent.com", | ||
"client_type": 1, | ||
"android_info": { | ||
"package_name": "com.siddhant.afinal", | ||
"certificate_hash": "857f40ed7af21789bea72ccf21e1bdb6349d2e39" | ||
} | ||
}, | ||
{ | ||
"client_id": "672177650007-q9vaf1iqqf9ac1tmr2ejpc5mk5sji3d8.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyCrY7W7gECprEvw6Xd3EtzNZmQ6e1vJYOw" | ||
} | ||
], | ||
"services": { | ||
"analytics_service": { | ||
"status": 1 | ||
}, | ||
"appinvite_service": { | ||
"status": 2, | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "672177650007-q9vaf1iqqf9ac1tmr2ejpc5mk5sji3d8.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
}, | ||
"ads_service": { | ||
"status": 2 | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.project.afinal; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.content.Intent; | ||
import android.view.View; | ||
|
||
import com.siddhant.afinal.Operation; | ||
|
||
|
||
public class Done extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_done); | ||
|
||
} | ||
public void onClick(View view) { | ||
Intent i = new Intent(this, Operation.class); | ||
startActivity(i); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.project.afinal; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.content.Intent; | ||
import android.view.View; | ||
|
||
import com.siddhant.afinal.Info; | ||
|
||
|
||
public class Electrician extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_electrician); | ||
} | ||
public void onClick(View view){ | ||
Intent i = new Intent(this, Info.class); | ||
startActivity(i); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package com.project.afinal; | ||
|
||
import android.app.ProgressDialog; | ||
import android.app.Service; | ||
import android.location.Address; | ||
import android.support.annotation.NonNull; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.text.TextUtils; | ||
import android.util.Log; | ||
import android.content.Intent; | ||
import android.view.View; | ||
import android.widget.Button; | ||
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; | ||
import com.google.firebase.auth.FirebaseUser; | ||
import com.google.firebase.database.DatabaseReference; | ||
import com.google.firebase.database.FirebaseDatabase; | ||
import com.siddhant.afinal.Payment; | ||
|
||
|
||
public class Info extends AppCompatActivity { | ||
|
||
EditText service,address,pincode,phonenumber; | ||
Button p_btn; | ||
FirebaseAuth firebaseAuth; | ||
FirebaseUser User; | ||
|
||
private ProgressDialog mInfoProcess; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_info); | ||
firebaseAuth=FirebaseAuth.getInstance(); | ||
|
||
mInfoProcess = new ProgressDialog(this); | ||
|
||
User=firebaseAuth.getCurrentUser(); | ||
|
||
|
||
service = (EditText)findViewById(R.id.Service); | ||
address=(EditText)findViewById(R.id.Address); | ||
pincode=(EditText)findViewById(R.id.PinCode); | ||
phonenumber=(EditText)findViewById(R.id.PN); | ||
p_btn=(Button)findViewById(R.id.ptp_btn); | ||
|
||
p_btn.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
|
||
|
||
Adddatabase(); | ||
} | ||
|
||
}); | ||
|
||
} | ||
|
||
private void Adddatabase(){ | ||
String ser=service.getText().toString().trim(); | ||
String add=address.getText().toString().trim(); | ||
String pc=pincode.getText().toString().trim(); | ||
String pn=phonenumber.getText().toString().trim(); | ||
if(!TextUtils.isEmpty(ser)||!TextUtils.isEmpty(add)) | ||
{ | ||
|
||
mInfoProcess.setTitle("Signing Up"); | ||
mInfoProcess.setMessage("Please Wait"); | ||
mInfoProcess.setCanceledOnTouchOutside(false); | ||
mInfoProcess.show(); | ||
FirebaseDatabase database= FirebaseDatabase.getInstance(); | ||
DatabaseReference myRef= database.getReference("Q-Taskers"); | ||
myRef.child(User.getUid()).child("Service").setValue(ser); | ||
myRef.child(User.getUid()).child("Address").setValue(add); | ||
myRef.child(User.getUid()).child("Pincode").setValue(pc); | ||
myRef.child(User.getUid()).child("Phone Number").setValue(pn); | ||
Intent i = new Intent(this, Payment.class); | ||
startActivity(i); | ||
|
||
|
||
} | ||
else{ | ||
Toast.makeText(Info.this, "Please fill up the empty fields", Toast.LENGTH_LONG).show(); | ||
} | ||
} | ||
|
||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package com.project.afinal; | ||
|
||
import android.app.ProgressDialog; | ||
import android.support.annotation.NonNull; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.content.Intent; | ||
import android.text.TextUtils; | ||
import android.view.View; | ||
import android.widget.Button; | ||
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; | ||
import com.siddhant.afinal.Operation; | ||
import com.siddhant.afinal.Signup; | ||
|
||
|
||
public class Login extends AppCompatActivity { | ||
|
||
|
||
private TextView mLoginEmail; | ||
private TextView mLoginPassword; | ||
private TextView signup; | ||
private Button mLogin_btn; | ||
|
||
private ProgressDialog mLoginProgress; | ||
|
||
private FirebaseAuth mAuth; | ||
|
||
|
||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_login); | ||
|
||
mAuth = FirebaseAuth.getInstance(); | ||
|
||
mLoginProgress=new ProgressDialog(this); | ||
|
||
mLoginEmail=(TextView)findViewById(R.id.LoginEmail); | ||
mLoginPassword=(TextView)findViewById((R.id.LoginPassword)); | ||
mLogin_btn=(Button)findViewById(R.id.Loginbtn); | ||
|
||
mLogin_btn.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
String Email = mLoginEmail.getText().toString(); | ||
String Password = mLoginPassword.getText().toString(); | ||
|
||
if (!TextUtils.isEmpty(Email) || !TextUtils.isEmpty(Password)) { | ||
|
||
mLoginProgress.setTitle("Logging in"); | ||
mLoginProgress.setMessage("Please Wait"); | ||
mLoginProgress.setCanceledOnTouchOutside(false); | ||
mLoginProgress.show(); | ||
|
||
|
||
loginUser(Email, Password); | ||
|
||
} | ||
else{ | ||
mLoginEmail.setError("Please fill up the credentials"); | ||
} | ||
} | ||
}); | ||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
private void loginUser(String email, String password) { | ||
mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() { | ||
@Override | ||
public void onComplete(@NonNull Task<AuthResult> task) { | ||
if(task.isSuccessful()){ | ||
|
||
mLoginProgress.dismiss(); | ||
Intent i=new Intent(Login.this,Operation.class); | ||
startActivity(i); | ||
finish(); | ||
} | ||
else{ | ||
mLoginProgress.hide(); | ||
Toast.makeText(Login.this, "Invalid Username or Password", Toast.LENGTH_LONG).show(); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
|
||
public void Signup(View view){ | ||
Intent i = new Intent(this, Signup.class); | ||
startActivity(i); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.project.afinal; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.content.Intent; | ||
import android.view.View; | ||
|
||
import com.google.firebase.auth.FirebaseAuth; | ||
import com.google.firebase.auth.FirebaseUser; | ||
|
||
|
||
public class Operation extends AppCompatActivity { | ||
|
||
private FirebaseAuth mAuth; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_operation); | ||
mAuth = FirebaseAuth.getInstance(); | ||
} | ||
@Override | ||
public void onStart() { | ||
super.onStart(); | ||
// Check if user is signed in (non-null) and update UI accordingly. | ||
FirebaseUser currentUser = mAuth.getCurrentUser(); | ||
|
||
if(currentUser==null){ | ||
Intent i = new Intent(this, Login.class); | ||
startActivity(i); | ||
finish(); | ||
} | ||
|
||
} | ||
|
||
|
||
public void onClick(View view) { | ||
Intent i = new Intent(this, Info.class); | ||
startActivity(i); | ||
} | ||
public void EClick(View view) { | ||
Intent i = new Intent(this, Electrician.class); | ||
startActivity(i); | ||
} | ||
} |
Oops, something went wrong.