Android Core

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What is the difference between **Build Type**, **Build Flavor**, and **Build Variant**?

* **Build Type**: * refers to build and packaging settings like signing configuration for a project * like `debug` & `release` build types * **Build Flavor**: * used to specify custom features, minimum and target API levels, device and API requirements like layout, drawable and custom code (for example, if production code is slightly different than development code) * like `free` vs `paid` build flavors * **Build Variants**: * the combination of **Build Type** and **Build Flavor** * example: for **Build Types** (debug and release) and **Product Flavors** (free and paid versions), build variants can be `freeDebug`, `freeRelease`, `paidDebug`, `paidRelease`

When do you use an `Application Context` vs `Activity Context`?

* **`Application Context`** * `getApplicationContext()` * when you need a `Context` that exists outside of the `Activity` lifecycle * when it's ***NOT*** **UI related** * example: when you need a `Context` in a singleton object * **`Activity Context`** * `getContext()` * this `context` is tied to an Activity and it's lifecycle * when the `Activity` dies so does the `Context`

How do you create a Thread?

* 2 ways to create a `Thread` * create subclass of `Thread` and override the `run` method ```java class MyThread extends Thread { public void run() { } // TODO } MyThread t = new MyThread(); t.start(); // you MUST start the thread explicitly ``` * **NOT RECOMMENDED** because: 1. once you *extend* a class, you can't *extend* any other class (Java doesn't support multiple inheritances) 2. each of your threads has a unique object associated with it * create class that implements the `Runnable` interface and also implements the `run` method, then pass the instance to the `Thread` constructor ```java class MyRun implements Runnable { public void run() { } // TODO } MyRun r = new MyRun(); new Thread(r).start() // you MUST start the thread explicitly ``` * **BEST PRACTICE** because many threads can share the same Runnable object instance * **KOTLIN**: create and start a thread in **kotlin** by using `thread`() function ```kotlin thread { val html = URL(url).readText() // DO something in background runOnUiThread { // RETURN to UI thread textView.text = html } } ``` * once the code block in the `run` method is executed, the thread is destroyed

What is the difference between App Module and Library Module?

* App Module - builds an app, outputs an APK * Library Module - is a container for reusable code, outputs an ARR

What are 2 types of Fragments?

* DialogFragment * BottomSheetDialogFragment

What are the pros and cons of a single-activity application vs multi-activity application?

* Single-Activity is okay, but probably better to use Custom Views than `Fragments` * Multi-Activity App is great to separate by features/flows in the App

What steps can you take to minimize bugs or regressions from occuring?

* Thorough testing * automated testing with every PR (have robo-electric run) * have unit and integration tests * manual testing with every release (QA team) * have end-to-end tests * alpha/beta testing with feedback loop (internal releases to employees & small set of beta users) * Utilizing logging & monitoring systems * analytics * crashlytics/firebase * Apply Feature Flagging System (features behind server-side flags) * to revert bugs on the fly * Do gradual rollouts * Implement a Force Update for just in case

What is the relationship between `Thread`, `Looper`, `Handler`, and `Runnable`?

* main/UI thread is built with a Looper and Handlers Looper * provides a `Thread` the ability to **keep on running in a loop** (a.k.a. keep thread "alive", like the UI thread) * to destroy the `Thread` you need to call `looperObj.quit()` * there's only one unique `Looper` per `Thread` (which implies one `MessageQueue` per `Thread` too) * loops through a `MessageQueue` and sends `Messages` & `Runnables` to corresponding threads * can have multiple `Handler`s Handler * facilitates communication between two `Thread`s * *example*: normally used to execute some code on UI thread from background/worker thread * responsible for enqueuing any `Messages` & `Runnables` to the `MessageQueue` and executes them as they come out of the `MessageQueue`

What is the difference between onPause(), onStop(), and onDestroy()

