COURSE 1 – INTRODUCTION TO ANDROID MOBILE APPLICATION DEVELOPMENT QUIZ ANSWERS

Week 3: Building the App 

Meta Android Developer Professional Certificate

Complete Coursera Answers & Study Guide

Enroll in Coursera Meta Android Developer Professional Certification

Building the App INTRODUCTION

In this module, you will explore how to create a video player app in Android Studio, from project planning to project launch.

Learning Objectives

  • Discuss the benefits of project planning for development and examine a project overview
  • Demonstrate how to use a template in Android Studio to create a base project
  • Discuss the different layouts available, the creation of an XML file for the Main Activity of an Android app and additional imports
  • Demonstrate how to use the URI path to locate video files and how to declare and display variables
  • Demonstrate the functional code and create and launch the video player project using the VideoView class
  • Discuss the different layouts available and the creation of an XML file for the Main Activity of an Android app

PRACTICE QUIZ: KNOWLEDGE CHECK: PROJECT SETUP

1. ______________ is the main building block for a user interface (UI) in Android.

  • Layout
  • View (CORRECT)
  • TextView

Correct! View is the main building block for a user interface in Android.

2. Which of the following is one of the most often used User Interface components in Android?

  • ImageView (CORRECT)
  • Navigator
  • KeyboardView

That’s correct! The ImageView is used to display an image on an app user interface.

3. True or False: A VideoView class can be used to play video files in Android. 

  • True (CORRECT)
  • False

That’s correct! VideoView class can be used to play video files in Android. 

4. A layout used to render Child View elements one after the other, either horizontally or vertically, is called _______________?

  • LinearLayout (CORRECT)
  • ConstraintLayout
  • TableLayout

That’s correct! LinearLayout is a ViewGroup subclass, used to render child View elements one after the other either horizontally or vertically based on the orientation property specified

5. The View which allows you to display scrollable lists of items in a single column is called________________?

  • RecyclerView (CORRECT)
  • TableLayout 
  • WebView

That’s correct! RecyclerView with LinearLayoutManager is used to display scrollable lists of items in a single column.

6. What questions should you consider during the Requirements Gathering phase when developing an app? Select all that apply.

  • What platforms, libraries and packages will you use to develop the app? (CORRECT)
  • What kind of file formats will the app have to read? (CORRECT)
  • Will the app use files stored locally on the device or access them from another place? (CORRECT)
  • What kind of controls do you need to include in the app? (CORRECT)

That’s right. This will allow you to configure your development environment and ensure you have all the tools required.

That’s right. Knowing this allows you to ensure you have the correct codecs to allow the files to be played.

That’s right. This allows you to assess how much storage to allocate for the videos.

That’s right. Knowing this will allow you to prepare a user interface as well as plan out the functionality you will need.  

7. You haven’t started with your video player app yet, but you do know some things about the project already. Which of the following statements are true? Select all that apply.    

  • Your app will need an extra button because you will need to be able to select a video from the phone library. (CORRECT)
  • You can create the play and stop buttons by using a clickable Button (CORRECT)
  • The app doesn’t need to be able to stream video (CORRECT)

That’s correct! Your app won’t stream video so you need a button to be able to select a video from the phone library.

That’s correct! You can create the play and stop buttons by using a clickable Button. 

That’s correct! Your app doesn’t need to stream video as it will access a local video file

8. Is the following statement true or false: When you want to update your app you should change the application ID.

  • True
  • False (CORRECT)

Correct! The application ID uniquely identifies your app so you should never change it. If you make any changes, the Google Play Store will see it as a different app.

9. Which of the following statements are correct? Select all that apply. 

  • Layouts comprise Views and ViewGroups  (CORRECT)
  • A View Group contains one or more other Views (CORRECT)
  • Views are also called objects  (CORRECT)
  • A View cannot hold an image  

That’s right. Layouts define the structure of UI components with different Views and ViewGroups.

That’s right. View Group is used to define how Views will be arranged on the android screen. That’s right. A View is Android’s built-in View class which is used to create a View and is then referred to as an object. 

10. How should you create a folder for resources like video files that you want to upload to your project?

  • Right-click on the Res folder, go to New and select New Android Resource Directory.
  • Right-click on the Res folder, go to New and select Directory.  (CORRECT)

That’s right. Android recognizes all files saved in the Android Resources Directory as resources and assigns unique IDs to each item. These IDs help android identify a resource whenever a developer needs to reference it. 

MODULE QUIZ: BUILDING THE APP

1. Which class is designed to hold one or more views that will display elements like text and buttons to the user.

  • View
  • ImageView
  • ViewGroup (CORRECT)

That’s correct. ViewGroup is a special use of the View class because it can contain one or more Views, such as text and buttons.

2. Which of the following is a valid way of setting a value to a variable?

  • var firstName = “Michael”  (CORRECT)
  • String firstName = Michael    

Correct! This is a valid way of setting a value to a variable.    

3. Which of the following is an example of a View class provide by the Android framework? 

  • Select all that apply.
  • ImageView (CORRECT)
  • ImageButton (CORRECT)
  • TextView (CORRECT)

