MOBPROG FINAL EXAM 100 ITEM

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/99

encourage image

There's no tags or description

Looks like no tags are added yet.

100 Terms

1
New cards

[M1] What is Android?

A mobile operating system based on the Linux kernel.

2
New cards

[M1] Which company originally developed Android, and when did Google acquire it?

Android Inc.; Google acquired it in 2005.

3
New cards

[M1] Which phone carried the first commercial Android release?

HTC Dream.

4
New cards

[M1] Which Android version first used an official dessert codename?

Android 1.5 — Cupcake. — Android 1.0 and 1.1 had no official dessert codenames.

5
New cards

[M1] Which Android release is associated with Wi-Fi hotspot support?

Android 2.2 — Froyo.

6
New cards

[M1] Which Android version family was designed especially for tablets?

Android 3.0-3.2 — Honeycomb. — The course sample associates Honeycomb with tablets and a revised 3D interface.

7
New cards

[M1] Which Android release is associated with Material Design and ART?

Android 5.0-5.1 — Lollipop. — ART stands for Android Runtime.

8
New cards

[M1] Which Android release introduced runtime permissions and fingerprint authentication?

Android 6.0 — Marshmallow.

9
New cards

[M1] Which Android release is associated with native split-screen mode and Data Saver?

Android 7.0 — Nougat.

10
New cards

[M1] Which Android release is associated with picture-in-picture and adaptive icons?

Android 8.0 — Oreo.

11
New cards

[M1] Which Android release introduced a system-wide dark theme?

Android 10.

12
New cards

[M1] What five Android architecture layers does the module list, from top to bottom?

Applications → Android Framework → Android Runtime → Platform Libraries → Linux Kernel. — The Linux kernel forms the foundation; the framework exposes services used by apps.

13
New cards

[M2] Which two development tools are listed as prerequisites in Module 2?

JDK and Android Studio. — JDK means Java Development Kit.

14
New cards

[M2] Where do you create and modify source code in Android Studio?

The editor window. — The toolbar provides actions such as Run; the status bar shows IDE or project status and warnings.

15
New cards

[M2] What must you enable on a connected Android phone before debugging the app over USB?

USB debugging in Developer options.

16
New cards

[M2] Which Android Studio tool is used to create an emulator device in the module?

Device Manager → Create Device. — Choose a device profile and an Android system image/SDK version.

17
New cards

[M3] Which company developed Kotlin?

JetBrains. — Kotlin interoperates with Java, so Java and Kotlin code can coexist in a project.

18
New cards

[M3] Which keyword declares a function in Kotlin?

fun. — Example: fun greet() { println("Hello") }

19
New cards

[M3] What is the entry-point function of a simple standalone Kotlin program?

main(). — Example: fun main() { println("Hello") }; Kotlin statements do not require semicolons.

20
New cards

[M3] How do val and var differ in Kotlin?

val creates a read-only reference; var allows reassignment. — A val reference cannot be reassigned after initialization.

21
New cards

[M3] How do you write single-line and block comments in Kotlin?

// single-line comment; /* block comment */.

22
New cards

[M3] Which Kotlin function creates an array from supplied elements?

arrayOf(). — Example: val items = arrayOf("A", "B", "C")

23
New cards

[M3] What does println(5 > 3 && 5 < 10) print in Kotlin?

true. — Both comparisons are true, and && requires both conditions to be true.

24
New cards

[M3] Which Kotlin expression selects among multiple branches, similar to switch?

when.

25
New cards

[M3] Which Kotlin loop executes its body at least once before testing the condition?

do-while. — A while loop checks its condition before the body.

26
New cards

[M3] Which values does for (i in 1..3) iterate over?

1, 2, and 3. — The .. range includes both endpoints.

27
New cards

[M3] How do you create an instance of MyClass named myObj in Kotlin?

val myObj = MyClass() — Kotlin constructor calls do not use the Java new keyword.

28
New cards

[M3] In class Person(val name: String), what does val name: String declare?

A primary-constructor parameter that also defines a read-only String property.

