To Lecture Notes

IT 372 -- Apr 1, 2019

Course Documents

Course Prerequisites

Course Textbook

Course Topics

  1. Brief History of Mobile Computing
  2. Review of Java
  3. Android Studio
  4. Activities
  5. XML files
  6. LinearLayout
  7. The Activity Lifecycle
  8. Intents and multiactivity apps
  9. ConstraintLayout and other layouts
  10. Widgits: toggle button, switch, radio button, spinner, scroll view, toast, image view
  11. Using sqlite in Apps
  12. Other topics

Brief History of Mobile Computing

Android Versions

Android Development

Java Review Quiz

  1. What is the size in bytes of each of these datatypes?
    int  double  char  boolean
    
    Ans: 4; 8; 2; 1
  2. Write a for loop that prints the odd numbers from 99 to 1 in descending order. ANs:
    for(int n = 99; n >= 1; n -= 1) {
        System.out.println(n);
    }
    
  3. How does a switch statement work? Ans:
    switch(n) {
        case 1:  word = "one";   break;
        case 2:  word = "two";   break;
        case 3:  word = "three"; break;
        default: word = "other";
    }
    
  4. What is the difference between a static method and an instance method?
    Ans: A static method is called from a class; an instance method is called from an object.
  5. How does the toString method work for a class? What does @Override do?
    Ans: The toString method for a class returns a String representation of an object. @Override means that the method is overriding a method in the base class of the current class.
  6. Create an array that contains these strings:
    ibm  oracle  microsoft  google
    // Ans:
    String[ ] arr = {"ibm", "oracle", "microsoft", "google"};
    
  7. Create an ArrayList collection that contains the same strings as the array in Problem 6. Ans:
    ArrayList<String> col = new ArrayList<String>( );
    for(String s : arr) {
        col.add(s);
    }
    
  8. Explain the difference between a derived class and an interface. What is an abstract class?
    Ans: A derived class inherits instance variables and methods from a base class. It can override (replace) base class class methods in the current class. An interface specifies required methods, but does not define them. The class that implements the interface supplies definitions for the required methods. An abstract class cannot be instantiated. It can specify abstract methods which must be overridden in the derived class. A class can only have one base class, but a class can implement many interfaces.

Create a First Android App

Android Studio Folder Structure

Project 1

Android Class Documentation

Create New Class