Task build.gradle AndroidManifest.xml layout/activity_main.xml layout/activity_game_options.xml layout/fragment_game_options.xml layout/activity_board.xml layout/fragment_board.xml menu/bottom_nav_menu.xml navigation/nav_graph.xml Connect FourGame.java 1. Add the following...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Task build.gradle AndroidManifest.xml layout/activity_main.xml layout/activity_game_options.xml layout/fragment_game_options.xml layout/activity_board.xml layout/fragment_board.xml menu/bottom_nav_menu.xml navigation/nav_graph.xml Connect FourGame.java 1. Add the following to the dependencies a. implementation 'androidx.navigation:navigation-fragment:2.3.5' b. implementation 'androidx.navigation:navigation-ui:2.3.5' 1. Remove the following activity elements a. android:name=".Board" b. android:name=".GameOptions" 1. Modify the activity_main layout a. Ensure attribute android:id has a unique name b. Remove Button element with string Connect Four c. Remove Button element with string Options d. Add element androidx.fragment.app.FragmentContainerView e. Add element com.google.android.material.bottomnavigation.BottomNavigation View 1. Rename activity_game_options.xml to fragment_game_options.xml 2. Ensure the RadioGroup includes attribute android:id with a unique name 3. Ensure tools:context=". GameOptions" is updated to reflect tools:context=.GameOptionsFragment" 1. Rename activity_board.xml to fragment_board.xml 2. Ensure tools:context=".Board" is updated to reflect tools:context=".BoardFragment" 1. Create a bottom navigation menu bottom_nav_menu.xml 2. Add a menu item element for Connect Four, use an icon of choice 3. Add a menu item element for Options, use an icon of choice 1. Create a navigation graph nav_graph.xml 2. Add a fragment element for class BoardFragment and layout fragment_board 3. Add a fragment element for class GameOptionsFragment and layout fragment_game_options 1. Create Java class ConnectFourGame 2. Add member variable board as a two-dimensional integer array, size seven (7) rows and six (6) Board.java BoardFragment.java GameOptions.java columns 3. Define a custom constructor that instantiates the board array 4. Define method newGame to do the following a. Access level modifier: public b. Return type: void c. Parameter list: empty d. Iterate through the 2-d array board to initialize each element to the value zero (0) 5. Define method getState to do the following a. Access level modifier: public b. Return type: String c. Parameter list: empty d. Instantiate and instance of class StringBuilder e. Iterate through the 2-d array board to append each element to the StringBuilder object f. Return the StringBuilder object appending method toString() 1. Refactor class Board to rename it to BoardFragment 2. Modify class BoardFragment to extend class Fragment 3. Add the following members a. Constant GAME_STATE, data type String, initialized to gameState b. Variable mGame, data type ConnectFourGame c. Variable mGrid, data type GridLayout 4. Replace method onCreate with method onCreate View a. View object inflates fragment_board layout b. Instantiate the member variable mGrid to GridLayout unique id in fragment_board c. Iterate through the collection of Button elements to set an on click listener as method on ButtonClick 5. Define method onButtonClick as a stub 6. Override method onSaveInstanceState a. Call method putString on object outState passing arguments i. GAME STATE ii. mGame.getState() 1. Refactor class GameOptions to rename it to GameOptionsFragment GameOptions Fragment.java MainActivity.java Test Cases Test Case 1 Test Case 2 Test Case 3 2. Modify class GameOptions Fragment to extend class Fragment 3. Replace method onCreate with method onCreate View a. View object inflates fragment_game_options layout b. Instantiate an instance of class SharedPreferences c. Select the radio button matching the level selected d. Set the selected radio button so it is checked e. Add a click callback to all radio buttons in the radio group as method onLevelSelected f. Return the View object 4. Update method on LevelSelected to add the following a. Save selected level ID in SharedPreferences 1. Update the MainActivity class to do the following a. Comment out or delete i. on BoardClick ii. on OptionsClick iii. ActivityResultLauncher b. Update method onCreate to do the following i. Instantiate an instance of class BottomNavigation View ii. iii. Instantiate an instance of class NavHostFragment If the NavHostFragment object is not null 1. Instantiate an instance of class NavController 2. Instantiate an instance of class AppBarConfiguration 3. Call static method Navigation UI.setupAction BarWithNavController 4. Call static method Navigation UI.setup WithNavController Test case 1 passes Test case 2 passes Test case 3 passes Source builds with no errors Source runs with no errors Source includes comments Test Cases Test Case 1 Test Case 2 Test Case 3 Action Run application in emulator Click the Options menu item Click the Connect Four menu item Expected outcome The output in the emulator should look similar to Figure 1 The output in the emulator should look similar to Figure 2 The output in the emulator should look similar to Figure 1 11:25 Connect Four ++ Connect Four Options Figure 1 fragment_board 11:25 Options Select Difficulty ++ Connect Four O Easy Medium O Hard Options Figure 2 fragment_game_options Task build.gradle AndroidManifest.xml layout/activity_main.xml layout/activity_game_options.xml layout/fragment_game_options.xml layout/activity_board.xml layout/fragment_board.xml menu/bottom_nav_menu.xml navigation/nav_graph.xml Connect FourGame.java 1. Add the following to the dependencies a. implementation 'androidx.navigation:navigation-fragment:2.3.5' b. implementation 'androidx.navigation:navigation-ui:2.3.5' 1. Remove the following activity elements a. android:name=".Board" b. android:name=".GameOptions" 1. Modify the activity_main layout a. Ensure attribute android:id has a unique name b. Remove Button element with string Connect Four c. Remove Button element with string Options d. Add element androidx.fragment.app.FragmentContainerView e. Add element com.google.android.material.bottomnavigation.BottomNavigation View 1. Rename activity_game_options.xml to fragment_game_options.xml 2. Ensure the RadioGroup includes attribute android:id with a unique name 3. Ensure tools:context=". GameOptions" is updated to reflect tools:context=.GameOptionsFragment" 1. Rename activity_board.xml to fragment_board.xml 2. Ensure tools:context=".Board" is updated to reflect tools:context=".BoardFragment" 1. Create a bottom navigation menu bottom_nav_menu.xml 2. Add a menu item element for Connect Four, use an icon of choice 3. Add a menu item element for Options, use an icon of choice 1. Create a navigation graph nav_graph.xml 2. Add a fragment element for class BoardFragment and layout fragment_board 3. Add a fragment element for class GameOptionsFragment and layout fragment_game_options 1. Create Java class ConnectFourGame 2. Add member variable board as a two-dimensional integer array, size seven (7) rows and six (6) Board.java BoardFragment.java GameOptions.java columns 3. Define a custom constructor that instantiates the board array 4. Define method newGame to do the following a. Access level modifier: public b. Return type: void c. Parameter list: empty d. Iterate through the 2-d array board to initialize each element to the value zero (0) 5. Define method getState to do the following a. Access level modifier: public b. Return type: String c. Parameter list: empty d. Instantiate and instance of class StringBuilder e. Iterate through the 2-d array board to append each element to the StringBuilder object f. Return the StringBuilder object appending method toString() 1. Refactor class Board to rename it to BoardFragment 2. Modify class BoardFragment to extend class Fragment 3. Add the following members a. Constant GAME_STATE, data type String, initialized to gameState b. Variable mGame, data type ConnectFourGame c. Variable mGrid, data type GridLayout 4. Replace method onCreate with method onCreate View a. View object inflates fragment_board layout b. Instantiate the member variable mGrid to GridLayout unique id in fragment_board c. Iterate through the collection of Button elements to set an on click listener as method on ButtonClick 5. Define method onButtonClick as a stub 6. Override method onSaveInstanceState a. Call method putString on object outState passing arguments i. GAME STATE ii. mGame.getState() 1. Refactor class GameOptions to rename it to GameOptionsFragment GameOptions Fragment.java MainActivity.java Test Cases Test Case 1 Test Case 2 Test Case 3 2. Modify class GameOptions Fragment to extend class Fragment 3. Replace method onCreate with method onCreate View a. View object inflates fragment_game_options layout b. Instantiate an instance of class SharedPreferences c. Select the radio button matching the level selected d. Set the selected radio button so it is checked e. Add a click callback to all radio buttons in the radio group as method onLevelSelected f. Return the View object 4. Update method on LevelSelected to add the following a. Save selected level ID in SharedPreferences 1. Update the MainActivity class to do the following a. Comment out or delete i. on BoardClick ii. on OptionsClick iii. ActivityResultLauncher b. Update method onCreate to do the following i. Instantiate an instance of class BottomNavigation View ii. iii. Instantiate an instance of class NavHostFragment If the NavHostFragment object is not null 1. Instantiate an instance of class NavController 2. Instantiate an instance of class AppBarConfiguration 3. Call static method Navigation UI.setupAction BarWithNavController 4. Call static method Navigation UI.setup WithNavController Test case 1 passes Test case 2 passes Test case 3 passes Source builds with no errors Source runs with no errors Source includes comments Test Cases Test Case 1 Test Case 2 Test Case 3 Action Run application in emulator Click the Options menu item Click the Connect Four menu item Expected outcome The output in the emulator should look similar to Figure 1 The output in the emulator should look similar to Figure 2 The output in the emulator should look similar to Figure 1 11:25 Connect Four ++ Connect Four Options Figure 1 fragment_board 11:25 Options Select Difficulty ++ Connect Four O Easy Medium O Hard Options Figure 2 fragment_game_options
Expert Answer:
Answer rating: 100% (QA)
Dynamic process modeling is a type of process modeling that captures timedependent behaviors meaning it takes into account how the process changes ove... View the full answer
Posted Date:
Students also viewed these programming questions
-
Wexpro, Incorporated, produces several products from processing 1 ton of clypton, a rare mineral. Material and processing costs total $80,000 per ton, one-fourth of which is allocated to product X15....
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
Find each limit in Problems 3760. Note that LHpitals rule does not apply to every problem, and some problems will require more than one application of LHpitals rule. lim x 3 x + 3xx - 3 X x + 6x + 9
-
A carpenter on the roof of a building accidentally drops her hammer. As the hammer falls it passes two windows of equal height, as shown in FIGURE 2-39. (a) Is the increase in speed of the hammer as...
-
Use the below table to answer the following questions. Selling price = $28.00 Required: a. Determine the sales volume, fixed cost, and variable cost per unit at the break-even point. b. Determine the...
-
What are the main functions of good environmental management? Which environmental management tools are related to each of these functions? Are there any environmental management tools common to all...
-
Campbell Corporation reports regular taxable income of $210,000 in the current year. Campbell takes into account the following facts when calculating the $210,000 amount. Campbell deducts $100,000...
-
You want you to buy 1.61 million British pounds (GBP) using call options and foreign exchange market. The following four figures provide the market information on the GBP options, which expires in...
-
One way to see whether this procedure will be successful is to split the original data set into two subsets: one subset for estimation and one subset for validation. A regression equation is...
-
What governance standards should be implemented to ensure the accountability of data trusts? in uk referencing.
-
Given the following directed and weighted graph, apply Dijkstra's algorithm to find all shortest paths connecting node A with all the other nodes. When necessary, consider nodes and edges in...
-
A uniform solid cylinder of mass 10 kg can rotate about a frictionless axle through its center O, as shown in the cross-sectional view in the figure. A rope wrapped around the outer radius R 1= 1.0 m...
-
Monthly payment = $694.63 Interest Rate = 8% compounded monthly Mortgage Amount = $90,000 Compute the amortization table for 5 years
-
Discuss a different supporting point and present different proof in each of the three body paragraphs. Your proof can be anecdotal examples, statistics, surveys, studies, and/or other data. You will...
-
4. Given the equation x = 3 cos(y), find the derivative of this equation with respect to x (Hint: Rearrange the equation so that it is equal to y).
-
Translate the sentence into symbolic form. Be sure to define each letter you use. All positive numbers are not less than zero Translate the sentence into symbolic form. Be sure to define each letter...
-
Why is it important to understand the macro-environment when making decisions about an international retail venture?
-
1 kmol of argon gas confined in a cylinder undergoes a change from an initial condition of 10 bar and 250 K to a final condition of 1 bar and 300 K. The gas follows the equation PV = RT. Given that C...
-
For an isothermal reversible change of the system \[ -\Delta A_{T}=W_{\max } \] explain the significance of the preceding equation in the light of Helmholtz free energy.
-
If the internal energy of a substance is considered to be a function of temperature and volume, then show that \[ d U=C_{V} d T+\left(\frac{T \beta}{\alpha}-P ight) d V \]
Study smarter with the SolutionInn App