Skip to content

amansharma-dev/Codelabs_ADF_unit1_GetStarted_1.1_HelloWorld_Homework

Repository files navigation

Homework - Android fundamentals 01.1: Android Studio and Hello World

Homework

Build and run an app :

  • Create a new Android project from the Empty Template.
  • Add logging statements for various log levels in onCreate() in the main activity.
  • Create an emulator for a device, targeting any version of Android you like, and run the app.
  • Use filtering in Logcat to find your log statements and adjust the levels to only display debug or error logging statements.

Answer these questions

Question 1

What is the name of the layout file for the main activity?

  • MainActivity.java
  • AndroidManifest.xml
    • activity_main.xml
  • build.gradle

Question 2

What is the name of the string resource that specifies the application's name?

  • app_name
  • xmlns:app
  • android:name
    • applicationId

Question 3

Which tool do you use to create a new emulator?

  • Android Device Monitor
    • AVD Manager
  • SDK Manager
  • Theme Editor

Question 4

Assume that your app includes this logging statement:

Log.i("MainActivity", "MainActivity layout is complete");

You see the statement "MainActivity layout is complete" in the Logcat pane if the Log level menu is set to which of the following? (Hint: multiple answers are OK.)

    • Verbose
  • Debug
  • Info
  • Warn
  • Error
  • Assert

Thank You.