* when an interruptive event occurs, `onPause()` lifecycle is called onPause()`** - activity is NO longer in the **foreground** (but activity may still be visible to user) * do NOT make heavy operations here like: * network calls * save to DB * resort to doing the above in `onStop()` * **`onStop()`** - activity is NO longer **visible** to the user * called when a newly launched `Activity` covers the entire screen * do CPU-intensive work here, like save to DB * at this point the `Activity` is kept resident in memory, but not attached to the `Window Manager` * **`onDestory()`** - called before the activity is destroyed. The system invokes this callback either because: 1. the `Activity` is **finishing** (due to the user completely dismissing the activity or due to finish() being called on the activity), or 2. the system is temporarily destroying the activity due to a **configuration change**, such as: * device rotation * dark/light mode changes * multi-window mode * device language change * plugging in physical keyboard

How do you enable notifications for your Android app?

* your app needs to obtain a token from the server (FCM), then store it on the backend * sending push notifications has to happen from the backend

What are ways to optimize Network Request Frequences?

**Polling server for updates is HORRIBLE **Cloud Pushes is AWESOME *like Google Cloud Messaging or Firebase *lets the server signal to the app when there are updates **GCMNetworkManager is a GooglePlayServices API which helps shedule netowkr related tasks and handle batching

RecyclerViews & Adapters Best Practices

*click listeners should be attached in onCreateViewHolder() in RecyclerView.Adapter * use ListAdapter for built in AsyncListDiffer and implement difutil

How do you pass data between Fragments?

- Bundles - ViewModels - https://user-images.githubusercontent.com/4984573/153485800-8b8e16ca-20c6-49c7-97db-8ed45ee56ad4.png

How do you pass data between Activity and Fragment?

- callback approach: create callback/listener interface in Fragment and implement in Activity - observer pattern: ViewModels - using the Fragment Result API, where the FragmentManager acts as a **central store** for fragment results **ex: Fragment A -> setFragmentResultListener("requestKey") Fragment B -> setFragmentResult("requestKey", bundle) FragmentManager setResultKey("requestKey", bundle) to FragmentA

What is Context?

- provides global information about an application environment - allows access to application-specific resources and classes

When should you use a Fragment rather than an Activity?

1. **Modularity**: When you have some UI components to be used across various activities 2. **Adaptability**: When multiple view can be displayed side by side just like viewPager (like on a tablet, you can display 2 views at once)

What are the different ways you can access the UI thread from other threads?

1. **`Activity.runOnUiThread(Runnable)`** * if the current thread is the UI thread, then the `Runnable` executes immediately * if the current thread is NOT the UI thread, then the `Runnable` is queued via a `Handler` to execute on the UI thread 2. **`View.post(Runnable)`** 3. **`View.postDelayed(Runnable, long)`** - runnable added to the messenger queue; to be run after the specified amount of time elapses Consider using a Handler for background work related to UI changes to manage more complex changes

What are the different ways you can batch background work?

1. `AlarmManager` * can schedule exact alarms (specific time) * or schedule inexact alartms (like batch with other apps) 2. `SyncAdapter` * provide same behavior as inexact alarms, but also checks network connectivity and automatically retries 3. `JobScheduler` * like SyncAdapter, but can define schedule, how much you can deviate

How do you retain state during configuration changes in an `Activity`?

1. save state in `onSaveInstanceState(Bundle)` * not designed to store large amounts of data 2. save state in `ViewModel` * `SavedStateHandle` 3. Local persistence

What are some Hilt annotations and what do they do?

@HiltAndroidApp - triggers Hilt's code generation, including base class for your app that can use DI. The application container is the parent container for the app @AndroidEntryPoint - creates a dependencies container that follows the Android class lifecycle (supports Activities, Fragments, Services) @Singleton scopes an instance to the application container Note: Hilt Modules cannot contain both non-static and abstract binding methods, so you cannot place @Bind and @Provides annotations in the same class

How does rxJava work?

A Subscriber subscribes to an Observable The Observable calls Subscribe.onNext() for any number of items If something goes wrong Subscriber.onError() If all finishes Subscriber.onCompleted()

What is a WorkManager?

A solution for persistent work. Work is persistent when it remains scheduled through app restarts and system reboots. Because most background processing is best accomplished through persistent work, WorkManager is the primary recommended API for background processing. API 30 Previously, IntentService was used, which was an extension of Service to handle async requests

Name the 4 Android Components

Activities, Services, Broadcast Receivers, Content Providers

What is a Service?

An android component that performers long-running operations in the background ex: checking new data, data processing, indexing content

How can you identify memory leaks?

Android Profiler in Android Studio Leak Canary by Square

What is Android code signing?

Android requires that all APKs be digitally signed with a certificate before they are installed on a device or updated. When releasing using Android App Bundles, you need to sign your app bundle with an upload key before uploading it to the Play Console. Play App Signing With Play App Signing, Google manages and protects your app's signing key for you and uses it to sign your APKs for distribution. Play App Signing uses two keys: the app signing key and the upload key. You keep the upload key and use it to sign your app for upload to the Google Play Store. Google uses the upload certificate to verify your identity, and signs your APK(s) with your app signing key for distribution. By using a separate upload key you can request an upload key reset if your key is ever lost or compromised.

What happens if you block main/UI thread?

App will freeze, potentially leading to ANR dialog, so should run all blocking operations like network calls on a background thread

Describe the MVVM architecture.

Business logic is removed from the view and handled in viewmodel class. VM also survives configuration changes. VM uses observer pattern and updates views when data changes are observed. * does **NOT** hold reference to `View` * `View` and `ViewModel` are in a 1 to many relationship

What's the difference between ::class and ::class.java?

By using ::class, you get an instance of KClass. It is Kotlin Reflection API, that can handle Kotlin features like properties, data classes, etc. By using ::class.java, you get an instance of Class. It is Java Reflection API, that interops with any Java reflection code, but can't work with some Kotlin features.

What are Subjects in rxJava?

Can act as an Observable and an Observer

What is Dagger, and Dagger Hilt?

Dagger - creates and manages graph of dependencies for you fully static and compile-time dependencies that addresses many of the development and performance issues of **reflection-based** solutions Hilt = Jetpack's recommended library for DI, built on top of Dagger

What is an Intent?

Describes an action An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed.

What is a Disposable?

Disposables are streams/links/connections between Observer and Observable * Sometimes data flow can be a long-running api request and by the time you get a response or a value gets emitted - the screen that made a request might already be closed * you might end up with a memory leak, or even a crash - depending on your implementation * this is where `Disposables` come in handy. you want to make sure you dispose of a disposable

What are the types of Intents?

Explicit Intent used for communication within an appication ** ex: const val EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE" val intent = Intent(this, MyActivity::class.java).apply { putExtra(EXTRA_MESSAGE, message) } startActivity(intent) * **start or bring to a `Service`** (by passing intent to `Context.startService(Intent)` or `Context.bindService(Intent, ServiceConnection, int)`) * **`broadcastIntent` to send it to any interested `BroadcastReceiver` components** Implicit Intent used for communication across two different application (in other words, the ability to request an action, butlet OS show which apps are suitable), *examples*: * open browser * open camera

What are different ways to persist data in Android?

Files/Disk - Internal/External Storage store on private data on app or public data on device Shared Preferences - store private data in key value pairs. can be replaced by DataStore, which uses Kotlin coroutines Database - SqlLite DB local android db, Room - persistent library that provides an abstraciton layer over SQLLite

What are types of Services?

Foreground performs some operation that is noticeable to the user. Foreground services must display a notification ex: when a music player is playing a notification is displayed Background performs an operation that isn't noticed by the user ex: image is compressed in the background after the user sends image to another user *On API 26+ background services are restricted by systems, should use Work Manager for intensive operations Bound when an application component binds to it by calling bindService(). A bound service offers a client-server interface that allows components to interact with the service, send requests, receive results, and even do so across processes with interprocess communication (IPC). A bound service runs only as long as another application component is bound to it

What's the difference between FrameLayout, RelativeLayout, and ConstraintLayout?

FrameLayout: Childviews are drawn in a stack, with the most recently added child on top. Should be used to hold a single child view since they would overlap each other if more than one. RelativeLayout: ViewGroup whose children are positioed relatively to each other or the parent ConstraintLayout: Dual power of both Relative (setting relatively positions of views_) and Linear Layout of (setting wiehgts)

What are some ways to load images?

Glide - fast and efficient image loading library focused on smooth scrolling Picasso - hassle-free image loading *made by Square Coil (Coroutine Image Loader) - image loading library backed by Kotlin coroutines. Lightweight, comparable to Picasso, significantly less than Glide and Fresco *made by Instacart Fresco - powerful system made for displaying images *made by Facebook

What are the different ways you can run Android tasks in the background?

HandlerThread - dedicated thread for api callbacks ThreadPool - can break work into tiny packets and toss into a bunch of waiting threads WorkManager - persistent work Coroutines - for immediate persistent work RxJava - for immediate persistent work in Java

What are disadvantages of DI?

Increases complexity

What are the principles of Object Oriented Programming?

Inheritance, Polymorphism, Encapsulation, Abstraction Abstraction - abstracting away all the inner workings of a class while only exposing what is needed to use it Inheritance - relies on principle of abstraction. We can take away only the methods we need from our base class for what we need. About reuse - not hierarchy Encapsulation - prevents mutation from other objects Polymorphism -= taking on many shapes

What is a Kotlin data class?

It is a class that holds data. The compiler automatically derives the following members from all properties declared in the primary constructor: equals()/hashCode() pair toString() of the form "User(name=John, age=42)" componentN() functions corresponding to the properties in their order of declaration. copy() function to copy an object, allowing you to alter some of its properties while keeping the rest unchanged.

What is the principle of Dependency Injection?

It is the technique that makes a class independent of its dependencies (decoupling). Its dependencies (other objects) are created separately and passed in as parameters. More testable.

Why Compose?

It's a declarative API, which means all you need to do is describe your API It allows you to do more with less code *no more xml *no more recyclerviews and adapters

What is a sealed class in Kotlin?

It's similar to an Enum in that it represents restricted hierarchies. Enums can only be represented in constants and have no state. Sealed classes can be of any type,

What is a Kotlin extension?

Kotlin provides the ability to extend a class or an interface with new functionality without having to inherit from the class or use design patterns such as Decorator. This is done via special declarations called extensions. For example, you can write new functions for a class or an interface from a third-party library that you can't modify. Example: You have a Date class you can't modify, but you can add a new function to it with extensions. eg. Date.Tuesday() :Boolean = { return isTuesday } if (Date.Tuesday()) { pay bill}

What are some Rendering tools?

Layout Inspector - provides visual rep of view's hierarchy Lint - helps you gain sense of inefficiency in view hierarchy Systrace/Perfetto - allows you to collect and inspect timing information across an entire Android device, allowing you to see when layout performance problems cause performance problems Profile GPU rendering - allows you to see how long the layout-and-measurestage is taking for each frame of rendering which helps diagnose runtime performance issues

Describe the MVP design pattern

Model View Presenter Presenter: holds reference to the View. Presenter and View are in a 1:1 relationship Disadvantage* * tight coupling between `View` and Presenter * huge amount of interfaces for interaction between layers

How do you write tests for MVVM?

Model and ViewModel tests are usually unit tests YOu don't need any parts of the Android framework View tests are usually Instrumented tests Write tests against ViewModel and test all the logic up to the Repository and even data sources if possible, faking only external networking systems

Describe the MVC design pattern

Model, View, Controller Model: the data layer, responsible for managing the business logic and handling network or db API View: The UI Layer - a visualization of the data from the Model Controller: The Logic layer - gets notified of the user's behavior and updates the Model as needed *back in the day, Activity/Fragment were also controllers but now should be a separate class Disadvantages* View depends on both the Model and the Controller Large code in Controller can becom unmanageable

Can you reference UI objects in worker threads?

No, remember do not reference UI object in background threads

Explain GPU overdraw

Overdraw occurs when your app draws the same pixel more than once within the same frame

What are types of Subjects in RxJava?

Publisher Subjects: emits only those items which are emitted after time of subscription Replay Subject: emits all the items emitted by source 'Observable' regardless of when it has subscribed the Observable Behavior Subject: upon subscription, emits the most recent item then continue to emit item emitted by the source Observable

How can you solve some view hierarchy issues?

Remove view hierarchy, redundant or nested layouts Use cheaper layouts (like using `ContraintLayout` instead of `RelativeLayout`) Remove unneeded backgrounds in layouts Reduce the number of transparent objects you render *for example, you can get gray text by drawing black text in a TextView with a translucent alpha value set on it, but you can get the same effect with far better performance by simply drawing the text in gray

What is a Fragment?

Represents a reusable portion of your app's API - must be added to a Fragment Manager, which is responsible for --determining what state its fragment should be in and moving them to that state --attaching to host activity -- detaching fragments which are no longer in use

What is a Kotlin Flow?

Represents a stream of values that are being computed asynchronously (similar to an Observable). Suspend functions allow you to only get a single value asynchronously whereas Flows will continue to observe values. Code inside a flow { ... } builder block can suspend Values are emitted from the flow using an emit function. Values are collected from the flow using a collect function. A suspend modifier is no longer needed

What are the advantages of DI?

Reusability of class and decoupling of dependencies Ease of refactoring - dependencies can be checked during compile time rather than hidden as implementation details Ease of testing - can pass in test doubles to test different cases

What is a Sealed class in Kotlin?

Sealed classes and interfaces represent restricted class hierarchies that provide more control over inheritance. All direct subclasses of a sealed class are known at compile time. No other subclasses may appear outside a module within which the sealed class is defined. In some sense, sealed classes are similar to enum classes: the set of values for an enum type is also restricted, but each enum constant exists only as a single instance, whereas a subclass of a sealed class can have multiple instances, each with its own state.

What are the most common architectural principles?

Separation of concerns and driving UI from a model.

What thread does a Service run on?

Services can be triggered from any thread , but runs in Main Thread of its hosting process by default. Remember that if you do use a service, it still runs in your application's main thread by default, so you should still create a new thread within the service if it performs intensive or blocking operations.

What are the types of Observables?

Single: an Observable which only emits a single item or throws an error Maybe; similar to single, except allows for no emission Completable: only cares whether the task has reached completion or some error ** does not have onNext() or onSuccess() methods Flowable: typically used when an Observable is handling an enormous amount of data but Observer* is not able to handle this data emission

What are advantages of the ViewHolder pattern?

TLDR: used to speed up rendering - creating a view in Android is expensive, expecially from XML because it needs to be inflated and calling findViewById is inefficient, so if you have 2000 rows to display you will have performance issues like slow scrolling - If these views aren't recycled, you may not have enough memory to render all the rows and will put a lot of strain on garbage collector

What happens when you hit the back button?

The Activity is popped() off that Activity Stack() * same for fragments

What is the "Appilcation" Class?

The base class within an Android app that contains all other components such as Activities and Services * it is primarily used for **initialization of global state** before the first `Activity` is displayed * there's no need to work with an `Application` class directly * **note**: storing data in the `Application` object is error-prone and can crash your app

What's the difference between Interface and Abstract class?

The main difference between an interface and an abstract class is that an interface cannot have state, whereas the abstract class can have state with instance variables Another key difference is that classes can implement more than one interface, but they can extend only one abstract class.

What is an Android Manifest file?

The manifest file describes essential information about your app to the Android build tools, the Android OS, and Google Play. The manifest file is required to declare the following: - Components of the app, which include all activities, services, broadcast receivers, and content providers. - The permissions that the app needs in order to access protected parts of the system or other apps. - The hardware and software features the app requires, which affects which devices can install the app from Google Play

What are the differences between MVP, MVVM, MVI?

They can broadly be thought of as different flavors of the same core concept — abstracting logic from the UI into classes without references to Android. The main way in which they differ is how those classes accept their inputs and how they then output updates to the UI. MVP - Model View Presenter The defining feature of MVP is that data is communicated back to the view imperatively. To imperatively update the UI, presenters rely on having a reference to the view, which is usually an activity or fragment injected into the presenter as an interface. The presenter can call functions on the interface to cause changes to the UI. MVVM - Model View, ViewModel Where MVVM differs from MVP is in how data is communicated back to the view. Rather than imperatively calling the view, in MVVM changes are described by data which are then observable by the view. The UI can then reactively re-compose itself based on the new data. MVI - Model View Intent MVI pre-defines a selection of events the ViewModel handles and the view publishes a stream of these events as they happen. But the major difference is communication back to the view. Whereas in MVVM there is usually a separate publisher for each piece of data, in MVI a single object defining the entire state of the view is published. Similar to Redux

What drains battery?

Too many network calls -You can wait for when battery is charging -Wait for Wifi -Batch network calls -Implement a backoff pattern where you double your "wait length" everytime

How do you prefetch effectively?

Understanding the appropriate prefetching amount ( 3 pics vs 12 pics) requires knowing about the network like 4G vs 2G

What are some ways to test?

Unit testing - runs on your own workstation, rather than device or emulator. *JUnit or Mockito are popular. Usually kept in Test folder Integration Tests - validates how your code interacts with other parts of the system, but without the added complexity of a UI framework. Ex: how ViewModel works with DataSource *Roboelectric is a popular choice Instrumented/ Instrumentation Testing - tests that run on emulators *Espresso is a popular choice. Usuall kept in **android/Test Folder

How do you design a codebase that facilitates testing?

Use DI like dagger, or HIlt Modularize code that can be both unit tested and UI tested

What is a ViewModel?

Used to manage UI-related data and logic and survives configuration changes. *should avoid referencing a View or Activity context since you can cause a leak during configuration change

What are examples of Memory Leaks?

Views declared as class level variables in a Fragment. Problem is that the references to views now live throughout the Fragment's lifecycle, not the Fragment's View lifecycle. ** solution is to clean them up in onDestroyView(), or use ViewBinding() Singleton class references Activity Context Problem is that you will be escaping the activity context outside its own scope ** solution is to pass applicationContext() to the Singleton class Forgetting to unregister Broadcast Receivers Problem is when you forget to unregister, it still holds reference to the Activity, even if you close the Activity ** always remember to unregister in onStop() of Activity Non-Static Inner Classes (that outlive Activity lifecycle) Problem: Nonstatic and anonymous classes unknowingly holds the implicit reference of the Activity which can lead to memory leaks **solution is to use a static inner class and make a WeakReference to the Activity Views inside async callbacks problems: this async task may execute *after* the Activity is destroyed but the view in the Activity will be kept until task is complete, or worse - the async task may complete after the view object is destroyed which will cause a crash ** solution - access UI thread

What is a Flaky Test?

When a test doesn't have deterministic behavior, it's flaky. UI tests with frameworks like Espresso or UI Automator can easily get flaky if the app has external dependencies that can sometimes fail or takea long time to respond *Combat flaky tests by creating fake implementations or fake servers that return predefined data

What is a Memory Leak?

When an app allocates memory for an object, but fails to release the memory when the object is no longer being used -> results in poor app performance and maybe even crashes this problem cascades because not only does the view that leaks, but also the associate objects (eg activity that created the view)

How do you pass data between Activities?

by using **`Intents`** in **`startActivity()`** function * when you need to get a result back from when another activity ends, you can use **`startActivityForResult`** with an Intent and then receive the result on **`onActivityResults()`** function

What's an Observable in rxJava?

emits multiple items in a stream ** also see Flow in Kotlin

What's the difference between an abstract class and an interface?

interface can only have abstract methods. abstract classes can have abstract and non-abstract methods. interface can only have static and final variables. abstract class can have static, non static, final and non final variables. you can only implement one or more interfaces. you can extend ONE abstract class and implement multiple interfaces members of interface are public by default. abstract classes can have private and public

What are a Fragment's lifecycle methods?

onAttach()`** - invoked when the `Fragment` has been added to a `FragmentManager` and is attached to its host `Activity` * **`onCreate()`** * **`onCreateView()`** - inflate or create fragment view here * **`onViewCreated()`** - set up initial state of view here * start observing `LiveData` * set up adapters to `RecyclerViews` or `ViewPagers` * **`onStart()`** - fragment view is available * **`onResume()`** - fragment is visible and ready for user interaction * **`onPause()`** - fragment is still visible, but user is leaving * **`onStop()`** - fragment is no longer visible * **`onDestoryView()`** * **`onDestroy()`** * **`onDetach()`** -invoked when the `Fragment` has been removed from a `FragmentManager` and is detached from its host `Activity` * the fragment is no longer active and cannot be retrieved

