Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 220.127.116.11 release ready!
Owner and Founder. Opencart
In this blog,
I have shown how to use the database SQLite in android. I have shown how to create table, insert values in that table and fetch that data from the table to access.
SQLITE: SQLite is an open source SQL database which stores the data to a text file on a device.
Android uses the SQLite database for implementation.
There are some steps to use the SQLite in android.
Step 1: How to Create Database
For creating a database you have to call the method named openOrCreateDatabase with your database name and mode as a parameter.
SQLiteDatabase myDb = openOrCreateDatabase("my_database_name",MODE_PRIVATE,null);
Step 2: How to create table and insert in table
For creating the table or insert data into table using execSQL method defined in SQLiteDatabase class
myDb.execSQL("CREATE TABLE IF NOT EXISTS Webkul_Demo_Table(Username VARCHAR,Password VARCHAR);");
myDb.execSQL("INSERT INTO Webkul_Demo_Table VALUES('demo','demo');");
or we can use the ContentValues for the insertionan,
for the insertionan,
ContentValues values = new ContentValues(); values.put(Username, "demo"); values.put(Password, "demo");
Using this you can create and store the data in DB.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.