Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please create a new Coin Calculator Android Java Project in Android Studio using the following directions: make a new Basic Activity project In activity_main.xml :

Please create a new Coin Calculator Android Java Project in Android Studio using the following directions:

  • make a new Basic Activity project
  • In activity_main.xml: please change the FAB's image to the media player
  • In content_main.xml: create a CardView containing a TextView with a String like "Please enter in the coin count", for "Banner" purposes.
  • Create four CardViews, one for each of Penny, Nickel, Dime and Quarter.
    1. Each CardView should contain:
      1. an ImageView of the coin (from drawables provided)
      2. below that, an EditText for the user to type in (numbers only) the amount of that coin
  • Center:
    1. Center horizontally the four coin CardViews in a ConstraintLayout
    2. Center the "Banner" CardView above the four coin cards, as shown. Please put in a margin above it, below the Toolbar.
  • Create a "Status Bar" TextView constrained to the bottom of the window
    1. On app run, it should show SC initially
    2. Once the user clicks on the FAB, it should show the calculation results, as shown above.
  • Create a menu with two items
    1. Clear All
      1. Always shown on Toolbar with an icon of your choice
    2. About
      1. Never shown on Toolbar; java code to run when clicked:
  • Please make sure all Strings, dimensions, etc. are stored in their respective XML files in res/values, not hard-coded in layout XML files, etc.

The app should look like the image below:

image text in transcribed

MVC Model: CoinCounter.java

package com.android.coin_counter;

import com.google.gson.Gson;

public class CoinCounter { private int mCountOfPennies, mCountOfNickels, mCountOfDimes, mCountOfQuarters;

public int getCentsValueTotal () { return getCentsValueOfPennies () + getCentsValueOfNickels () + getCentsValueOfDimes () + getCentsValueOfQuarters (); }

public int getCentsValueOfPennies () { return mCountOfPennies; }

public int getCentsValueOfNickels () { return mCountOfNickels * 5; }

public int getCentsValueOfDimes () { return mCountOfDimes * 10; }

public int getCentsValueOfQuarters () { return mCountOfQuarters * 25; }

public int getCountOfPennies () { return mCountOfPennies; }

public void setCountOfPennies (int countOfPennies) { this.mCountOfPennies = Math.max(0, countOfPennies); }

public void setCountOfPennies (String countOfPennies) { this.mCountOfPennies = (countOfPennies == null || countOfPennies.equals ("")) ? 0 : Integer.parseInt (countOfPennies); }

public int getCountOfNickels () { return mCountOfNickels; }

public void setCountOfNickels (int countOfNickels) { this.mCountOfNickels = Math.max(0, countOfNickels); }

public void setCountOfNickels(String nickels) { this.mCountOfNickels = (nickels == null || nickels.equals ("")) ? 0 : Integer.parseInt (nickels); }

public int getCountOfDimes () { return mCountOfDimes; }

public void setCountOfDimes (int countOfDimes) { this.mCountOfDimes = Math.max(0, countOfDimes); }

public void setCountOfDimes(String dimes) { this.mCountOfDimes = (dimes == null || dimes.equals ("")) ? 0 : Integer.parseInt (dimes); }

public int getCountOfQuarters () { return mCountOfQuarters; }

public void setCountOfQuarters (int countOfQuarters) { this.mCountOfQuarters = Math.max(0, countOfQuarters); }

public void setCountOfQuarters(String quarters) { this.mCountOfQuarters = (quarters == null || quarters.equals ("")) ? 0 : Integer.parseInt (quarters); }

public static String getJSONStringFrom (CoinCounter currentCC) { return new Gson ().toJson (currentCC); }

public String getJSONStringFromThis() { return new Gson ().toJson (this); }

public static CoinCounter getCoinCounterObjectFromJSONString(String currentCC) { return new Gson ().fromJson (currentCC, CoinCounter.class); }

}

need to know how to use android studio to do it (using Java and xml)

Android Emulator - Square_API_29:5556 Android Emulator - Square_API_29:5556 10:33 @ 10:34 Coin Counter CLEAR ALL Coin Counter CLEAR ALL PLEASE ENTER IN THE COIN COUNT: PLEASE ENTER IN THE COIN COUNT: 0 0 0 0 8 6 1 3 SA Total in cents: 123

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

ISBN: 0262660709, 978-0262660709

Students also viewed these Databases questions