Shorr H Android Development 2025-26-Period 3 Assignments
- Instructor
- Mr. Garrett Shorr
- Term
- 2025-2026 School Year
- Department
- Mathematics
- Description
-
Upcoming Assignments
Due:
Requirements:
View Binding is enabled and you are using the binding notation when referencing widgets. Example:
binding.buttonMainSong.setOnClicklistener { }
noteMap is implemented
playSong is a suspend function
a coroutine is used to launch the playSong function
Max Value: 85% with no challenge completed (note challenge must be your original work. plagiarism is plagiarism even outside of English & Social Studies classes).
Max Value 100% with a challenge completed.
Submit the following:
A pdf of your MainActivity.kt and activity_main.xml done through the print menu item. If you added your own songs via json, include those as well.
View Binding is enabled and you are using the binding notation when referencing widgets. Example:
binding.buttonMainSong.setOnClicklistener { }
noteMap is implemented
playSong is a suspend function
a coroutine is used to launch the playSong function
Max Value: 85% with no challenge completed (note challenge must be your original work. plagiarism is plagiarism even outside of English & Social Studies classes).
Max Value 100% with a challenge completed.
Submit the following:
A pdf of your MainActivity.kt and activity_main.xml done through the print menu item. If you added your own songs via json, include those as well.
Past Assignments
Due:
Download and unzip the SoundboardStarter project and open it in Android Studio. Follow along with the questions in the google doc and answer them in a different color.
I've attached a zip with sounds for a full piano, if you want more than the 2 octaves I've provided. They are listed by key number and you'll have to figure out which key number matches up with each note.
The only thing that is due is the 4 questions.
I've attached a zip with sounds for a full piano, if you want more than the 2 octaves I've provided. They are listed by key number and you'll have to figure out which key number matches up with each note.
The only thing that is due is the 4 questions.
Due:
Due Thursday
1. Screenshot of the activity_main.xml layout (with special instructions, see below & video)
Design & Blueprint turned on
Show all constraints turned on
2. print to pdf the activity_main.xml
Combine both into one file.
1. Screenshot of the activity_main.xml layout (with special instructions, see below & video)
Design & Blueprint turned on
Show all constraints turned on
2. print to pdf the activity_main.xml
Combine both into one file.
Due:
Tentatively Due End of Class Monday.
Submission Checklist:
Quiz works and completes without crashing
Score is calculated correctly
Changing the phone language to your chosen second language fully translates the entire app to that language
No hardcoded strings--all strings are in strings.xml
All quiz logic is handled by the Quiz class (i.e. things like score variables are stored in the Quiz class and not the MainActivity)
The program will not crash or otherwise fail to act correctly if it is fed json with different numbers of questions in the appropriate format
Quiz & Question classes have no knowledge of Android-specific functions
Print the following files to a pdf:
MainActivity.kt
Quiz.kt
Question.kt
activity_main.xml
both question.json files
both strings.xml files
Print using the following settings:
JetBrains Mono font size 8
Margins of 0.25 all around
Color Printing
Save as a pdf. Open the pdf and verify it has all the files in it before submitting.
Submission Checklist:
Quiz works and completes without crashing
Score is calculated correctly
Changing the phone language to your chosen second language fully translates the entire app to that language
No hardcoded strings--all strings are in strings.xml
All quiz logic is handled by the Quiz class (i.e. things like score variables are stored in the Quiz class and not the MainActivity)
The program will not crash or otherwise fail to act correctly if it is fed json with different numbers of questions in the appropriate format
Quiz & Question classes have no knowledge of Android-specific functions
Print the following files to a pdf:
MainActivity.kt
Quiz.kt
Question.kt
activity_main.xml
both question.json files
both strings.xml files
Print using the following settings:
JetBrains Mono font size 8
Margins of 0.25 all around
Color Printing
Save as a pdf. Open the pdf and verify it has all the files in it before submitting.
Due:
One thing programmers often do is learn by reading through tutorials. Use the various resources provided in the document to find the answers to the questions and use a different color when answering.
You can work in groups but each turn in an individual document.
You can work in groups but each turn in an individual document.
Due:
Due sometime Friday
1. Start/Stop works & doesn't skip time
2. Maintain state through orientation change
3. Reset should set the time to 0. It's up to you whether or not you keep it running if it were running when clicking reset.
*if it were running, stay running & not skip time
*if it were stopped, stay stopped & not skip time
having a rounding error of 1 second is okay.
To turn this in, we'll use Quicktime screen record to record a movie of the following:
Start
Wait 3 seconds
Stop
Wait 3 seconds
Start
Wait 3 seconds
Stop
Rotate
Wait 3 seconds
Start
Rotate
Wait 3 seconds
Stop
Reset
Start
Wait 3 seconds
Reset
1. Start/Stop works & doesn't skip time
2. Maintain state through orientation change
3. Reset should set the time to 0. It's up to you whether or not you keep it running if it were running when clicking reset.
*if it were running, stay running & not skip time
*if it were stopped, stay stopped & not skip time
having a rounding error of 1 second is okay.
To turn this in, we'll use Quicktime screen record to record a movie of the following:
Start
Wait 3 seconds
Stop
Wait 3 seconds
Start
Wait 3 seconds
Stop
Rotate
Wait 3 seconds
Start
Rotate
Wait 3 seconds
Stop
Reset
Start
Wait 3 seconds
Reset
Due:
Due Wednesday
The bolded sections of the attached document have things for you to write and complete. The non-bolded sections have instructions for you to follow but don't need to have written answers for.
Complete the sections in a different font color so it's easy to see your work inline.
In the video: intro to the stopwatch app, how to use XML and add a chronometer widget, how to override a function through autocomplete, how to make a static constant in kotlin through a companion object.
1. Open the project that we set up github with "Stopwatch".
2. Add Chronometer widget to activity_main.xml through the code view
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chronometer_main_stopwatch"/>
and constraint it in the design view. You can also change the text size to something like 64sp so you can see it more easily.
The bolded sections of the attached document have things for you to write and complete. The non-bolded sections have instructions for you to follow but don't need to have written answers for.
Complete the sections in a different font color so it's easy to see your work inline.
In the video: intro to the stopwatch app, how to use XML and add a chronometer widget, how to override a function through autocomplete, how to make a static constant in kotlin through a companion object.
1. Open the project that we set up github with "Stopwatch".
2. Add Chronometer widget to activity_main.xml through the code view
android:layout_height="wrap_content"
android:id="@+id/chronometer_main_stopwatch"/>
and constraint it in the design view. You can also change the text size to something like 64sp so you can see it more easily.
Due:
Use a different color font to answer the questions directly inline with your copy of the document. We'll have 20 minutes at the start of class on Monday.
For the project itself, these are the features:
Self Destruct Button: Launch a CountDownTimer, change the text on the button with a countdown from 10 to 1 or 0. End the activity upon reaching the end.
Stretch goal: Make the layout blink red, increasingly faster as the timer gets closer to 0. Disable the button after it is pressed.
Useless switch: Turn it on and it automatically turns off x seconds later.
Stretch goal: Randomize the timer. Cancel the timer if it is turned off before the timer is finished.
Look Busy: Hide the regular UI, show the progress bar and the textview
Return the regular UI after the progress bar has finished filling.
For the project itself, these are the features:
Self Destruct Button: Launch a CountDownTimer, change the text on the button with a countdown from 10 to 1 or 0. End the activity upon reaching the end.
Stretch goal: Make the layout blink red, increasingly faster as the timer gets closer to 0. Disable the button after it is pressed.
Useless switch: Turn it on and it automatically turns off x seconds later.
Stretch goal: Randomize the timer. Cancel the timer if it is turned off before the timer is finished.
Look Busy: Hide the regular UI, show the progress bar and the textview
Return the regular UI after the progress bar has finished filling.
Due:
In a google doc, answer the following questions.
Compare your code to the code I've provided and answer the following questions:
1. Do you notice anything different about the content of the onClickListeners?
2. In the code provided, what do you notice about the organization of all the findViewById method calls?
3. In the code provided, where do you notice the logic is for comparing numbers and keeping score?
4. What advantages might there be for separating the game logic from the UI logic?
5. Paste your code from your MainActivity at the bottom.
The kotlin files: https://gist.github.com/gshorrSPHS/8ef08ec44462024540e6d7364ff803ea
Compare your code to the code I've provided and answer the following questions:
1. Do you notice anything different about the content of the onClickListeners?
2. In the code provided, what do you notice about the organization of all the findViewById method calls?
3. In the code provided, where do you notice the logic is for comparing numbers and keeping score?
4. What advantages might there be for separating the game logic from the UI logic?
5. Paste your code from your MainActivity at the bottom.
The kotlin files: https://gist.github.com/gshorrSPHS/8ef08ec44462024540e6d7364ff803ea
Due:
Submit answers in the attached google doc below. (explanation is at the end of the video)
Due:
Please return the signed syllabus by Tuesday, 8/19.
Due:
Complete the attached survey and mark this assignment complete when you are done.
Due:
What are 5 differences that you see in the Main Activity between Kotlin and Java?
Kotlin Code:
package com.example.buttonclicker
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
------
Kotlin vs Java
1. No semicolons
2. no public in the header. public is the default visibility for classes and functions
3. parameter order: varName: DataType
4. Datatype Bundle? vs Bundle ? means could be null
5. no void for return type in kotlin. if you don't specify a return type in kotlin, it is by default Unit (kotlin equivalent to void)
6. When making a subclass or using an interface, kotlin uses : instead of extends/implements
7. fun is the keyword to say you have function
8. override is now mandatory if you want to override a function from the superclass
Kotlin Code:
package com.example.buttonclicker
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
------
Kotlin vs Java
1. No semicolons
2. no public in the header. public is the default visibility for classes and functions
3. parameter order: varName: DataType
4. Datatype Bundle? vs Bundle ? means could be null
5. no void for return type in kotlin. if you don't specify a return type in kotlin, it is by default Unit (kotlin equivalent to void)
6. When making a subclass or using an interface, kotlin uses : instead of extends/implements
7. fun is the keyword to say you have function
8. override is now mandatory if you want to override a function from the superclass