29
New cards

[M3] Which keyword makes an ordinary Kotlin class available for inheritance?

open — for example, open class Base. — A subclass names its superclass after a colon, as in class Child : Base().

30
New cards

[M3] What does the question mark mean in the Kotlin type String?

It makes the type nullable: the variable can hold a String or null. — String without ? does not allow null in ordinary Kotlin code.

31
New cards

[M4] Which file declares Android application components?

AndroidManifest.xml. — For example, an element is placed inside .

32
New cards

[M4] Which Android app component supports background operations such as music playback?

Service.

33
New cards

[M4] Which Android app component responds to broadcast messages from the system or other apps?

BroadcastReceiver.

34
New cards

[M4] Which Android app component exposes app data to other apps through a standard interface?

ContentProvider. — Clients access the provider through ContentResolver.

35
New cards

[M4] Which additional Android component represents a portion of an activity's user interface?

Fragment.

36
New cards

[M4] Where are XML user-interface layout files stored in an Android project?

res/layout/. — Example: res/layout/activity_main.xml is referenced in code as R.layout.activity_main.

37
New cards

[M4] Where are image and drawable XML resources stored?

res/drawable/. — Example: myimage.png can be referenced as R.drawable.myimage.

38
New cards

[M4] Which res/ subdirectory holds simple values such as strings, colors, and dimensions?

res/values/. — Typical files include strings.xml, colors.xml, and dimens.xml.

39
New cards

[M4] How do you reference the string resource myapp in code and in XML?

Code: R.string.myapp; XML: @string/myapp. — The generated R class contains resource IDs for resources under res/.

40
New cards

[M5] What does an Android activity represent in the course's screen-based model?

A screen with a user interface that handles user interaction. — An app may contain one or more activities.

41
New cards

[M5] Which activity callback runs when the activity is first created?

onCreate(). — For the XML-based examples, setContentView(R.layout.activity_main) loads the layout here.

42
New cards

[M5] Which activity callback runs when the activity becomes visible?

onStart().

43
New cards

[M5] Which activity callback marks entry into the foreground state in which the user can interact with it?

onResume(). — Initial launch normally follows onCreate() → onStart() → onResume().

44
New cards

[M5] Which callback runs when an activity loses foreground focus but may remain visible?

onPause(). — A paused activity can still execute code; the slide's claim that it cannot execute any code is incorrect.

45
New cards

[M5] Which activity callback runs when the activity is no longer visible?

onStop(). — An activity can be paused while still visible, so onPause() and onStop() describe different transitions.

46
New cards

[M5] If a stopped activity instance returns to the foreground, what callback sequence does it follow?

onRestart() → onStart() → onResume(). — This assumes the existing activity instance was retained.

47
New cards

[M5] Which callback is associated with the normal destruction of an activity instance?

onDestroy(). — It is not guaranteed to run if Android kills the app process.

48
New cards

[M6] How does a View differ from a ViewGroup?

A View is a UI element; a ViewGroup is a container that arranges child Views or other ViewGroups. — Examples: TextView is a View; LinearLayout is a ViewGroup.

49
New cards

[M6] What two ways of defining View-based Android interfaces does the module describe?

Declare UI elements in XML, or instantiate them programmatically at runtime. — A regular XML view hierarchy has one root View or ViewGroup.

50
New cards

[M6] What is the difference between @+id/submit and @id/submit in Android XML?

@+id/submit declares the ID if needed; @id/submit references an existing ID. — The corresponding generated code reference is R.id.submit.

51
New cards

[M6] How do match_parent and wrap_content differ?

match_parent sizes a dimension to the parent's available space; wrap_content sizes it to fit the view's content.

52
New cards

[M6] Which layout arranges child views in one horizontal row or one vertical column?

LinearLayout. — android:orientation selects horizontal or vertical.

53
New cards

[M6] Which layout positions children relative to one another or to the parent?

RelativeLayout. — Example: place one view below another or align it with the parent's top.

54
New cards

[M6] Which layout commonly stacks child views, with later children drawn over earlier ones?

FrameLayout. — It can contain multiple children, even though it is often used as a placeholder for one main item.

55
New cards

[M6] Which layout organizes child views into table rows and columns?

TableLayout. — TableRow represents a row; TableLayout does not draw cell borders automatically.

56
New cards

[M6] Which Android view embeds HTML or web-page content inside an activity?

WebView. — It does not automatically provide a full browser's address bar and navigation controls.

57
New cards

[M6] How do ListView and GridView differ in the way they display adapter-supplied items?

ListView displays items as a scrollable list of rows; GridView displays them in a two-dimensional scrollable grid. — An adapter connects the data source to these views.

58
New cards

[M6] Which control displays text, and which control lets the user edit text?

TextView displays text; EditText supports text entry and editing.

59
New cards

[M6] Which controls suit multiple independent choices versus one mutually exclusive choice?

CheckBox for independent choices; RadioButtons in a RadioGroup for one choice within that group.

60
New cards

[M6] Which listener and callback handle a normal click on a View?

View.OnClickListener with onClick(View v). — Register the listener with setOnClickListener(...).

61
New cards

[M6] Which listener and callback handle a hardware key press or release on a focused View?

View.OnKeyListener with onKey(...). — The slide incorrectly pairs onKey() with OnFocusChangeListener.

62
New cards

[M7] What is an Android Intent?

A messaging object describing an operation to perform, such as launching an activity or communicating with another component.

63
New cards

[M7] How does an explicit Intent differ from an implicit Intent?

An explicit Intent names the target component; an implicit Intent describes an action without naming a specific target.

64
New cards

[M7] Which activity method launches another activity using an Intent?

startActivity(intent).

65
New cards

[M7] Which Intent method attaches one named value to send to another component?

putExtra(key, value). — Example: intent.putExtra("username", "Alex"); extras are key-value pairs.

66
New cards

[M7] Which Intent method retrieves the attached Bundle of extras in the destination component?

getExtras(). — The destination extracts values from the returned Bundle using the same keys used by the sender.

67
New cards

[M7] What is a Bundle used for when transmitting data between Android components?

It groups typed values under String keys so multiple key-value pairs can be passed together. — Intent.putExtras(bundle) attaches the Bundle.

68
New cards

[M8] What is a Toast in Android?

A small popup that briefly gives feedback and disappears automatically. — The current activity stays visible and interactive.

69
New cards

[M8] Which three arguments does Toast.makeText(...) take?

Context, message text, and duration. — Call show() on the returned Toast to display it.

70
New cards

[M8] Where does the user open a notification's details and available actions?

The notification drawer, usually opened by swiping down from the status bar.

71
New cards

[M8] What happens to an eligible heads-up notification after its temporary floating banner disappears?

It remains in the notification drawer until it is dismissed or removed. — Heads-up notifications were introduced in Android 5.0; the banner is brief.

72
New cards

[M8] What is the colored badge that supported launchers can show for new notifications on Android 8.0+?

A notification dot on the app's launcher icon.

73
New cards

[M8] Which builder method sets the required small icon of a standard Android notification?

setSmallIcon(...). — setContentTitle(...) sets the title; setContentText(...) sets the body.

74
New cards

[M8] What three constructor arguments identify and configure a NotificationChannel?

Channel ID, user-visible channel name, and importance. — Register it with createNotificationChannel(); notification channels apply from Android 8.0/API 26.

75
New cards

[M8] Which setting controls notification interruptiveness on Android 8.0+, compared with Android 7.1 and below?

Android 8.0+: channel importance; Android 7.1 and below: notification priority via setPriority(). — The system and user settings also affect alert behavior.

76
New cards

[M8] What object defines a notification's tap action, and which builder method attaches it?

A PendingIntent, attached using setContentIntent(...). — A common tap action opens a relevant activity.

77
New cards

[M8] Which call posts a notification built with NotificationCompat.Builder?

NotificationManagerCompat.notify(notificationId, builder.build()). — Keep the notification ID so that you can update or remove that notification later.

78
New cards

[M9] Which class should you extend to manage creation and versioning of a local SQLite database?

SQLiteOpenHelper. — It provides lifecycle hooks such as onCreate() and onUpgrade().

79
New cards

[M9] Which SQLiteOpenHelper callback runs when the database is created for the first time?

onCreate(SQLiteDatabase db). — Create the initial tables here.

80
New cards

[M9] Which SQLiteOpenHelper callback handles an increase in an existing database's version?

onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion). — Use it to migrate the schema from the old version to the new version.

81
New cards

[M9] Which SQLiteOpenHelper methods obtain a database for reading or writing?

getReadableDatabase() and getWritableDatabase().

82
New cards

[M9] What default private database directory is expected in the supplied Android SQLite sample?

/data/data//databases/. — The actual path can use /data/user//...; context.getDatabasePath(name) obtains the database file's path.

83
New cards

[M9] What is the purpose of a SQLite database contract class?

To centralize constants for table names, column names, and related schema identifiers. — A schema describes how the database is organized.

84
New cards

[M9] What object holds column-value pairs when you insert a row using SQLiteDatabase.insert()?

ContentValues. — Example: db.insert("notes", null, values);

85
New cards

[M9] What object does SQLiteDatabase.query() return?

A Cursor containing the result rows. — The projection specifies the columns to retrieve.

86
New cards

[M9] A query Cursor starts at position -1. What does the first successful moveToNext() do?

It moves to the first result row, at position 0. — It returns false if no next row exists; use a move method before reading column values.

87
New cards

[M9] Which method releases a Cursor's resources when you finish reading its results?

cursor.close(). — Calling open() is not how you release a Cursor.

88
New cards

[M9] What does SQLiteDatabase.delete() return?

The number of rows deleted.

89
New cards

[M9] How should you supply untrusted WHERE-clause values to an Android SQLite query, update, or delete operation?

Use ? placeholders with selectionArgs instead of concatenating the values into SQL. — For insert/update column values, use ContentValues; update() modifies existing rows.

90
New cards

[M10] What does JSON stand for, and what is it used for?

JavaScript Object Notation; a lightweight text format for storing and exchanging data.

91
New cards

[M10] How is a name/value pair written inside a JSON object?

"name": value — a double-quoted name, a colon, then the value. — Commas separate members; for example: {"name":"Alex","age":25}.

92
New cards

[M10] Which delimiters identify a JSON object versus a JSON array?

Curly braces { } hold an object; square brackets [ ] hold an array. — An array contains ordered values and can contain objects.

93
New cards

[M10] Which Java statement creates a JSONObject from a JSON string named jsonString?

JSONObject obj = new JSONObject(jsonString); — In Java, handle or declare JSONException when required by the parsing API.

94
New cards

[M10] Which JSONObject method retrieves a string stored under the key name?

getString("name"). — Example: obj.getString("name");

95
New cards

[M10] Which JSONObject getters retrieve a nested object and a nested array?

getJSONObject("key") for an object; getJSONArray("key") for an array. — Using getJSONObject() is not the correct way to retrieve an array.

96
New cards

[M10] Given {"user":{"hobbies":["reading","gaming"]}}, which org.json chain retrieves "reading" from jsonObject?

jsonObject.getJSONObject("user").getJSONArray("hobbies").getString(0); — Array indexes start at 0.

97
New cards

[M10] Given {"company":{"employees":[{"name":"John"},{"name":"Jane"}]}}, which org.json chain retrieves "Jane" from json?

json.getJSONObject("company").getJSONArray("employees").getJSONObject(1).getString("name"); — The second employee is at index 1.

98
New cards

[M10] Which org.json class builds JSON text through calls such as object(), key(), value(), and endObject()?

JSONStringer.

99
New cards

[M10] What is the correct Android org.json class name for tokenizing/parsing JSON text?

JSONTokener. — The module's spelling JSONTokenizer is incorrect.

100
New cards

[M10] What does length() return for a JSONObject?

The number of name/value mappings in that object. — Example: {"name":"Alex","age":25} has length 2.