What is the difference between onCreate(), onStart(), and onResume()?

onCreate() - performs basic application startup logic that should happen only once for the entire life of the activity, like: * set up xml * bind data to lists * associate the activity with a ViewModel * instantiate some class-scope variables (`TextViews`) onStart() - activity is visible to the user (not yet available in the foreground or for interaction) onResume() - activity is in the **foreground**, user can interact with Activity

What are an Activity's lifecycle methods?

onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy()

What is an Activity?

provides the window/screen with which users can interact

What does Android Fragmentation refer to?

refers to the fact that there are a massive number of different Android OS versions available and operational in the digital world * how to deal with it? * the only way to ensure app stability and performance is to test them on real Android devices * developers and testers can run tests on a real device cloud

How do you instantiate ViewModel with Arguments/Constructor Parameters?

val viewModel: MyViewModel by viewModels OR val viewModel: MyViewModel = ViewModelProvider(this).get(MyViewModel::class.java)


Kaugnay na mga set ng pag-aaral

Psych LearningCurve 3b. Infancy and Childhood

View Set

Ch. 13 Spinal Cord, Spinal Nerves, and Spinal Reflexes

View Set

Mean Absolute Deviation, Data and Stats Review

View Set

The Nemo Dat Rule and its Exceptions

View Set

LESSON1 CONCEPT Chapters 1 and 2 from Modern Labor Economics

View Set

Earth Science: Earth Layers & Minerals

View Set

Vocabulary Workshop Level G Units 1-4

View Set

Unit 3: Interests in Real Estate

View Set

Robert Oppenheimer - Direct & Cross Examination

View Set