Mobile Flashcards

1
Q

What is ubiquitous computing?

A
  • Computing devices become an integral part of the environment, seamlessly integrated with the environment and available anytime and anywhere
  • Embedding computing capacity into ordinary items
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do mobile networks work?

A
  • Base station (BS)/access point (AP) connects mobile devices to infrastructure
  • Handoff: mobile device change its associated BS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between a mobile and a PC?

A

The difference is the way they put components. Mobiles use System on Chip: a complex integrated that integrates the major functional elements into a single chip or chipset.

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

What are the benefits of SoC?

A
  • Reduced size
  • Lower power consumption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the platform architecture for Android?

A
  • Linux Kernel
  • Hardware abstraction layer (HAL)
  • Native C/C++ libraries, Android Runtime
  • Java API framework
  • System apps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the Linux Kernel provide in Android?

A
  • Hardware drivers
  • Security
  • Process and Memory management
  • File and Network I/O
  • Power management, Binder (Inter-Process Communication)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the Hardware Abstraction Layer provide in Android?

A
  • Provides standard interfaces that expose device hardware capabilities to the Java API framework
  • Consists of multiple library modules, each of which implements an interface for a specific type of hardware component
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the Native C/C++ libraries provide in Android?

A
  • Webkit (browser engine)
  • Media Framework (Video/Audio)
  • OpenGL (Graphics engine)
  • SQLite (relational database engine)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the Android Runtime provide in Android?

A
  • It is an application runtime environment used by the Android OS
  • Core libraries (Basic Java classes, App lifecycle, Internet/Web services, Unit testing)
  • ART (App written in Java compiled to Java bytecode files, which is converted to DEX bytecode files, which is the input bytecode to ART - designed for devices with constrained memory and speed)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the Java API Framework provide in Android?

A
  • Enabling and simplifying the reuse of system components and services
  • Developers have full access to the same APIs used by the system applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What features are included in Java API Framework?

A
  • View system: Builds an application’s UI, including lists, grids, text boxes, buttons, embedded web browser, etc.
  • Content Provider: Enables applications to access data from others or to share their own data
  • Resource Manager: Provides access to non-code resources (strings, graphics, and layout files)
  • Notification Manager: Enables all applications to display customer alerts in the status bar
  • Activity Manager: Manages the lifecycle of apps and provides a common navigation backstack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What Applications are provided in Android?

A
  • Email Client
  • SMS/MMS
  • Calendar
  • Maps
  • Browser
  • Contacts
  • Camera
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some limitations of Android Emulators?

A

It does not support or only partially supports:
- USB
- Device-attached headphones
- SD card insert/eject
- Bluetooth
- NFC

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

What are the components of an application?

A
  • Activities: GUI focused on a single thing a user can do
  • Services: no visual interface, they run in the background
  • Broadcast Recievers: receive and react to broadcasts
  • Content Providers: allow data exchange between applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some examples of service components?

A
  • Play music
  • Perform file I/O
  • Handle networking task
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do broadcast recievers work in an app?

A

Allow to listen for and respond to an event of interest

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

What are some examples of app broadcasts?

A
  • System broadcasts: Low battery, power connected, shutdown, etc.
  • Customized broadcasts: To notify other apps
  • Register to receive specific broadcasts: e.g., SMS message received; call received
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is an intent in Android?

A
  • A messaging object that can be used to request an action from another app component (e.g., activities, services, broadcast
    receivers).
  • It allows a component to communicate with another component (same app or other apps).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the three fundamental use cases of an intent in Android?

A
  • Starting an activity
  • Starting a service
  • Delivering a broadcast
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is an explicit intent in Android?

A

Specify the component to start by its name (the fully-qualified class name)

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

What is an implicit intent in Android?

A
  • Not directly specify (name) a component, but instead specify an action to perform.
  • Intent filter specifies the type of intents an activity accepts based on the intent’s action, data, and category.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How are application resources stored?

A
  • Images and string should be stored in a res folder
  • Place each type of resource in a
    specific subdirectory of your
    project’s res/directory
  • You can access them using
    resource IDs generated in your
    project’s R class.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is stored in AndroidManifest.xml?

A
  • Package name
  • Main activity
  • Components (activities, services, broadcast receivers, and content providers)
  • Request permissions (network, location,…)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are the three approaches for creating an activity?

A
  • Traditional approach: separate activity for each screen
  • Modern approach: single activity with multiple fragments
  • Jetpack compose: single activity architecture, modern UI toolkit, only in Kotlin
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What are the 7 callback methods of an activity lifecycle?

A
  • onRestart()
    (Lifetime)
  • onCreate()
  • onDestroy()
    (Visible)
  • onStart()
  • onStop()
    (Interactable)
  • onResume()
  • onPause()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What does onCreate() do?

A
  • Called when Activity is created.
  • Initialize the Activity and carry out the functions: Call super.onCreate(); Set content view; Retain references to views; Configure views.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What does onStart() do?

A
  • Called when Activity is about to become visible
  • Typical actions: Starting visible-only behaviours; Loading persistent app state
28
Q

What does onResume() do?

A
  • Called when Activity is visible and about to start interacting
  • Typical actions: Starting foreground-only behaviours
29
Q

What does onRestart() do?

A
  • Called when Activity is stopped but about to be started again
  • Typical actions: handle any special processing needed
30
Q

What does onPause() do?

A
  • About to switch to another Activity
  • Typical actions: Shutting down foreground-only behaviours; Saving persistent app state
31
Q

What does onStop() do?

A
  • Activity is no longer visible
  • Typical actions: Caching activity state; May not be called if Android kills your app
32
Q

What does onDestroy() do?

A
  • About to be destroyed
  • Typical actions: Releasing activity resources
  • May not be called if Android kills your app
33
Q

What is a task in Android?

A

It is a set of related activities. It can span multiple apps

34
Q

What is a task back stack in Android?

A

Managing the activities, ensuring the activities are properly suspended and resumed as on and off the task back stack

35
Q

What is the difference between intent data and intent extras?

A
  • Intent data can only hold a URI representing the data location (use setData() and getData())
  • Intent extras are stored in Bundle object as a <key, value> pair (use putExtra(Intent.EXTRA_, “”))
36
Q

What are some intent fields?

A
  • Action: the generic action the receiving activity should perform
  • Category: the category of component that should handle the intent
  • Type: indicates the MIME type of the intent data
  • Flag: specify how the intent should be handled
37
Q

How do you resolve an activity?

A
  • Use the resolveActivity() with the system package manager to verify that there is at least a match
  • If a feature depends on an external activity, a best practice is to test for the availability before using it
38
Q

What is a View?

A
  • The View class is a basic building block for UI components
  • It is a superclass for all UI components
  • Occupies a rectangular space on screen
39
Q

What is a Layout?

A
  • A layout defines the visual structure for a UI
  • Elements in the layout are built using a hierarchy of Views and ViewGroups
40
Q

What are some types of Layouts?

A
  • LinearLayout
  • RelativeLayout
  • GridLayout
  • TableLayout
41
Q

What are some ways to declare a layout?

A
  • Declare in XML
  • Instantiate at runtime
42
Q

What is ConstraintLayout?

A
  • It is a more powerful and flexible ViewGroup
  • Similar to RelativeLayout but reduces the need for nested views - improving performance
  • More flexible and powerful, allowing position of widgets based on constraints to siblings and the parent
43
Q

What are data-driven containers?

A
  • A layout that adds a level of interactivity between user and child Views
  • To populate the layout with views at runtime, you can use a layout that subclasses AdapterView
44
Q

What are two examples of data-driven containers?

A
  • ListView: vertical list, vertical scroll, horizontal row entries, pick item
  • GridView: a 2D scrollable grid, a ViewGroup that displays a list of scrollable items, with specified number of rows and columns
45
Q

What is AdapterView?

A
  • AdapterView uses adapter to manage the data model and bind the data to the view elements within the list
  • Adapter generates child Views from some data source and populates the parent View
46
Q

What are the most common types of Adapters?

A
  • ArrayAdapter: used to read from resource, typically an XML file
  • Cursor Adapter used when reading from a database
47
Q

What are the two main functions of AdapterView?

A
  • Filling the layout with data
  • Handling user selections
48
Q

What is a RecyclerView?

A
  • A more advanced and flexible version of ListView
  • Used to display a verticalscrolling list of items based on large data sets
  • It is made up of views for images and texts
49
Q

What are the RecyclerView components?

A
  • Layout Manager: manage the arrangement of list items within the RecyclerView
  • RecyclerView: the scrolling list that contains the list items
  • Adapter: binds data to the RecyclerView
  • ViewHolder: contains the view information for displaying one list item
  • Data: local, database, or remotely
50
Q

How do you initialize the RecyclerView?

A
  • Get a reference to the RecyclerView
  • Give the RecyclerView a LayoutManager
  • Create an adapter and supply the data
  • Connect the adapter to the RecyclerView
51
Q

What is a Fragment?

A
  • A fragment offers to compose Apps in a highly modular way
  • Composing an Activity from several fragments offers flexibility
  • You can re-use fragments - like re-use of mini interfaces
  • Fragments usually, but not always, have a UI
52
Q

How does a Fragment Lifecycle work?

A
  • A Fragment always belongs to an Activity
  • Each Fragment has its own lifecycle and receives its own events
  • Activity lifecycle influences Fragment lifecycle: Activity paused, Activity destroyed, Activity running
53
Q

What are the Fragment Lifecycle States?

A
  • Resumed: Fragment is visible in the containing activity
  • Paused: Another activity is in the foreground
  • Stopped: Fragment is not visible
54
Q

What are Menus?

A

Menus are a common user interface component in many types of applications

55
Q

What is an Options menu?

A
  • The options menu is the primary collection of menu items for an activity
  • It’s where you should place actions that have a global impact on the app, such as ‘Search’, ‘Settings’
56
Q

What is a Context menu?

A
  • A context menu is a floating menu that appers when the user performs a long-click on an element
  • It provides actions that affect the selected content or context
57
Q

What are some Android Data Storage options?

A
  • Lightweight storage: SharedPreferences, DataStore
  • File storage: Internal Storage, External Storage
  • Database: Room, SQLite
  • Network: Cloud
58
Q

Describe lightweight storage options in Android

A
  • SharedPreferences: Store private, primitive data sets in key-value pairs,
    like user preferences.
  • DataStore: the modern substitute for SharedPreferences with better
    performance and safety.
59
Q

Describe file storage options in Android

A
  • Internal Storage: Store sensitive, private data on the device‘s build-in
    storage within the app’s context. Files are removed when the app is uninstalled
  • External Storage (logical):
    Private: private to an app, deleted when the app is uninstalled.
    Public: larger, public data accessible by other apps.
    Request READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE permission
60
Q

Describe database options in Android

A
  • SQLite Database: Store structured data in a private database. A small, fast, self-contained, high-reliability database engine.
  • Room database: an abstraction over SQLite for simplified management and queries.
61
Q

Describe cloud storage options in Android

A
  • Cloud storage allows apps to store data on remote servers, enabling
    access across devices and platforms.
  • Ideal for data synchronisation, backup, or dealing with large data
62
Q

What are the limitations of SharedPreferences?

A
  • Main Thread Blocking: SharedPreferences’ synchronous API can block the main thread during disk I/O operations, leading to UI performance issues.
  • Multi-Process Use: not designed for use in multi-process applications. Accessing SharedPreferences from multiple processes can lead to data inconsistency.
  • Lack of Transaction Support: changes are committed immediately and cannot be rolled back if an operation fails partway.
63
Q

What is a Content Provider?

A
  • Designed for data storage, management, and sharing between different applications.
  • Abstraction layer between data source and UI code, separates data from the UI code. Allows apps to access, use, and modify the data source securely. Data validation, modify data storage without affecting UI code
64
Q

How is a Content Provider used?

A
  • Get permission
  • Get the ContentResolver
  • Create a content URI
  • Pick one of four basic actions: query, insert, update, delete
  • Display in the UI using Cursor
65
Q

What is a URI?

A
  • A Uniform Resource Identifier
  • It identifies resources within the app, in the external storage, or on the Internet.
66
Q

How do you create a Content Provider?

A
  • Create a class that extends from ContentProvider and implement its onCreate()
  • Register the Content Provider in the Manifest file
  • Define URIs
  • Add URIs to the Contract class
  • Build a URIMatcher
  • Implement the CRUD and getType() methods