Correct! ImageView is an example of an Android View.

Correct! Button is an example of an Android View.    

Correct! TextView is an example of an Android View.  

4. ScrollView helps to display content that is larger than the size of the screen.    

  • Yes (CORRECT)
  • No

Correct! Scroll View helps you to display content that is larger than the size of the screen.    

5. What is an Android layout editor?    

  • An interface builder used to create user interface (UI) screens for Android applications (CORRECT)
  • An interface builder used for creating user stories required for developing android apps 

Correct! An Android layout editor is an interface builder used to create UI screens for Android applications.    

6. What is a ViewGroup sub-class used to display items in rows and columns called?  

  • ConstraintLayout
  • FrameLayout    
  • RecyclerView (CORRECT)

Correct! RecyclerView with GridLayoutManager is a ViewGroup sub-class used to display items in a grid view of rows and columns.

7. ____________________ is used to display scrollable lists of items in a single column.    

  • RecyclerView (CORRECT)
  • TextView
  • RelativeView  

Correct! RecyclerView with LinearLayoutManager is used to display scrollable lists of items in a single column.    

8. Which Kotlin function allows you to display the value of a variable in a console?    

  • init()    
  • println() (CORRECT)
  • display()    

Correct! Println() allows you to display the value of a variable in a console.

9. Is the following statement true or false? URI is a built-in package that comes with Android SDK and it allows you to reference the location of a file.     

  • True (CORRECT)
  • False  

That’s correct! It can reference either a file that’s already in your application folder or one that’s on a user’s device.  

10. You are developing an app and need to create a variable of which the value will change during user interaction. What keyword do you need to use to declare this variable?      

  • val    
  • var (CORRECT)
  • You can use val and var 

That’s correct! If you declare a variable using the var keyword, the value can be changed later in the code.         

11. There are several basic configurations that have to be in place before your video player will work. Which of the following allows the video to start immediately?     

  • requestFocus (CORRECT)    
  • mediaController    
  • onCreate    

That’s correct! This function allows the video to start immediately and then focus on the controller.     

PRACTICE QUIZ: SELF-REVIEW: CREATE THE PLAYER

1. Did you add the video file to the Android project?

  • Yes (CORRECT)
  • No

The video file is added to the Android project.    

2. Does your video player show any video playing?

  • Yes (CORRECT)
  • No

Your video player should be able to play any video and you should be able to view the video.   

3. Does the video player show without the controllers such as play and pause?     

  • Yes
  • No (CORRECT)

The video should contain controllers such as play and pause.    

Coursera Meta Android Developer Professional Certificate Answers and Study Guide

Liking our content? Then don’t forget to ad us to your bookmarks so you can find us easily!

Weekly Breakdown | Meta Study Guides | Back to Top

FINAL GRADED ASSESSMENT: INTRODUCTION TO ANDROID MOBILE APPLICATION DEVELOPMENT

1. Which of the following allows developers to start a new Android project with a set of default project directories and files?

  • Gradle
  • AVD manager
  • Android software development kit (SDK) (CORRECT) 

Correct! The Android SDK includes a complete set of development tools for Android. It’s easy to start a new Android project with a set of default project directories and files. 

2. What is the name given to Google’s official IDE (Integrated Development Environment) for building apps that run on Android operating systems?   

  • Android Studio (CORRECT)
  • Android Virtual Device (AVD) Manager    
  • Android Software Development Kit (SDK) 

That’s correct! Android Studio is Google’s official IDE used for building apps that run on Android operating systems.    

3. True or false: To use Gradle in your app project in Android Studio, you need to install it separately.

  • True
  • False (CORRECT)

That’s correct! To start using Gradle in your app project, you don’t need to install anything as it comes with Android Studio by default.

4. What is used to define all the activities that you are going to create across an Android application?

  • Main Activity
  • Activity folder
  • Activity class
  • Activity tag (CORRECT)

That’s correct! The activity tag is used to define all the activities that you are going to create across your Android application.

5. Which template in Android Studio would you recommend for creating a simple app quickly?

  • Basic Activity (CORRECT)
  • Bottom Navigation Activity
  • Empty Activity

That’s correct! The Basic Activity template in Android Studio allows you to create a base code for your app, including commonly used user interface (UI) components.

6. Which of the major components an Android app is made up of is considered an entry point for users?  

  • Activities (CORRECT)
  • Services
  • Content providers
  • Broadcast receivers

That’s correct! An activity is an entry point for users and represents one thing a user can do in an app. With the help of activities, you can place all your UI components on a single screen. 

7. Which of the following libraries provide a smooth scrolling experience while an image is loading?    

  • Fresco (CORRECT)
  • RetroFit
  • Yaml
  • WebP

That’s correct! Fresco is an image loading library focused on providing a smooth scrolling experience while an image is loading.    

8. True or false: Activity components are effectively the foundation of an app and manage some interactions with the system.    

  • False
  • True (CORRECT)

Correct! Activities provide the most ‘obvious’ parts of application components. They present content users can interact with on the screen.

9. True or false: The Android Configuration files define the behavior of the user interface.    

  • True
  • False (CORRECT)

