skip to Main Content
The smarter way
to do assignments.

Please note that this is just a preview of a school assignment posted on our website by one of our clients. If you need assistance with this question too, please click on the Order button at the bottom of the page to get started.

Mobile Computing AndroidGoal: Build a simple app that uses two fragments to implement a gift card purchaseand redeem app.Requirements:1) You will have a main Activitya. It will implement the interfaces PurchaseCallBack andRedeemCallback.b. It will have a container for a fragment that covers the bottom part ofthe screen.c. It will have two text views –i. The first will display “# cards purchased worth ##.##”ii. The second will display “# cards redeemed worth ##.##”2) There will be a model GiftCardModel that will be a singleton.a. It will have instance variables for Number of gift cards purchased,Number of gift cards redeemed, the total purchased value, the totalredeemed value and a static inner class GiftCard that has two instancevariables amount and redeemed (Boolean). The model will maintainan ArrayList that will record the status of all giftcards.b. It will have the following methods.c. purchaseCard(double amount) – will add a Gift Card to the list andDisplay a toast message with code (position in the list) of the card andthe amount. Update the number purchased and total purchased.d. Boolean redeemCard( int code) – will check to make sure that the codeis a legal position and if it is set redeemed to true. Display a toastmessage with the code and indicate success or failure. If success, thetoast message should report that. If the redeem worked, update thecount and total.3) It will have a PurchaseCardFragment that is a subclass of Fragment.a. It will have a button to purchase a card.b. It will have an EditText where you will be able to enter an amount.Make sure it is of a number type.c. It will have a button that will switch to the other fragment(ToRedeem).d. When purchase is pressed, the model will be updated and then anupdate function will be invoked with the activity.4) It will have a RedeemFragment that is a subclass of Fragment.a. It will have a button to redeem a card.b. It will have an EditText where you will be able to enter a code. Makesure it is of a number type.c. It will have a button that will switch to the other fragment(toPurchase).d. When redeem is pressed, the model will be updated and then anappropriate update function will be invoked with the activity.5) The PurchaseCallBack interface will have two methods.a. Void update() – Will get the values from the model and set the text inthe main activities text views.b. Void swapToRedeem() – change the two fragments so theRedeemFragment is shown.6) The RedeemCallBack interface will have two methods.a. Void update() – Will get the values from the model and set the text inthe main activities text views.b. Void swapToPurchase() – change the two fragments so thePurchaseFragment is shown.c.7) The app should be tested properly and should not crash in any scenario.a. Make sure on creation that you get a reference to your model andupdate the display using the handy update CallBack function.b. Make sure to only create the Fragments the first onCreate is called.Bonus:Ø Add a currency option that allows the user to purchase using a differentcurrency and then convert to dollars.Ø Add a fragment with buttons to allow the purchase of a gift card for 5, 10 25and 50 dollars.Ø Move the swap button from the fragments to the main activity. You will wantto get the fragments by their tags and then determine which one is hidden.Ø Add a fragment that will display the GiftCard arraylist contents/status usinga RecyclerView or a ListFragment.Ø Add checking and round the amount entered by the user to the nearestpenny. (I.E if they enter 12.455, round that up to 12.46)Ø Change the Model to a ViewModel.Ø Change the purchase fragment so that the person can enter a message andstore that as a string in the GiftCard class. Display the message in the Redeemfragment on redemption.Ø Change the purchase fragment so that the person can enter a hidden code.Store that as an integer in the GiftCard class. When redeeming a code,require both codes for a successful redemption.Ø Use colors to enhance the app.Ø Add appropriate images for the buttons.Ø Change the display to use images in an interesting way.Note: There is lot of scope for improvement in the application. So use yourcreativity and beautify the application.

GET HELP WITH THIS ASSIGNMENT TODAY

Clicking on this button will take you to our custom assignment page. Here you can fill out all the additional details for this particular paper (grading rubric, academic style, number of sources etc), after which your paper will get assigned to a course-specific writer. If you have any issues/concerns, please don’t hesitate to contact our live support team or email us right away.

How It Works        |        About Us       |       Contact Us

© 2018 | Intelli Essays Homework Service®

Back To Top