5. http://www.conlinetraining.com/courses/android-elearning-online-training/
Android
•Activity: A screen with which users can interact in order to do something.
•Intent: Messaging objects which used to request to perform a given
action from other components.
•Service: Used to run long running background task and does not
provide user interface.
•Broadcast Receiver: It allows to register and listen for device broadcast
announcements.
•Content Provider: (Next slide)
10. http://www.conlinetraining.com/courses/android-elearning-online-training/
Content Provider performs
•Content providers support the four basic operations, normally
called CRUD-operations. CRUD is the acronym for create, read, upd
ate and delete.
•Querying: Queries the Content Provider for all the objects, based
on the specified URI.
•Delete: Deletes the specified objects from the database of a Content
Provider.
•Update: Makes updates to the objects in the database.
•Insert: Inserts new object to the database.
12. http://www.conlinetraining.com/courses/android-elearning-online-training/
Needs of Content providers
•You do not need to develop your own provider if you want a private
database for a particular application (this database would not be
accessible to applications other than the one that created it).
•You however need a Custom provider to provide custom search
suggestions in your own application system.
•You would also need a Content Provider to copy and paste complex
data from your application to other applications.
16. http://www.conlinetraining.com/courses/android-elearning-online-training/
SCHEME
•The scheme for content providers is always “content”. The colon and
double-slash “://” are a fixed part of the URI-RFC and separate the scheme
from the authority.
•The next part is the authority for the content provider. Authorities have to
be unique for every content provider. Thus the naming conventions should
follow the Java package name rules. That is you should use the reversed do
main name of your organization plus a qualifier for each and every content
provider you publish.
•The third part, the optional path, is used to distinguish the kinds of data
your content provider offers.
•You can include another element i.e. the id(optional), which – if present –
must be numeric. The id is used whenever you want to access a single
record (e.g. a specific video file).
17. http://www.conlinetraining.com/courses/android-elearning-online-training/
Cursors
➢ Cursor is an interface that provides random read-write access to the result of
a database query from a content provider.
➢ A cursor is a collection of rows
➢ All field access methods are based on column number. You have to convert
column name to a column number first
➢ You can also find size / traverse result set easily.
Cursor cur;
for(cur.moveToFirst();!cur.isAfterLast();cur.moveToNext()) {
//access methods
}