Question

Android Problem Using JAVA Problem: You need to create an app on Android Studios that allows...

Android Problem Using JAVA

Problem:
You need to create an app on Android Studios that allows users to register and login into the system. The focus of this project is for you to create an app with several activities and has data validation.
You should have for your app:

  • A welcome screen (splash screen) with your app name and a picture.
  • You should then move to a screen that asks the user for either to log in or to register.
  • If the user clicks the registration page, the registration page should have fields for at least first name, family name, date of birth, email, and a password.
  • Validate that the entered data is not empty.
  • Check that the entered data is correct (such as email validation, first name should at least 3 char and not more than 30)
  • If registration successful return to the previous screen.
  • Enable login (it doesn’t have to be linked to a database at this stage)You need to add comments to your code (Java and XML).
  • You need to have a nice design.
  • Make sure that you test your app at least on two different devices (phone and tablet) and for portrait and landscape modes.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

*****Main Activity XML******

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorBlue"
    tools:context=".MainActivity" >

    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="25dp"
        android:paddingBottom="25dp"
        android:paddingLeft="20dp"
        android:padding="10dp"
        android:textColor="@color/colorAccent"
        android:textStyle="bold"
        android:layout_marginTop="55dp"
        android:text="05 reantle Service Welcome You..." />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="25dp"
        android:textStyle="bold"
        android:textColor="@color/colorPrimaryDark"
        android:layout_marginTop="105dp"
        android:padding="15dp"
        android:paddingRight="15dp"
        android:paddingBottom="20dp"
        android:text="Book Your Bike and Car here" />

    <Button
        android:id="@+id/log_in"
        android:layout_width="200dp"
        android:layout_height="80dp"
        android:layout_marginTop="250dp"
        android:textColor="@color/colorWhite"
        android:textSize="30dp"
        android:textStyle="bold"
        android:textColorLink="@color/colorAccent"
        android:textColorHighlight="@color/colorPrimaryDark"
        android:background="@color/colorPrimary"
        android:text="sign in" />

    <Button
        android:id="@+id/signup"
        android:layout_width="200dp"
        android:layout_height="80dp"
        android:layout_marginTop="250dp"
        android:layout_marginLeft="212dp"
        android:textColor="@color/colorWhite"
        android:textSize="30dp"
        android:textStyle="bold"
        android:textColorLink="@color/colorAccent"
        android:textColorHighlight="@color/colorPrimaryDark"
        android:background="@color/colorPrimary"
        android:text="sign up" />
</RelativeLayout>

*****Log_in XML*****

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/back"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        app:srcCompat="@drawable/ellipse1" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="45dp"
        app:srcCompat="@drawable/reantel" />

    <EditText android:id="@+id/input_email"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="160dp"
        android:textSize="20dp"
        android:inputType="textEmailAddress"
        android:hint="Email" />

    <EditText android:id="@+id/input_password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="210dp"
        android:inputType="textPassword"
        android:hint="Password"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Attempt Left"
        android:id="@+id/attempt"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginTop="260dp"
        android:textSize="25dp" />

    <TextView
        android:id="@+id/forgot"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Forgot Password?"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginTop="262dp"
        android:layout_marginLeft="240dp"
        android:textSize="20dp" />


    <Button
        android:id="@+id/button"
        android:layout_width="210dp"
        android:layout_height="55dp"
        android:layout_marginTop="315dp"
        android:layout_marginLeft="100dp"
        android:background="#47A891"
        android:text="sign in"
        android:textSize="29dp"/>


    <TextView
        android:id="@+id/link_signup"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="380dp"
        android:text="No account yet? Create one"
        android:gravity="center"
        android:textSize="22dip"/>


</RelativeLayout>

*****XML of SignUp*******

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorRed"
    tools:context=".MainActivity">


    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        app:srcCompat="@drawable/ellipse1" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="45dp"
        app:srcCompat="@drawable/reantel" />

    <EditText
        android:id="@+id/input_name"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:hint="Name"
        android:inputType="textPersonName"
        android:layout_marginTop="130dp"
        />

    <EditText
        android:id="@+id/input_faname"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:hint="Father's Name"
        android:inputType="textPersonName"
        android:layout_marginTop="185dp"
        />


    <EditText
        android:id="@+id/input_email"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:hint="Email"
        android:layout_marginTop="239dp"
        android:inputType="textEmailAddress"
        />



    <EditText
        android:id="@+id/input_password"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:hint="Password"
        android:layout_marginTop="290dp"
        android:inputType="textPassword"/>

    <EditText
        android:id="@+id/input_reEnterPassword"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:hint="Re-enter Password"
        android:layout_marginTop="339dp"
        android:inputType="textPassword"/>

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="530dp"
        android:layout_marginLeft="65dp"
        android:textStyle="bold"
        android:textColor="@color/colorWhite"
        android:textSize="35dp"
        android:background="@drawable/button_back"
        android:text="Sign up" />

    <Button
        android:id="@+id/cal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="400dp"
        android:text="DOB"
        android:textStyle="bold"
        android:shadowColor="@color/colorRed"
        android:textSize="25dp"/>

<ProgressBar
    android:id="@+id/progressBar"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_marginTop="550dp"
    android:visibility="gone"/>

</RelativeLayout>

****Splash Screen XML*****

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >


    <WebView
        android:id="@+id/web"
        android:layout_width="390dp"
        android:layout_height="100dp"
        android:layout_marginTop="250dp"/>
</RelativeLayout>

****Splash Screen Java code*****

package com.example.allgoods;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;

public class MainActivity extends AppCompatActivity {
    WebView web;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        web = (WebView)findViewById(R.id.web);
        web.loadUrl("file:///android_res/raw/reantel.png");
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent in = new Intent(MainActivity.this,(write your own next activity ).class);
                startActivity(in);
                finish();
            }
        },1000);
    }

    @Override
    public void onBackPressed() {

    }
}}

*****java class of DOB***

import android.app.DatePickerDialog;
import android.app.Dialog;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import java.util.Calendar;

public class DatePick extends DialogFragment {
    @NonNull
    @Override
    public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
        Calendar c = Calender.getInstance();
        int year =  c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        int day = c.get(Calendar.DAY_OF_MONTH)
        return new DatePickerDialog(getActivity(),(DatePickerDialog.OnDateSetListener)getActivity(),year,month,day);
    }
}

********Code of DOB*****

package com.example.allgoods;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;

import android.app.DatePickerDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;

import java.text.DateFormat;
import java.util.Calendar;

public class MainActivity extends AppCompatActivity implements DatePickerDialog.OnDateSetListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
     Button but = (Button)findViewById(R.id.button); 
     but.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View view) {
             DialogFragment datePicker = new DatePickerFragment();
             datePicker.show(getSupportFragmentManager(),"date picker");
         }
     });
    }

    @Override
    public void onDateSet(DatePicker datePicker, int year, int month, int day) {
        Calendar c =  Calendar.getInstance();
        c.set(Calendar.YEAR, year);
        c.set(Calendar.MONTH, month);
        c.set(Calendar.DAY_OF_MONTH, day);
        String currentDateString = DateFormat.getDateInstance(DateFormat.FULL).format(c.getTime());
    }
}

*****Code of signup*******

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.util.Patterns;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

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

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;

import static android.widget.Toast.LENGTH_SHORT;


public class SignUp extends AppCompatActivity {

    String name,number,password,re_password,email;
    EditText et_name, et_number, et_pass, re_pass, et_email,faname;
    ImageView sign_up;
    TextView login;
    ProgressBar progressBar;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sign_up);

        
        progressBar = (ProgressBar)findViewById(R.id.progressBar)
        et_name = (EditText) findViewById(R.id.input_name);
        faname = (EditText)findViewById(R.id.input_faname);
        et_pass = (EditText) findViewById(R.id.input_password);
        re_pass = (EditText) findViewById(R.id.input_reEnterPassword);
        et_email = (EditText) findViewById(R.id.input_email);
login = (TextView) findViewById(R.id.link_login);
login.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        Intent login = new Intent(SignUp.this, Signin.class);
        startActivity(login);
        finish();
        overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
    }
});
sign_up.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        if(validate()){
            
            String email = et_email.getText().toString().trim();
            String password = et_pass.getText().toString().trim();
if(task.isSuccessful()){
                        //sendEmailVerification();
                        sendUserData();
                        
                        Toast.makeText(SignUp.this, "Successfully Registered, Upload complete!", Toast.LENGTH_SHORT).show();
                        finish();
                        startActivity(new Intent(SignUp.this, Signin.class));
                    }else{
                        Toast.makeText(SignUp.this, "Registration Failed", Toast.LENGTH_SHORT).show();
                    }

                }
            });
        }
    }
});

     login.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View view) {
             startActivity(new Intent(SignUp.this, Signin.class));
         }
     });

 }



 private Boolean validate(){
     Boolean result = false;

     name = et_name.getText().toString();
     password = et_pass.getText().toString();
     email = et_email.getText().toString();
     faname= et_faname.getText().toString();
     re_password= re_pass.getText().toString();


     if(name.isEmpty() || password.isEmpty() || email.isEmpty() || faname.isEmpty() || re_password.isEmpty()){
         Toast.makeText(this, "Please enter all the details", Toast.LENGTH_SHORT).show();
     }else{
         result = true;
     }

     return result;
 }


             @Override
             public void onComplete(@NonNull Task<Void> task) {
                 if(task.isSuccessful()){
                     sendUserData();
                     Toast.makeText(SignUp.this, "Successfully Registered, Verification mail sent!", Toast.LENGTH_SHORT).show();
                     
                     finish();
                     startActivity(new Intent(SignUp.this, Log_nin.class));
                 }else{
                     Toast.makeText(SignUp.this, "Verification mail has'nt been sent!", Toast.LENGTH_SHORT).show();
                 }
             }
         });
     }
 }
