Sqlite_for_android

Description of how to use Sqlite for android - Udacity Android Basics Nanodegree

View on GitHub

Sqlite_for _android : Contains Steps , solution for Errors that I faced while implementing it in projects

Steps on how to install sqlite:

Procedure :

  1. Define a schema & a contract
  2. Create a database using SQL HELPER
  3. Add a cursor to it
  4. Use content provider
  5. Use cursor loader
  6. Use content URI
  7. Use URI matcher
  8. Sanity checking
  9. Implement contentprovider[MIME Type]

Why we need Contract class :

Contract class contains :

Use of SQLiteOpenHelper :

How to implement SQLiteOpenHelper :

  1. Create a class that extends from SQLiteOpenHelper
  2. Create constants for DBnames & DBversions
  3. Create a constructor
  4. Implement onCreate() method
  5. Implement onUpgrade() method

Getting a database connection :

Cursor :

Acessing sqlite3 database in Androidstudio : as1

Use of Content provider :

Use of Cursor loader :

Activities to be done to implement a Cursor loader :

  1. onCreate()[getLoaderManager().initLoader()]
  2. onCreateLoader()
  3. onLoadFinished()[use swapCursor(cursor) in this method]
  4. onLoaderReset()[use swapCursor(null) in this method]
    • https://developer.android.com/reference/android/widget/CursorAdapter?utm_source=udacity&utm_medium=course&utm_campaign=android_basics

How does other app access database of an another app :

How does the Content URI matches with correct content provider :

Use of Content URI :

Why URI matcher is needed :

Steps to create a URI matcher :

Sanity checking :

Why to declare MIME Type :

Implement this [method] to handle requests for the MIME type :

Related to UI :

Error:class or interface expected:

Projects done using Sqlite:

Web links :

Code reference :

Sql injection : https://www.netsparker.com/blog/web-security/sql-injection-vulnerability/