Skip to content

kant146/Guftgo

Repository files navigation

Guftgo

Hi there,

Website Instagram Badge 

I am krishnakant !!

here trying give you my best , appreciate my work.

This is a video Calling Android Application in Java.

Guftgu is free and useful messaging , chatting, meeting, streaming, watching and listening app with your friends and family or many more uses. Get access to the world and connect to your friends with the brand new mesenger app.

App download link

https://lnkd.in/g3-5PWu

Create room and call everyone

Connect with me:

Linkedin Badge Instagram Badge Hashnode Badge 
Medium Badge  Youtube Badge  Facebook Badge 

Webp net-resizeimage Webp net-resizeimage (1) Webp net-resizeimage (2) Webp net-resizeimage (3) Webp net-resizeimage (4)

some usefull elements

  1. LoginActivity

package com.example.guftgo;

import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity;

import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.view.View; 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;

public class LoginActivity extends AppCompatActivity {

EditText emailBox, passwordBox;
Button loginBtn, signupBtn;

FirebaseAuth auth;

ProgressDialog dialog;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    dialog = new ProgressDialog(this);
    dialog.setMessage("Please wait...");

    auth = FirebaseAuth.getInstance();

    emailBox = findViewById(R.id.emailBox);
    passwordBox = findViewById(R.id.passwordBox);

    loginBtn = findViewById(R.id.loginbtn);
    signupBtn = findViewById(R. id.createbtn);


    loginBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            dialog.show();
            String email, password;
            email = emailBox.getText().toString();
            password = passwordBox.getText().toString();

            auth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    dialog.dismiss();
                    if (task.isSuccessful())
                    {
                        startActivity(new Intent(LoginActivity.this, DashboardActivity.class));
                    } else {
                        Toast.makeText(LoginActivity.this, task.getException().getLocalizedMessage(), Toast.LENGTH_SHORT).show();
                    }
                }
            });
        }
    });

    signupBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(LoginActivity.this, SignupActivity.class));
        }
    });

}

}

2.SignupActivity package com.example.guftgo;

import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent; import android.os.Bundle; import android.view.View; 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.OnSuccessListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.firestore.FirebaseFirestore;

public class SignupActivity extends AppCompatActivity {

FirebaseAuth auth;
EditText emailBox, passwordBox, nameBox;
Button loginBtn, signupBtn;

FirebaseFirestore database;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_signup);

    database = FirebaseFirestore.getInstance();
    auth = FirebaseAuth.getInstance();

    emailBox = findViewById(R.id.emailBox);
    nameBox = findViewById(R.id.namebox);
    passwordBox = findViewById(R.id.passwordBox);

    loginBtn = findViewById(R.id.loginbtn);
    signupBtn = findViewById(R. id.createbtn);

    signupBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            String email, pass, name;
            email = emailBox.getText().toString();
            pass = passwordBox.getText().toString();
            name = nameBox.getText().toString();

            User user = new User();
            user.setEmail(email);
            user.setPass(pass);
            user.setName(name);

            auth.createUserWithEmailAndPassword(email, pass).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (task.isSuccessful()) {
                        database.collection("Users")
                                .document().set(user).addOnSuccessListener(new OnSuccessListener<Void>() {
                            @Override
                            public void onSuccess(Void aVoid) {
                                startActivity(new Intent(SignupActivity.this, LoginActivity.class));
                            }
                        });
                        Toast.makeText(SignupActivity.this,  "Account is created", Toast.LENGTH_SHORT).show();
                    } else {
                        Toast.makeText(SignupActivity.this, task.getException().getLocalizedMessage(), Toast.LENGTH_SHORT).show();
                    }
                }
            });

        }
    });
}

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages