How to use SQLite Database in android applications

Опубликовано: 28 Октябрь 2024
на канале: ID
2,648
7

How to use SQLite Database in android applications

Take your app to the top keyword installs: http://bit.ly/2Xyg176

Recommended way to get genuine real and safest reviews: http://bit.ly/2XDZlpD

Recommended way to boost your apps ranking: http://bit.ly/2G3nMa7

Recommended Best Ads Mediation Network: http://bit.ly/2JpoeSl

Recommended book about the app market: https://amzn.to/2JDjojo

Subscribe To My Channel and Get More Great Tutorials
http://www.youtube.com/subscription_c...


Android provides and API for managing your SQLite databases under android.database.sqlite package. This package provides a class SQLiteOpenHelper.java which has all the core functionality needed to create database and provides utility functions to be overridden by user. In your application you need to write a new database helper class extending from SQLiteOpenHelper, so that you only have to write the logic and avoid core operations.

SQLiteOpenHelper has a method “onCreate()” which will only be executed when database is first created. All the table creation and initial data insertion queries will be execute inside this method. So you need to write create table and default data insertion queries here. If there is an upgrade to database that should go under “onUpgrade()” method. Queries can simply be executed by calling “execSQL(YOUR_QUERY)” method on SQLiteDatabase object.
The source code is available at http://www.indragni.com/android/Datab...
Subscribe To My Channel and Get More Great Tutorials
http://www.youtube.com/subscription_c...
http://www.indragni.com/contact-us/

---------------------------------------­-----------
:
Website: http://www.indragni.com




How to use SQLite Database in android applications