Exam Content Flashcards

1
Q

What are the Android Emulator limitations?

A
No USB support
No Bluetooth support
No Headphone support
No SD support
No NFC support
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a task?

A

A task is a stack of activities

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

How do you get intent data from an intent

A

Use the getIntent(), getData(), getExtra() methods

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

How do you get a result from another activity?

A
Create an intent going from one intent to another
Add any required data/extras to intent
Call startActivityForResult(intent)
Do whatever processing is required in Activity B
Call setResult(code, inent) in Activity B
Call finish() in Activity B
Implement onActivityResult() in Activity A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Activity lifecycle?

A
onCreate()
onStart()
onResume()
onPause()
onStop()
onDestroy()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the task backstack?

A

The task backstack is the stack containing all active Activities, activities are pushed to it when startActivity() is called and popped when the user goes back - i.e. finish() is called.

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

How do you send and receive an implicit intent?

A

(Make sure activity has an intent filter)
Create an intent object with an action parameter
Add data/extra info to the intent
Resolve intent activity - otherwise will crash
Send the intent with startActivity()
Use the getIntent(), getData() and getExtras() methods to receieve an intent

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

What are the differences between SavedInstanceState and SharedPreferences?

A

SavedInstanceState does not persist across user sessions, SharedPreferences does
SharedPreferences stores user preferences, SavedInstanceState recreates the state after a screen rotation
Both save small amounts of private data

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

What are the main features of an SQLite database?

A

Lightweight, local, no config., no server, easily backedup, store any-type of value

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

What are retreival queries?

A

Essentially an SQL select statement, can be achieved via a rawQuery() or just a simple query()

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

What are action queries?

A
Queries that manage the database, eg. table creation, column insertion etc.
Use execSQL() for this task
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What parameter do simple queries take?

A

Tablename, Columns, WHERE, WHERE_ARGS, groupBy, Having, Order_by)

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

How do you implement a drag gesture?

A
Implement view.onDragListener
Implement onDrag(view, event)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the phases of a drag?

A

Started, Continuing, Dropped and Ended

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

How do you implement an AsyncTaskLoader?

A

Initialise loader ID
In onCreate() initialise a loader with (id, null, this)
Create a loader manager and get the loader with specific loaderID
Implement all required methods for interface: onCreateLoader(), onLoadFinished(), onLoaderReset()

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

Why Content Providers?

A

They provide a standard interface for multiple apps to read, modify and write data without affecting UI code securely

17
Q

Why Content Resolvers?

A

System needs mechanism to distinguish content providers in order to route the URI to the correct place

18
Q

How do you start a service?

A
  • Register the service in the manifest
  • Create an intent which whatever data, extras you want
  • Call startService(intent) which will call onCreate and other callbacks
  • Passes the intent to the onStartCommand()
  • Stops itself with stopSelf() or manually via stopService()
  • Handle the service’s lifecycle
19
Q

What are examples of system Broadcast Intents?

A
  • ACTION_POWER_CONNECTED, ACTION_DEVICE_STORAGE_LOW
20
Q

How is a custom Broadcast Intent sent?

A
  • Create an intent
  • Set custom action
  • sendBroadcast(intent)
21
Q

What are the design principles of a notification?

A
  • Timely
  • Concise
  • Relevant
  • Manageable by the user
22
Q

How do you test a view using Espresso?

A
  • Find the view: onView(withId(R.id.view))
  • Perform the action: perform(ViewAction)
  • Check it has behaved correctly: check(ViewAssertion)
23
Q

How do you test an AdapterView using Espresso?

A
  • The onView() method doesn’t work, so use the onData() method instead
  • onData(Object).DataOptions.perfrom(ViewAction).check(ViewAssertion)
24
Q

What steps should you take when preparing for release?

A
  • Choose a good package name
  • Turn off logging and debugging
  • Clean up directories
  • Check manifest settings
  • Update URLs for servers
25
Q

Explain how codesigning works.

A
  • App must be signed by the developer’s private key in order to be released
  • Debugging builds are signed with special debug key
  • Only release key will suffice for release builds