Android App Development Basics
9 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Where can you store sounds in an Android app?

  • java folder
  • assets folder
  • res/drawable folder
  • res/raw folder (correct)

The Design Activity has no similarities with the Play Activity.

False (B)

What is the name of the function that draws the board and the cars in the Design Activity?

onDrawingRequested

You can find free sounds in many pages like ______________________.

<p><a href="https://freesound.org/">https://freesound.org/</a></p> Signup and view all the answers

What is the purpose of the drawMessage function?

<p>To display messages to the user (B)</p> Signup and view all the answers

The view model has a list of levels in the Design Activity.

<p>True (A)</p> Signup and view all the answers

What is the name of the function that is called when the car is grabbed?

<p>startCarSound</p> Signup and view all the answers

In the Design Activity, the list of buttons is stored in the ______________________.

<p>view model</p> Signup and view all the answers

Match the following sounds with their corresponding functions:

<p>Car is moved = startCarSound Car is freed = stopCarSound Level is completed = playVictorySound</p> Signup and view all the answers

Study Notes

Android App Development

  • The app will have a main activity that shows buttons to choose between the Play Activity and the Design Activity.
  • The app will follow a unidirectional data flow and use a view model, and possibly a repository to store levels.
  • A repository will be used to store levels, initially as a list, which can be replaced with a database later.
  • It's recommended to use packages to group related files, with one package for each activity, one for the repository, and one for common classes.

Initial Preparations

  • Create a new project using the "Empty Views Activity" template.
  • Change the package name to es.uji.alXXXXXX.freemycar.
  • Add the line "maven("https://jitpack.io")" to the settings.gradle.kts file.
  • Add the line "id("com.google.devtools.ksp") version "1.9.22-1.0.17" apply false" to the build.gradle.kts file.
  • Add the necessary dependencies to the build.gradle.kts file, including VJ1229 Framework, viewModels, Room, and ViewModelScope.

Touch Events

  • The TouchProcessor class can be used to ignore clicks on other objects.
  • The disableGlobalClick function can be used to disable the effect.
  • The removeObject function can be used to eliminate objects from the touch processor.
  • The Transformation and TouchProcessor classes can be combined to handle touch events.

Car, Level, and Button Classes

  • The Car class will implement the TouchProcessor.Object interface.
  • The Car class can have attributes such as boolean values for horizontal/vertical orientation and red car status.
  • The Level class is a wrapper for a list of cars, board dimensions, and level number.
  • The Level class can have a function to draw a message based on the view model state.

Sound

  • The app will have two sounds: one for car movement and one for the red car exiting.
  • The sounds can be stored in the res/raw folder.
  • The Play Activity will have functions to start, stop, and play victory sounds.

Design Activity

  • The Design Activity can be started once the Play Activity is finished.
  • The Car, Level, and Button classes can be shared between the two activities.
  • The onDrawingRequested function can be used to draw the board, cars, and buttons in the Design Activity.
  • The view model will have a list of levels and buttons that can be updated dynamically.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Learn the fundamentals of Android app development, including the use of interfaces, view models, and unidirectional data flow. This quiz covers the basics of building an Android app with a main activity, repository, and more.

More Like This

Android App Development Quiz
48 questions

Android App Development Quiz

LionheartedWisdom4273 avatar
LionheartedWisdom4273
User Interaction in Mobile Apps
5 questions
IT2010 Mobile App Development Module
37 questions
Use Quizgecko on...
Browser
Browser