Lesson 4 - Intents Flashcards

1
Q

Intents

A

messaging objects; let an app request that an action take place; e.g. start new activity, display photo, make a call, etc.

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

Intents metaphor

A

“envelopes”; who (which component) to send to, bit of data - packaged as EXTRAs (primitive tuples)

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

explicit intent

A

includes name of target component

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

add activity how?

A

dropdown menu for new activity, or file->new file

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

add data to intent how?

A

put extra; stuffs data into intent

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

putExtra() data retrieved how?

A

key, value; like JSON. putExtra(String name, String value)

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

putExtra() String, String example

A

startChildActivityIntent.putExtra(Intent.EXTRA_TEXT, textEntered);

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

how to get intent that created this activity; “get envelope”

A

getIntent();

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

get string out of Intent; “open envelope”

A

getStringExtra(String name)

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

explicit intent is?

A

where we know exactly what activity to start

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

how to make explicit intent?

A

Intent(context, classOfActivityToStart)

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

implicit intent is?

A

where we don’t know or care how our request will be fulfilled

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

how to find examples of most used intents?

A

“common intents”

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

URI?

A

like an address to data

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

intent to launch website?

A

Intent(Intent.ACTION_VIEW, webpageUri)

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

URI template

A

scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]

17
Q

media type

A

2 part identifier for content on internet

18
Q

media type information

A

type, subtype, optional parameters

19
Q

media type text example

A

text, html, charset=UTF8

20
Q

ShareIntent.IntentBuilder syntax

A
ShareIntent.IntentBuilder
    .from(this)
    .setChooserTitle(title0
    .setType(mimeType)
    .setText(text)
    .startChooser();
21
Q

.startChooser();

A

IntentBuilder is basically a helper class for constructing sharing intents(Intent#ACTION_SEND and Intent#ACTION_SEND_MULTIPLE) and starting activities to share content.

also is there any other differences between these two functions

Under the hood, both startChooser() and startActivity() perform same action. startChooser() just wraps startActivity().