To Lecture Notes

IT 372 -- Apr 1, 2026

Review Exercises

  1. What should you name your application for Project 1a?
  2. How do you create a zipfile using Android Studio.
  3. What are some Android API version names?
  4. What are the two source code files that Android Studio creates by default for a new project?
  5. Write a Java method named addNumbers that inputs two values, for example 3 and 5, and returns the string "Sum: 8". Also write a main method to test your addNumbers method.
  6. Create a Java and Kotlin array that contains these strings:
    ibm  oracle  microsoft  google
    
    Print the array using a traditional for loop and a modern for loop.
  7. Recreate the TextDisplay app from Monday's class using these steps:
    1. Name your app Proj1aSmith (which is what you should name your Project 1a application). Replace Smith with your last name.
    2. Change the layout to LinearLayout.
    3. Set the text in the TextView widget to your notable item. I will use this attribute for my textview:
      android:text="You win some, you lose some."
      
    4. To prepare for a second textview that will be the title, set the linear layout so that the textviews will stack vertically. This is done by adding this attribute to the linear layout:
      android:orientation="vertical"
      
    5. Copy and paste the textview so that you have two identical textviews. Change the text of the first textview to "Project 1a: Display Notable Item". The top textview is called the title; the bottom textview is the notable item.
    6. Add top and left margins to the title:
      android:layout_marginTop="20dp"
      android:layout_marginLeft="50dp"
      
    7. Add top and left margins to the notable item textview:
      android:layout_marginTop="200dp"
      android:layout_marginLeft="50dp"
      
    8. Change the background color of the layout to yellow:
      android:background="#FFFF00"
      
    9. Change the text color of the textviews to navy:
      android:textColor="#000080"
      
    10. Change the text size of the title and notable item to 30sp:
      android:textSize="30sp"
      
    11. Move the display text "You win some, you lose some." to the resource file strings.xml. Set its key to notable_item.
    12. Move the title text "Project 1a: Notable Item" to the resource file strings.xml. Set its key to title.
    The resulting layout file and strings resource files will be posted here after class.
  8. What do the XML attribute values match_parent and wrap_content do?
  9. Locate these folders in an Android Studio project:
    app  src  main  java  res
    
  10. Locate these files in an Android Studio project:
    MainActivity.java  activity_main.xml
    

XML Primer

Device Independent Pixels

Some LinearLayout and TextView Attributes

Resource Files

Setting up a Click Event Handler

Projects 1a and 1b

  1. Look again at Project 1a and Project 1b.