Skip to content

Instantly share code, notes, and snippets.

@akueisara
Last active March 15, 2020 12:36
Show Gist options
  • Select an option

  • Save akueisara/6e99761d5dfa83ee38cb728ffa412a6f to your computer and use it in GitHub Desktop.

Select an option

Save akueisara/6e99761d5dfa83ee38cb728ffa412a6f to your computer and use it in GitHub Desktop.
Android Development Notes from Udacity Android Courses

Intro

Android Min and Target Versions

  • The minSDK is the lowest SDK level that your app can run on. Remember that each release introduced new APIs and hardware support, so it may not make sense to make your app available to devices that don’t support your minimum feature set. Here are some examples of hardware support and features, tied to releases.
    • Home screen widgets (Cupcake)
    • Multiple finger tracking (Froyo)
    • Tablet (Honeycomb)
    • Android Beam(NFC) and BLE (Jellybean)
    • Android TV, Auto, Wear (Lollipop)
    • Pro Audio (Marshmallow)
  • By comparison, the targetSDK is NOT a high pass filter -- it’s used only to declare which platform version you've tested your app on. An app targeted to a certain API or Android version will continue to be forward compatible on future releases -- the platform uses the target SDK values in case a future release makes a significant change to expected behavior, ensuring your app doesn’t break when a user’s phone gets upgraded.

Android Software Stack

Gradle from the Command Line

./gradlew tasks

Android Debug Bridge

enter image description here

For example, to start your android app from the command line, you could type:

adb shell am start -n com.package.name/com.package.name.ActivityName

Activities, Packages, and Layouts

  • Apps are Collections of collections of connected components.
  • Four types of components that make up apps: enter image description here
  • An activity is a single, focused thing that the user can do.
    • Responsible for creating the window that your application uses to draw and receive events from the system
  • Android knows which components are in the application by The Android Manifest

Android Layouts Primer

Type of View : UI Components

enter image description here

Type of View : Container View

  • A ViewGroup is a special view that can contain other views (called children.) The view group is the base class for layouts and views containers.
  • A few examples of common container views are: enter image description here

Width and Height

  • wrap_content will shrink the view to wrap whatever is displayed inside the view.
  • match_parent will expand the size of the view to be as large as the parent view which it is nested inside of.

setContentView

  • It inflates the layout

Network

Logging

logging display levels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment