Sie sind auf Seite 1von 4

Write a Fully Functional Android App and Publish to the

Play Store (Paycheck Calculator) (7 hrs)

Paycheck Calculator App


Understand the Problem

Last week we had our first adventure in Android Programming. You were able to learn the
basics of using android studio and creating a simple app layout. This week we will build and
move on to programming a fully functional android app from start to finish. The app will preform
calculations, receive user input, allow multiple choice user selection, button submission, and
result display. Lastly theres the extra credit option to export and publish your work to the google
play store to be downloaded by the public!

The problem: A simple Paycheck calculator which accepts the users: hours worked, unpaid
break length, number of breaks, and payrate. The calculation code will subtract the break
amount from the hours worked, calculate the rough California tax amount and deduct it from the
pre tax income and display the results.

Here are the phases:

1. Use last weeks knowledge to create the specified app layout with text, buttons, and user
input.
2. Customize the appearance of your app creating a sleek look by changing text color,
background and top header.
3. Write variable declarations and calculation code inside the MainActivity.Java file. Provide
verification for all inputs to be used. Run and test your code through the custom emulator
you created last week
4. Extra Credit: Export your app by generating a signed APK and upload it through the
Google Developer Console ($25 registration fee). Provide the necessary information and
publish your App to be downloaded!

Phase 1: Layout display


For this phase we will set up a Linear Layout for the app and insert all of our items into the
layout.

To change your layout to linear go to your XML text view and change the preexisting layout to:

<LinearLayout
Keep all the code that is inside the layout tags
</LinearLayout>
.
● Insert the following items into the LinearLayout
1. TextView to ask user for hours worked
2. Number (Decimal) Edit text field to accept input
3. TextView to ask for length of unpaid breaks
4. Insert two Radio Button select options for the user to chose either 30mins or an
Hour
■ *Hint* you’ll need an appropriate container to place these in
5. Number (Decimal) Edit text field to accept input
6. TextView to ask user for number of breaks
7. Number Edit text field to accept input
8. TextView to ask user for pay rate
9. Number (Decimal) Edit text field to accept input
10. Submit button to activate calculation
11. TextView to display calculation result
■ figure out how to leave the TextView empty until it is provided with the
calculation result

Phase 2: Layout design

Customize the appearance of your app to create a sleek and pleasant experience for your user

● Add the following aspects to your layout design


1. Remove the Activity bar
■ *Hint* you will need this code in your MainActivty.Java file to completely
remove the activity bar
■ getSupportActionBar().hide();
2. Add a top Header to display the app title
■ Use at least one provided or imported image
3. Choose at least a two color scheme other than black and white to use for your
background and text color
4. Figure out how to change the launcher display icon inside Android Studio
■ Choose from provided images or create your own icon.
5. Inset padding in the LinerLayout by editing your XML file.

Phase 3: Interactive Android Programming

● The android java code will include the following:


1. the main calculation formula
■ This should be easy to figure out from the problem description
2. Declaring your various item declarations in the MainActivity Class. You will need
one for each item you placed in your LinearLayout
■ Ex. android.widget.EditText hours, breaks, payrate;
3. Double Variable declarations to hold the values of the converted string user input
4. Sync your item declarations with the actual item I.D.s using the findViewById
function
5. attach an OnClickListner to your submit button
6. Using the function public void onClick(android.view.View v)
■ Insert your calculation code
■ Use an If Else statement from users radio button submission.
■ convert the user input Strings into the delecared Double variables to
interact with the data
■ display the result to the result TextView using a “$” in front

● Beside variable declarations all other code will be placed inside the protected void
onCreate function.
● Provide input submission checking to require all fields be used.

​Testing
● Use sample inputs like
○ (hours) 72.5
○ (30 min checked)
○ (breaks) 9
○ (pay rate) 13
■ Output should be: $689.52
● Leave one or more of the 3 EditText fields empty
○ Is their an error message

Phase 4: (Extra Credit) Export and Publish to Google


Play Store
It’s important in learning a skill that you enjoy the reward of your work. This last phase will do
just that. Your first published App! You can show all your friends and have them download it to
their phones.

● Export your app for release in the form of a signed APK


○ Under “Build” > “Generate signed APK"
● Register ($25 fee) with an existing or new Google Account through the Google
Developer Console
● Once registered, Create an application and fill out all required info to save for the draft
● After your draft is completed, edit your release through the App Releases section where
you will upload your APK file
● You will need to fill out information under “Content Rating” and “Pricing and Distribution"
before you can publish your App to the store.
● Once those are complete go back to the App Releases section and publish the first
version of your App to the store
● Processing can take up to 1hr or more
● Once published you can access and download your app from the Google Play Store!

Resources:

● Calculator tutorial - ​https://www.youtube.com/watch?v=kp0DefpSMYw&t=768s


○ This will provide the foundation for preforming calculation code in the activity,
interacting with display items and user input, and click listening for your submit
button
● Generate signed APK - ​https://www.youtube.com/watch?v=iH5Pawyw1n4
● Publish app to GPS - ​https://www.youtube.com/watch?v=vIusIlp6YGE

Submission

● Two Files minimum.


● Zip up the folder that was created from the Android App and submit it
● Provide a screenshot of multiple outputs using the phone emulator
● Extra Credit - Submit a screenshot of your Play Store product

Das könnte Ihnen auch gefallen