CS 213 SOFTWARE METHODOLOGY - Android Essentials

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/54

flashcard set

Earn XP

Description and Tags

Flashcards covering essential Android development concepts, components, and lifecycle management.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

55 Terms

1
New cards

Android apps can be written using what languages?

Kotlin, Java, or C++

2
New cards

What is an APK (Android Package)?

An archive file with an .apk suffix containing all the contents of an Android app.

3
New cards

How does Android protect apps?

Each Android app lives in its own security sandbox, protected by Android security features.

4
New cards

How is Android's OS structured in relation to apps?

The Android OS is a multiuser Linux system where each app is a different user.

5
New cards

What is the app management principle implemented by the Android system for security?

The system implements the principle of least privilege, meaning each app has access only to the components it requires.

6
New cards

What are the four main types of app components in Android?

Activities, Services, Broadcast receivers, and Content providers

7
New cards

What class is a crucial component of an Android app?

The Activity class

8
New cards

How does the Android system initiate code in an Activity instance?

By invoking specific callback methods corresponding to a specific stage of its lifecycle.

9
New cards

What is the primary function of an Activity in Android?

An activity provides the window in which the app draws its UI.

10
New cards

How do you use activities in your app?

To register information about them in the app’s manifest and manage activity lifecycles appropriately.

11
New cards

Where does the system preserves the activity?

A stack (the "back stack").

12
New cards

What is a task in Android?

A collection of activities users interact with when performing a certain job.

13
New cards

What is the purpose of the onCreate() method in an Activity?

This callback fires when the system first creates the activity. You perform basic application startup logic here.

14
New cards

After the onCreate() method finishes execution, what state does the activity enter?

The activity enters the Started state, and the system calls the onStart() and onResume() methods in quick succession

15
New cards

What happens when the activity enters the Resumed state?

When the activity enters the Resumed state, it comes to the foreground, and the system invokes the onResume() callback. This is the state in which the app interacts with the user.

16
New cards

What is the purpose of the onPause() method?

The system calls this method as the first indication that the user is leaving your activity.

17
New cards

What happens when your activity is no longer visible to the user?

The system invokes the onStop() callback, and the app should release resources not needed while the app is not visible.

18
New cards

When is onDestroy() called?

onDestroy() is called before the activity is destroyed.

19
New cards

What is the primary function of a Service in Android?

A service performs long-running operations in the background without a UI.

20
New cards

How do you declare a service in Android?

To declare your service, add a element as a child of the element in the manifest file.

21
New cards

What is the purpose of Broadcast Receivers?

Send or receive broadcast messages from the Android system and other Android apps, similar to the publish-subscribe design pattern.

22
New cards

What is the purpose of Content Providers?

To manage access to data stored by itself or other apps and provide a way to share data securely.

23
New cards

Who or what controls an application process's lifetime in Android?

The application itself does not directly control an application process's lifetime; the system does.

24
New cards

How do you start a new activity in Android?

startActivity() or startActivityForResult(), passing in an Intent object.

25
New cards

How often will an app enter and exit an activity during its lifetime?

An app's likely to enter/exit activities many times during its lifetime.

26
New cards

What is the sequence of lifecycle callbacks when Activity A starts Activity B?

Activity A's onPause(), Activity B's onCreate(), onStart(), and onResume() in sequence, then Activity A's onStop() if no longer visible.

27
New cards

What is needed to activate a component in another app?

To activate a component in another app, deliver a message to the system that specifies your intent to start a particular component. Activities, services, and broadcast receivers are activated by an asynchronous message called an intent.

28
New cards

What does the Intent object specify?

An Intent object specifies the exact activity you want to start or describes the type of action you want to perform.

29
New cards

How does the documentation describe an Intent?

An Intent provides a facility for performing late runtime binding between different applications. It is a passive data structure holding an abstract description of an action to be performed.

30
New cards

What are the two types of Intents?

Explicit intents specify which application will satisfy the intent, using the target app's package or component class name. Implicit intents declare a general action, allowing other apps to handle it.

31
New cards

What is an intent filter?

An intent filter is an expression in an app's manifest file that is used to specify which types of intents that the component would like to receive.

32
New cards

What is the primary information contained in an Intent object?

Component name, Action, Data, Category, and Extra

33
New cards

Why advertise implicit intents your app can receive?

To advertise which implicit intents your app can receive.

34
New cards

What is Context in Android?

It is an Interface to global information about an application environment. It allows access to application-specific resources and classes

35
New cards

What is the primary task of the manifest file?

To inform the system about the app's components.

36
New cards

What elements are used to declare app components in the manifest file?

, , , and

37
New cards

Why declare app requirements in the Manifest file?

To prevent your app from being installed on devices that lack features needed by your app.

38
New cards

What are App Resources?

Resources are separate from the source code, such as images, audio files, and anything relating to the visual presentation of the app.

39
New cards

What is the difference between a drawable resource and a layout resource?

A drawable resource is a general concept for a graphic that can be drawn to the screen. A layout resource defines the architecture for the UI in an Activity.

40
New cards

What comprises your app's user interface?

Everything the user can see and interact with.

41
New cards

How are all elements in a Layout built?

A hierarchy of View and ViewGroup objects.

42
New cards

What are the two ways you can declare a layout?

Declaring UI elements in XML or instantiating layout elements at runtime.

43
New cards

What are XML layout files compiled into?

XML layout files are compiled into a View resource.

44
New cards

Which method should be used to load the layout resource from your app code?

setContentView()

45
New cards

Name 5 common Android views.

textView, editText, Button, ScrollView and ImageView.

46
New cards

Define XML layout attributes.

Attributes which layout parameters for the View that are appropriate for the ViewGroup in which it resides.

47
New cards

Define ConstraintLayout.

ConstraintLayout allows you to create large and complex layouts with a flat view hierarchy.

48
New cards

What layout parameter means as big as its parent (minus padding)?

match_constraint

49
New cards

What is the function of a toast?

A toast provides simple feedback about an operation in a small popup.

50
New cards

What method is used to instantiate a Toast object?

Toast.makeText()

51
New cards

What is displayed in the Logcat window in Android Studio?

The Logcat window in Android Studio displays system messages and messages that you added to your app with the Log class.

52
New cards

What is a Bundle and what is it used for?

A Bundle is a collection of data, stored as key/value pairs, used to pass information between activities.

53
New cards

What three identifiers do versions of Android have?

Versions of Android have a version number, API level, and code name.

54
New cards

What is an APK?

An APK is an Android application package, similar to a JAR file, containing your app’s bytecode, libraries, and resources.

55
New cards

Where to Android aps run?

Android apps run in separate processes using the Android runtime (ART).