Beruflich Dokumente
Kultur Dokumente
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.
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!
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
Customize the appearance of your app to create a sleek and pleasant experience for your user
● 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
Resources:
Submission