Skip to content

Instantly share code, notes, and snippets.

@vonnenaut
Last active June 7, 2021 07:00
Show Gist options
  • Save vonnenaut/5a61f6a1b0403e3d23d54782e4528560 to your computer and use it in GitHub Desktop.
Save vonnenaut/5a61f6a1b0403e3d23d54782e4528560 to your computer and use it in GitHub Desktop.
Android Dev

Android Development

High-level Overview

Components of an Android App

  • Intents
    • Activity
    • Service
    • Content Provider
    • Broadcast Receiver
    • Manifest - an XML file that declares the components (above) and some properties o fthe app

Activity

  • a single screen with a UI
  • independent unit which can work together to form a cohesive whole
  • can be invoked by other apps

Service

  • app component that performs a usually long-running operation in the background, e.g., music or download service
  • do not interact with user or provide UI

Content Provider

  • provides a structure interface to a set of data
    • within an app
    • to share data with other apps (e.g., address book for telephone and messaging apps)

Broadcast Receiver

  • can be registered to receive system or app events
  • can get notified by Android system every time an event of the registered type occurs
  • e.g., music app registers to listen for phone calls, lowers volume of audio when calls come in and it is notified by Android system

Intents

  • an abstract description of an operation to be performed, w/2 parts:
    • action to be performed
    • data on which action operates
    • e.g., phone call: action: call placement, data: phone #
    • provide a way for devs to provide late binding between different apps, i.e., to connect apps that were not initially intended to be connected, i.e., allow for binding at run-time of otherwise completely decoupled apps

 


Android Activity Lifecycle

Rendering Error Fix

Try: File -> Invalidate Caches/Restart

Setting up Virtual Device

Tools -> AVD Manager

+ Create Virtual Device

  • If you get GPU or GL errors or things hang before starting up, try changing virtual device setting Graphics from automatic to software
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment