Posts

Showing posts from July, 2023

Encapsulation

  Wikipedia - Encapsulation Documentation - Backing properties Documentation - Backing properties in Android Style Guide

LiveData

  Documentation - LiveData Overview Documentation - LiveData reference documentation Reference documentation Documentation - LiveData Overview Documentation - LiveData reference documentation Talk - Fun with LiveData Documentation - Handling Lifecycles with Lifecycle-Aware Components Documentation - LiveData Overview Documentation - LiveData reference documentation

ViewModel

  Reference documentation Documentation - ViewModel documentation Documentation - ViewModel reference documentation Blog Post - ViewModels: A Simple Example Reference documentation Separation of concerns Documentation - Saving states Blog post - ViewModels: Persistence, onSaveInstanceState(), Restoring UI State and Loaders

App Architectures

  Code Sample - Android Architecture Blueprints Code Sample - Blueprint Architecture Samples at a Glance Comparison Talk - Android Jetpack: what's new in Architecture Components (Google I/O '18) Talk - Droidcon NYC 2016 - A Journey Through MV Wonderland Blog Post - Android Architecture Patterns Part 2: Model-View-Presenter Documentation - Guide to App Architecture Blog Post - Android and Architecture

LifeCycle Library

  Want to learn more about the lifecycle library? Check out the Google I/O talks introducing the library: Architecture Components I/O 2017 Lifecycles Library I/O 2017 Note these talks go far beyond what we cover in the lesson and into the topics of lesson 5 and lesson 6. For just an introduction to using Lifecycle, LifecycleOwner and Lifecycle observation, check out the  Handling Lifecycles with Lifecycle-Aware Components Documentation Now it’s your turn to complete this exercise yourself. You're going to use  Lifecycle Observation  to start and stop the timer. 1. Make DessertTimer a LifecycleObserver: In order to achieve this, DessertTimer should implement a LifecycleObserver, take in a Lifecycle as a parameter and establish observer relationship in init block. class DessertTimer ( lifecycle : Lifecycle ) : LifecycleObserver { init { lifecycle . addObserver ( this ) } } 2. Annotate startTimer and stopTimer with  @OnLifecycleEvent  a...

Summary of Lifecycle State and Activity Lifecycle

Image
  Summary of Lifecycle State and Activity Lifecycle You've learned a lot of new terms and received advice on how to use Activity Lifecycle states. This is summarized below: General Definitions Visible Lifecycle:  The part of the Lifecycle between onStart and onStop when the Activity is visible. Focus:  An Activity is said to have focus when it's the activity the user can interact with. Foreground:  When the activity is on screen. Background:  When the activity is fully off screen, it is considered in the background. Lifecycle States These are the same for both the Fragment Lifecycle and the Activity Lifecycle. Initialized:  This is the starting state whenever you make a new activity. This is a transient state -- it immediately goes to Created. Created:  Activity has just been created, but it’s not visible and it doesn’t have focus (you’re not able to interact with it). Started:  Activity is visible but doesn’t have focus. Resumed:  The state ...