Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If anyone here is a Java and Android Studio expert please I really need help fulfilling the requirements needed to make a Rock Paper Scissors

If anyone here is a Java and Android Studio expert please I really need help fulfilling the requirements needed to make a Rock Paper Scissors game. I mainly need Java code to complete it I will post what I have so far I don't have much time left please if anyone can help me I would really appreciate it. Here's what the app is supposed to do... The player should be able to select either Rock, Paper, or Scissors.The app will randomly select Rock, Paper, or Scissors. The app will compare the results and display the winner. The player can click the play again button to be taken back to the first screen.

Inside of the RockPaperScissorsResultsActivity, wire the button that we placed in the view to an onClickEvent. Then, when the button is clicked, call finish(). This code will close the activity and the previously opened one will be there. Add event handlers for each of the buttons on the MainActivity.

Inside MainActivity, launch RockPaperScissorsResultsActivity for each of the button click events like Paper. Be sure to code the Rock button and Scissors button as well. Create an Application class. Be sure that both of your activities use it. Set the playerSelection for when a user clicks a button. The RockPaperScissorType is an enum. When RockPaperScissorsResult opens, get the player and computer selections and decide the winner. Bind the results to the widgets on the view. Add a clickListener to RockPaperScissorsResultActivity. When we click on the Play Again button, this activity should close and the user should be returned to the original.

activity_main.xml

   

MainActivity.java

package net.androidbootcamp.rockpaperscissors; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }

activity_rock_paper_scissors_results.xml

     

RockPaperScissorsResultsActivity.java

package net.androidbootcamp.rockpaperscissors; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class RockPaperScissorsResultsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_rock_paper_scissors_results); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

What steps should Dynamic Duos owners take immediately?

Answered: 1 week ago