Skip to content

todsdev/JAVA-WhatsApp-Clone

Repository files navigation

WhatsApp Clone

Demo

  • In this application, the user is able to exchange messages and photos, which can be from gallery or your own camera, between the registered members
  • Create groups with your selected contacts and interact with all of them at she same time
  • Customize your profile editing your name and your photo, which will be displayed for your contacts

This application was written in JAVA language using Android Studio. It uses Google Firebase as database, saving messages, photos and user information in there.



Tags

Android Studio Firebase JAVA WhatsApp


Demo

Demo

  • Registration and Login using email and password authenticated by Google Firebase!

Demo

  • Update your profile with your name and photo!
  • Choose from your internal gallery or just take a photo!

Demo

  • Chat with your friends and send them photos using your camera!

Demo

  • Also chat with your group friends and send them photos using your camera!
  • Create and edit your group in your way!

Code Example

public void registerUser(User user){
        auth = FirebaseSettings.getFirebaseAuth();
        auth.createUserWithEmailAndPassword(user.getEmail(), user.getPassword())
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        try {
                            String idUser = Base64Custom.codifyBase64(user.getEmail());
                            user.setId(idUser);
                            user.save();
                        } catch (Exception e){
                            e.printStackTrace();
                        }
                        if (task.isSuccessful()){
                            Toast.makeText(RegisterActivity.this, "Sucesso ao cadastrar usuário!",
                                    Toast.LENGTH_SHORT).show();
                            UserFirebase.updateUserName(user.getName());
                            finish();
                        } else {
                            String exception = "";
                            try {
                                throw task.getException();
                            } catch (FirebaseAuthWeakPasswordException e){
                                exception = "Digite uma senha mais forte";
                            } catch (FirebaseAuthInvalidCredentialsException e){
                                exception = "Digite um email válido";
                            } catch (FirebaseAuthUserCollisionException e){
                                exception = "Esse e-mail já foi utilizado";
                            } catch (Exception e) {
                                exception = "Erro ao cadastrar usuário: " + e.getMessage();
                                e.printStackTrace();
                            }
                            Toast.makeText(RegisterActivity.this, exception, Toast.LENGTH_SHORT).show();
                        }
                    }
                });
    }

Example of the code needed to register the user in the Google Firebase platform and avoid the exceptions of the registration, such as Week Password, Invalid Email, Already Registered Email and any other possibilities.


Libraries


Contributors

About

JAVA WhatsApp Clone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages