Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

project by using Java programming langauge for Android Studio : Piggy Bank Child

ID: 3852335 • Letter: P

Question

project by using Java programming langauge for Android Studio : Piggy Bank Children's App Application title: Piggy Bank Children's App Purpose: A piggy bank app allows children to enter the number of quarters, dimes, nickels, and pennies that they have. The child can select whether to save the money or spend it. Calculate the amount of money and display the amount that the child is saving or spending. Create two screens: a welcome screen and an input/output screen. Algorithms: A welcome screen displays the title, image, and button that takes the user to a second screen. The input/output screen requests the number of quarters, dimes, nickels, and pennies. A Spinner control should indicate whether the children are saving or spending their coins. Create your own layout. The results display how much the child is saving or spending. Conditions: Use a theme, Spinner prompt, string array, and Hint property.

Explanation / Answer

package ca.javajeff.w2a; import android.app.Activity; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; public class W2A extends Activity { AnimationDrawable androidAnimation; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView androidImage = (ImageView) findViewById(R.id.android); androidImage.setBackgroundResource(R.drawable.android_animate); androidAnimation = (AnimationDrawable) androidImage.getBackground(); final Button btnAnimate = (Button) findViewById(R.id.animate); View.OnClickListener ocl; ocl = new View.OnClickListener() { @Override public void onClick(View v) { androidAnimation.stop(); androidAnimation.start(); } }; btnAnimate.setOnClickListener(ocl); } }