social login

Below is a complete Android Sign‑Up form with Social Login (Google / Facebook) built using Java and XML.
The layout uses Material Design components (TextInputLayout), includes email, password, name fields, a sign‑up button, and two social login buttons with icons.
The Java activity handles input validation, a dummy registration method, and click listeners for social login (with Firebase Auth stubs for easy integration).


1. XML Layout – activity_signup.xml

2. Java Activity – SignUpActivity.java

Social Login Icons
Place vector drawables in res/drawable/:

  • ic_google.xml (Google logo)
  • ic_facebook.xml (Facebook logo)
  • ic_app_logo.xml (your app’s logo)

If you don’t have them, you can use Android Studio’s Vector Asset tool to import Material icons or brand logos.


4. Dependencies (build.gradle)

Add these to your app‑level build.gradle:

5. Notes & Customization

  • Social login – the provided code contains stubs. To make them work, follow the official Firebase guides for Google Sign-In and Facebook Login.
  • Validation – currently checks for non‑empty fields, email format, password length (≥6), and matching passwords.
  • Navigation – after successful sign‑up, the user is directed to MainActivity. Change the intent as needed.
  • Profile update – you can call FirebaseUser.updateProfile() to store the user’s name.
  • Error handling – all errors are shown as floating hints on the TextInputLayout fields.