Add a comment
Know the answer?
Add Answer to:
Android Problem Using JAVA Problem: You need to create an app on Android Studios that allows...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using Android Studios. Scenario: You recently started working as the mobile app developer for a University...

    Using Android Studios. Scenario: You recently started working as the mobile app developer for a University and have been assigned to build a mobile app that calculates the students' grade. Your app should contain following screens: Screen 1 Labels for subject1, subject2, and subject3 Textboxes for subject1, subject2, and subject3 Labels for MaxGrade, MinGrade, and Avg.Grade Submit button Once user clicks submit button, you need to display letter grade in a label Screen 2 Screen that allows students to register...

  • This assignemnt for Android development using Java Weather Forecaster App Goal: Create an app to display...

    This assignemnt for Android development using Java Weather Forecaster App Goal: Create an app to display a weather forecast for the user’s current location Create the app titled Weather Forecaster The first screen will have a textbox for the user to enter a zip code and a button to submit When the user enters the zip code and clicks the button, the app will navigate to the weather forecast screen. The weather forecast screen will show the current weather for...

  • Hi, I am trying to create a simple android app using spinners. It need not be...

    Hi, I am trying to create a simple android app using spinners. It need not be very complex. The app should allow the user to use a simple spinner to select a team from the following list of teams (Kansas City Chiefs, New England Patriots, New Orleans Saints, and the Los Angeles Rams), once the user selects the team they wish to view, the app should display a small paragraph of information (hardcoded) To the screen for the user to...

  • I need help developing this app using java in android studio Assignment: Tic-Tac-Toe app User interface...

    I need help developing this app using java in android studio Assignment: Tic-Tac-Toe app User interface Operation The app allows the user to play a game of Tic-Tac-Toe. The user can click the New Game button at any time to start a new game. The app displays other messages to the user as the game progresses such as (1) whose turn it is, (2) if a player wins, and (3) if the game ends in a tie. Specifications The app...

  • Sample project -Android Studio connected with Sqlite databse or by using Mysql also . create an...

    Sample project -Android Studio connected with Sqlite databse or by using Mysql also . create an sign-in app where students could login with ( student id and password) register with ( name ,student id and password,email) also the possiblity for the student to change his password . that app must be connected to your database DO NOT ANSWER BY SENDING A CODE WRITING BUT WITH A SCREENSHOTS OF YOUR WORK WITH ALL DETAILS INSIDE .

  • (Android Studio) Create a camera app that allows the user to upload a picture from their...

    (Android Studio) Create a camera app that allows the user to upload a picture from their phone camera gallery, see the picture via summary page, and edit the picture as well. Clicking on "Insert picture here from camera photo gallery" in the add page will allow the user to upload a picture from their existing camera photo gallery on their phone. The user can choose where to save the picture, starting with Picture 1-5. Once they choose where to save...

  • (Android Studio) (Mobile App Development) Create a spinner that has drop down function on it (NOT...

    (Android Studio) (Mobile App Development) Create a spinner that has drop down function on it (NOT tab view). Place a scroll bar inside the dropdown of the spinner. The categories inside the spinner include: vegetable, fruit, meat, drink. Clicking on each section will pop up a fragment section below. Here, I clicked on the vegetable section, which leads me to a page displaying vegetables and their expiration dates. Note: Post XML and Java codes for both the main activity and...

  • Using AndroidStudio Create a mobile app UI that has the following labels and textboxes. Customer Name...

    Using AndroidStudio Create a mobile app UI that has the following labels and textboxes. Customer Name Customer ID Customer Address The mobile app UI should also contain a Submit button. The following validation should be executed as soon as user clicks the Submit button. Customer ID should be between 0-1000. If user enters any value above 1000, then you need to display an error message. Customer Name should not contain any numeric characters. If user enters customer name with numbers,...

  • Android / Java / Please Upload your homework. Copy the screenshot and then paste it to...

    Android / Java / Please Upload your homework. Copy the screenshot and then paste it to this word document. Then zip your word file and java files. Note: if your android project is too big, you can just zip all of the needed xml files and java files. Computer-Assisted Instruction App) Create an app that will help an elementary school student learn multiplication. Select two positive one-digit integers. The app should then prompt the user with a question, such as...

  • Create an application in Visual Studios 2015 that displays the result of dividing the larger of...

    Create an application in Visual Studios 2015 that displays the result of dividing the larger of two numbers entered by the user by the smaller one. You can not label entries of one must the larger on the user interface. You must use your known logic to determine which number is larger of the two entered by the user to perform your calculations. ¢ If the smaller number is 0, the application should display the message "Cannot divide by 0"...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT