Chapter 3: Android development Flashcards

1
Q

What is an activity?

A

Activity is a fundamental component of an app. It provides the window which is used to draw the app’s UI.

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

What is the difference between an activity and a view?

A

Activity is a screen which the user sees that consists of different views and view groups. It has a life cycle.
View is a single component used to build the UI.

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

Why can an Android app easily be translated to different languages?

A

An app can be localized by placing string resources in different XML files so that each file contains string resources translated in different languages. After detecting the location of the user, the appropriate XML file is loaded.

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

What is the purpose of the manifest file?

A

The manifest file describes essential information about the app to Android build tools, the Android OS and Google Play. Every app must contain an AndroidManifest.xml file at the root of the project source set.

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

What are intents? Which kinds of intents do you know?

A

Intents are messaging objects that are used to facilitate communication between components of an Android app. Ex.: start activities, launch services and deliver broadcasts.
Implicit: used to perform an action without specifying the exact component to handle.
Explicit: used to start specific components within the same app.

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

What is an AsyncTask and how does it work?

A

AsyncTask is an object which allow to execute longer task in the background.
It makes use of a UI thread and a worker thread.
The UI thread executes a task and triggers the process to be computed on the worker thread. The worker thread then sends a progress update and finally the result.

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

Name three ways to persistently store data from your app.

A

Shared Preferences: store private primitive data in key-value pairs
Internal Storage: Store private data on device memory
External Storage: Store public data on shared external storage

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

Name three sensors an Android device can have.

A

TYPE_TEMPERATURE
TYPE_GRAVITY
TYPE_LIGHT
TYPE_GYROSCOPE
TYPE_PRESSURE

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

What do the various files in the Android app do?

A
  • Android Manifest: declare essential information for the Android system (permissions, components, requirements, metadata)
  • string.xml file: contains the text displayed within the app
  • xml files: store the layout directory for the app
How well did you know this?
1
Not at all
2
3
4
5
Perfectly