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
<dependency> | |
<groupId>com.cloudinary</groupId> | |
<artifactId>cloudinary-android</artifactId> | |
<version>1.20.0</version> | |
</dependency> |
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
public class MainActivity extends AppCompatActivity { | |
private FirebaseAuth mAuth; | |
private EditText password; | |
private EditText email; | |
private Button button_register; | |
private Button button_login; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
public void RegisterUser(){ | |
String Email = email.getText().toString().trim(); | |
String Password = password.getText().toString().trim(); | |
if (TextUtils.isEmpty(Email)){ | |
Toast.makeText(this, "A Field is Empty", Toast.LENGTH_SHORT).show(); | |
return; | |
} | |
if (TextUtils.isEmpty(Password)){ | |
Toast.makeText(this, "A Field is Empty", Toast.LENGTH_SHORT).show(); | |
return; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.example.ekene.freestyle.MainActivity"> | |
<LinearLayout | |
android:layout_marginTop="50dp" |
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
public class ProfileActivity extends AppCompatActivity { | |
private FirebaseAuth mAuth; | |
private FirebaseUser user; | |
private TextView Email; | |
private TextView Uid; | |
private Button logout; | |
@Override |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.example.ekene.freestyle.MainActivity"> | |
<LinearLayout |
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
public class LoginActivity extends AppCompatActivity { | |
private EditText email; | |
private EditText password; | |
private FirebaseAuth mAuth; | |
private FirebaseUser currentUser; | |
private Button button; | |
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
public void LoginUser(){ | |
String Email = email.getText().toString().trim(); | |
String Password = password.getText().toString().trim(); | |
mAuth.signInWithEmailAndPassword(Email, Password) | |
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { | |
@Override | |
public void onComplete(@NonNull Task<AuthResult> task) { | |
if (task.isSuccessful()){ | |
currentUser = mAuth.getCurrentUser(); | |
finish(); |