Week 9 - ListActivity, Explicit Intents, SQLite DB, Styles, AsyncTask Flashcards
What is the difference between an implicit and explicit intent?
Implicit intents do not specify an activity to go to, where an explicit intent does.
How does one switch between multiple activities in an app?
It is possible to simply use startActivity() with an activity, but if the user needs to be able to return to the previous activity or data needs to be passed to the activity, an explicit intent is preferred.
How is data passed to an intent?
By calling putExtra() with a key-value pair on the intent objected after it has been created but before it is submitted to startActivity().
What is a ListActivity?
It is a subclass of Activity that is used to display a list of items. It contains a ListView that take up the entire screen.
In the Address Book app, what is the purpose of the DatabaseConnector class?
It encapsulates direct database operations and provides a simpler, domain specific methods for interacting with the database.
What kind of data should be stored in the SQLite database?
Large or complex data that should persist indefinitely (until explicitly deleted).
What is an AsyncTask?
It is an Android-specific alternative to Java threads for spawning a thread of execution to perform a task concurrently. It provides methods for providing progress information and the results of the AsyncTask.
Why should database accessed be wrapped in an AsyncTask?
Because database accessed are unpredictable, i.e. they can take a varying amount of time to complete. In order to prevent the app from stalling, the database access should take place on its own thread.
What are styles used for?
They contain attributes that can be applied together to various views so to present a consistent look.