SQL can also be used to read, update, and delete information from a database in Android. In Chapter 2, “An Introduction to SQL,” we saw how SQL is used to both create and upgrade a database. Working with SQL is a vital part of working with databases in Android. The LoaderManager contains the API for initializing and resetting a loader that may be used by Android components. LoaderManager: Manages all loaders for an activity or fragment. In most cases, the keys map to the column names of the table, and the values are the data to enter into the table.ĬursorLoader: Part of the loader framework that handles cursor objects. An app can read the data from a cursor and display it to a user or perform business logic based on the data contained in the cursor.ĬontentValues: A key/value store that inserts data into a row of a table. It contains methods to perform standard database CRUD operations as well as control the SQLite database file used by an app.Ĭursor: Holds the result set from a query on a database. SQLiteDatabase: Represents a database in Android. Following are the classes introduced in this chapter and a summary of how they are used to work with databases in Android: Along with the classes to support create, read, update, and delete (CRUD) operations, the SDK contains classes to help generate the queries that read the database. The Android SDK contains many classes to support database operations. This chapter explains how that is done in Android by discussing which Android SDK classes can be used to manipulate a database as well as query a database. Of course, this is only the first step as a database is not very useful until it contains data and allows software to run queries against that data. The previous chapter introduced the SQLiteOpenHelper and SQLiteDatabase classes and discussed how to create databases.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |