1

Why use SQLite in android?

  • i. SQLite is a lighter version of SQL, to store data in the form of tables, targeted for embedded devices like phones and tablets.
  • ii. Since embedded devices have limited CPU speed and limited memory, they can't afford heavy weight DBMS softwares like SQL and SQLServer. So embedded devices like phones and tablets opt for SQLite which is lighter version of SQL dbms, to store their data in table formats.
  • iii. SQLite is a RDBMS.
  • i
  • i & ii
  • i, ii, & iii
  • i & iii

Answer: C i, ii, & iii
Description:

2

What is the use of SQlite open helper class in SQLite?

  • A helper class provides functionalities for deleting rows, inserting data into rows into a table.
  • A helper class allows database management ,creation and version management. This is the class where we will create all the tables, and upgrade tables.
  • A helper class is used for fetching the data from remote servers and storing it into SQLiteDatabase.
  • None are correct

Answer: B A helper class allows database management ,creation and version management. This is the class where we will create all the tables, and upgrade tables.
Description:

3

What is the use of onUpgrade function in SQLiteOpenHelper?

  • onUpgrade is a function available in SQLite DataBase which is used to update rows in a table.
  • onUpgrade function available in SQLite DataBase which is used to update table names.
  • onUpgrade is basically for handling new db changes(could be new columns addition,table addition) for any new version of your app.
    Droping the table is not always necessary in onUpgrade it all depends on what your use case is. If the requirment is to not to persists the data from your older version of app then drop should help,but if its like changing schema then it should only have alter scripts.
  • None are correct

Answer: C onUpgrade is basically for handling new db changes(could be new columns addition,table addition) for any new version of your app.
Droping the table is not always necessary in onUpgrade it all depends on what your use case is. If the requirment is to not to persists the data from your older version of app then drop should help,but if its like changing schema then it should only have alter scripts.
Description:

4

How many ways are there to store persistent data by using an Android application?

  • 1. Shared Preferences
  • 2. Internal Storage
  • 3. External Storage
  • 4. SQLite Database
  • 5. Storing in network servers
  • 2,3
  • 2,3,4
  • 1,2,3,4
  • 1,2,3,4,5

Answer: D 1,2,3,4,5
Description:

5

How to show SQLite Database table information in android application? what is the best way to do it?

  • Use listview with cursor adapter.
  • Use grid view with cursor adapter
  • Use table layout with cursor adapter.
  • Use table layout with cursor

Answer: D Use table layout with cursor
Description: Showing data base information will be better suited with table layout. since table layout is not an adapter view, you can't use cursor adapter with it. So use table layout with cursor to show data base table information.

6

I have thousands of columns and thousands of rows to display it in UI tabular format, how should I show it this dynamically growing UI. Should I load all in single shot or any optimization can be done?