Android Basics Flashcards

Fundamentals of Android App development

1
Q

What are the 3 basic types of mobile apps

A

Native
Web apps
Hybrid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Web app

A

Responsive version of a website that works on any mobile device or OS
Delivered via mobile browser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a hybrid app

A

Combination of web app and native app
Web app that is wrapped in a native app so it can be downloaded

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are native apps

A

Built for the Mobile device OS
require installation
written in Android or swift

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some benefits of Native apps

A
  • Provide access to all the standard tools and features and are compatible with native features such as sensors, hand gestures, accelerometer
    -Performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Web apps usually built with

A

HTML5, CSS, JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a PWA

A

Progressive Web app

  • native web app running insides a browser
  • Web app that functions like a native mobile app
  • has a homescreen icon, responsive design, offline functionality
  • Get automatic updates
  • Offer good performance
  • provide users with a more app-like experience on the web
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Dalvik VM

A

A pioneering virtual machine that paved the way for Android’s success. It allowed applications to run on the android device
- superseded by Android Runtime (ART), its legacy remains in the foundation of the Android ecosystem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Android jetpack

A

Suite of software components, libraries, tools, and guidance provided by Google to help developers build robust, high-quality Android applications.

Benefits - reduces boilerplate code, ensures consistent apps

Includes AndroidX which is used for backwards compatibility

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is AndroidX

A

Provides backwards compatibility across Android releases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do Android apps work

A

Device launches app
app creates activity object
Activity tells Android what layout to display
User interacts with the layout
Activity responds to the interaction by running application code
Activity updates the display

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are view groups

A

Invisible container for views

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are common android layouts

A

Linear
Relative (Constraint layout is preferred)
Web view to display web pages
Adaptor layouts: list view, grid view, recycler view
Constraint layout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Constraint layout

A

default layout
has a flat hierarchy
Needs at least one horizontal and one vertical constraint for the view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the main files in android

A

Manifest
Gradle scripts
java
res

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the gradle scripts

A

build.gradle project
build.gradle module
settings. gradle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are the common res files

A

drawables
layout files
menu
values (strings)

18
Q

What does the Android manifest do

A

declares components (activities, services)
defines permissions (camera, location, storage)
set config (min level supported)
app metadata (helps user understand app)

19
Q

What does the settings.gradle do

A

defines the project hierarchy
Defines plugins remote repositories like Maven

20
Q

What does MainActivity.java do

A
  • defines how the app will behave and interact with the user
  • Starts the activity and loads the layout set by setContentView() method
21
Q

What are the different stages in the activity lifecycle

A

onCreate()
onStart()
on Resume()
ACTIVITY RUNNING
on Pause()&raquo_space; go to onResume
on Stop()&raquo_space; go to onCreate from here if other apps need the memory, or go to onRestart()
on Destroy
ACTIVITY SHUT DOWN

22
Q

What is AppCompatActivity

A

Base class for activities and uses an app bar

23
Q

What is the Bundle savedInstanceState

A

Previously frozen state if there was one

24
Q

What does the setContentView method do

A

loads the activity_main.xml
sets the activity content from a layout resource that will be inflated, adding all the top level view to the activity

25
Q

What is an Android Emulator
What is an AVD

A

Simulates an android device and displays the application on the computer
AVD - Android Virtual Device

26
Q

What is Logcat

A

Provides information about the logs

27
Q

What is an APK

A

Android Application Package

28
Q

What is an event listener

A

Captures user interactions with the UI
interface in the View class
Contains a single callback method

29
Q

What is View binding

A

Helps you to interact more easily with views

30
Q

What are the advantages of View binding over FindViewByID

A

Type safety
Null pointer safety

31
Q

What is Android Context

A

Abstract class
allows access to information about resources and classes

32
Q

What is an intent

A
  • Can be used to start an activity
  • Can be used to start a service
  • Can be used to start a broadcast
  • Can be used to pass data between activities
33
Q

What parameters does an intent constructor need

A

Context and a class

34
Q

How can you pass data between multiple activites

A

Use objects of:
Intent
Bundle

35
Q

How can you use an intent to pass primitive data

A

using putExtra which requires a keyname and its value

36
Q

How do you use a Bundle to pass primitive data

A

Create a bundle to send a set of data items with intent
Add all the data items into one bundle object

37
Q

Parcelable class

A

Package an object’s data and transfer it between activities or other components within your app in a serialized format.
To make your class Parcelable, you need to:
Implement the Parcelable interface.
Override the writeToParcel(Parcel dest, int flags) method to write your object’s state to the parcel.
Implement a static CREATOR field that provides a method to create an object from a parcel.

38
Q

What is a spinner

A
  • displays a set of values that the user can click on
  • show which item is selected
  • when touched shows a dropdown with all other available items
39
Q

How is a spinner populated

A

with a SpinnerAdaptor such as an Array Adaptor

40
Q

How do you add items to a spinner in 4 steps

A
  • Declare a list to hold the items to display
  • Instantiate an ArrayAdapter<T></T>
  • To add items first add them to the adapter
  • Notify the Adapter of the change so it refreshes itself
41
Q

How is view Binding set up

A

Gradle change: set view Binding to be true

Class level:
- import view binding
- private ActivityMainBinding binding (set a variable with the name of the resource file as the binding object)
- binding=ActivityMainBinding,inflate(getLayoutInflator())
View view = binding.getRoot()