Correct! Android Configuration files define the project structure.   

10. For more control, you can start the Gradle build system manually through the command line tool in Android Studio. Which Gradle command allows you to see all of the available Gradle operations running in the background?

  • ./gradlew wrapper (CORRECT)
  • ./gradlew clean
  • ./gradlew build

Correct! ./gradlew wrapper allows you to see all of the available Gradle operations running in the background.

11. Imagine you have a large set of data you’d like to display in the form of a vertical list. Which Android layout should you use?

  • ConstraintLayout
  • LinearLayout
  • RecyclerView (CORRECT)

Correct. Recycler View can be used to display sets of data in dynamic lists that can be scrolled. To position the items in the Recycler View in a vertical list, the developer can use the Linear Layout Manager.

12. True or false: Developers can use Java commands, libraries and frameworks in Kotlin projects without any issue.    

  • True (CORRECT)
  • False

That’s correct. An advantage of Kotlin is that it is interoperable with Java. As a result, developers can use Java commands, libraries and frameworks in Kotlin projects without any issue.  

13. ExoPlayer offers an alternative to Android’s MediaPlayer API to play audio and video in an app.    

  • True (CORRECT)
  • False

That’s correct! ExoPlayer is an Android media player library built by Google. It offers an alternative to Android’s MediaPlayer API to play audio and video locally or online with some additional advantages.    

14. Which of the following is a valid way of setting a value to a variable in Kotlin? 

  • var firstName: String = “Michael” (CORRECT)
  • var firstName: String = Michael    

Correct! This is a valid way of setting a value to a variable.    

15. TextView, ImageView and ImageButton are all examples of what in Android Studio?

  • Functions
  • Project templates
  • Views (CORRECT)

Correct! TextView, ImageView and ImageButton are all building blocks of the user interface called Views, which are a sub-class of the parent View in Android Studio.

17.  The Android Studio main window is comprised of different sections. In which sections will warnings or messages be displayed?

  • Status bar (CORRECT)
  • Toolbar
  • Editor window
  • Tool windows

That’s correct. The status bar displays the status of your project and the IDE itself, as well as any warnings or messages.

18. The Kotlin compiler allows you to convert code in any language to Kotlin code.

  • False
  • True (CORRECT)

That’s correct! You can convert Java code to Kotlin with a single click.

19. What language are Android layouts written in?

  • Kotlin
  • Java
  • XML (CORRECT)

That’s correct! Android layouts are written in XML.

20. In Kotlin, which keyword should you use to declare a variable with a value that you want to change later on in the code?

  • Val
  • Var (CORRECT)

Correct! When you declare a variable using the var keyword, the value can be changed later in the code.

21. Which of the following is true of a ViewGroup in Android Studio?

  • A ViewGroup represents a rectangular area of the screen and is used for displaying information.
  • A ViewGroup defines layout in which views will be arranged on the Android screen. (CORRECT)
  • A ViewGroup is a special view that can contain one or more other views. (CORRECT)

Correct. ViewGroup is used to define the layout in which views will be arranged on the Android screen.

Correct. ViewGroup is a special use of the view class because it can contain one or more other views.

22. When configuring an emulator in Android Studio, you can set the emulated performance for the Android Virtual Device you are creating. What is the purpose of this property?

  • To specify the number of processor cores from your computer’s hardware will be used for the emulated
  • device (CORRECT)
  • To specify the orientation of the emulated device
  • To specify the random access memory (RAM) to set the amount of resources the emulated device will
  • consume on your computer

That’s correct! Emulated performances allows you to specify the number of processor cores from your computer’s hardware that you’d like to use for the emulated device. The more processor cores you use,the faster the emulator.

23. Which function is used to display a variable on screen in Kotlin?

  • printline()
  • print()
  • println() (CORRECT)

Correct! To display a variable on screen in Kotlin, you use a print line function, like many other programming languages.

24. Do layouts created in Android always have a .xml extension?

  • Yes (CORRECT)
  • No

Correct! A layout file always has .xml extension when created, for example, the activity_main.xml file.

25. Which function in Android Studio is responsible for initializing the actions of the activity when your app is run?

  • println()
  • onStart()
  • onCreate() (CORRECT)

That’s correct! The onCreate() function is called when your app is run. Its role is to create the view and initialize the actions of the Activity

26. Imagine you are developing an Android mobile app. You can use Android OS images to (select all that apply):

  • Test your app against different operating system versions (CORRECT)
  • To improve user experience (CORRECT)
  • Leverage the built-in features of any operating system in the market (CORRECT)

That’s right. For example, you can download the most recent Android OS image or even an older OS image, and then run your app on the emulator to test it against these different operating systems.      

That’s right. OS images can help you understand the dynamics of each operating system by replicating the experience of an actual device. This is one factor that can improve or enhance user experience or UX.      

That’s right. Through OS images, you can enjoy the built-in features of an operating system using the application programming interface or API level.    

Interactive CSS CONCLUSION

TBW

Subscribe to our site

Get new content delivered directly to your inbox.

Liking our content? Then, don’t forget to ad us to your BOOKMARKS so you can find us easily!