Kotlin SQLite example - CRUD operations with ListView | Android

Kotlin SQLite example - CRUD operations with ListView | Android

https://grokonez.com/android/kotlin-sqlite-example-crud-operations-with-listview-android

SQLite is an Open Source database that supports standard relational database features like SQL syntax, transactions and prepared statements. Each column in an SQLite database is assigned one of data types: NULL, INTEGER, REAL, TEXT, BLOB. In this tutorial, we're gonna look at how to make SQLite CRUD operations when interacting with ListView.

Related Posts:

More Practice: Kotlin SQLite example – Search with Listview | Android

I. Technologies

  • Android Studio 3
  • Kotlin 1.1.51

    II. Overview

    1. Goal

    We will build an Android App that supports showing, inserting, editing, deleting Notes from/to SQLite Database with ListView:

kotlin-sqlite-goal

2. SQLite

2.1 SQLiteDatabase

SQLiteDatabase is the base class for working with a SQLite Database in Android. It provides:

  • insert(), update(), delete() method
  • execSQL() to execute an SQL statement directly

To work with SQLite Database, we create a subclass of SQLiteOpenHelper class:

  • constructor: call super() method to specify database_name, version and context
  • override onCreate() to execute CREATE TABLE command
  • override onUpgrade() to handle database version increment
  • indicate read/write mode by using getReadableDatabase() or getWritableDatabase() method

More at:

https://grokonez.com/android/kotlin-sqlite-example-crud-operations-with-listview-android

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

Male avatar

loveprogramming

451 bài viết.
79 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
Male avatar
1 0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...
loveprogramming viết 6 tháng trước
1 0
Male avatar
1 0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...
loveprogramming viết 5 tháng trước
1 0
Male avatar
1 0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
loveprogramming viết 5 tháng trước
1 0
Bài viết liên quan
Male avatar
0 0
https://grokonez.com/kotlin/kotlinreadwritecsvfileexample How to read/write CSV file in Kotlin In this tutorial, we're gonna look at examples tha...
loveprogramming viết 7 ngày trước
0 0
Male avatar
0 0
https://grokonez.com/frontend/angular/angular6/kotlinspringbootangular6crudhttpclientmysqlexamplespringdatajparestapisexample Kotlin Spring Boot +...
loveprogramming viết 1 tháng trước
0 0
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


Male avatar
{{userFollowed ? 'Following' : 'Follow'}}
451 bài viết.
79 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!