In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Tenth Lecture with The title of Android SQLite database.
SQLite is available on every Android device. Using an SQLite database in Android does not require any database setup or administration. You only have to define the SQL statements for creating and updating the database. Afterwards the database is automatically managed for you by the Android platform. In this chapter we will discuss about developing application with SQLite.
This document provides an overview and tutorial for using SQLite database tools in Android application development. It discusses the SQLiteOpenHelper and SQLiteDatabase classes, which are used to create, open, and manage an app's database. It then demonstrates how to create a database manager class that extends SQLiteOpenHelper to define the database structure, and includes methods like addRow(), deleteRow(), and updateRow() to interact with the database. The goal is to build reusable database functionality that can be included in most Android apps.
The document provides an overview of the Java Database Connectivity (JDBC) API. It discusses that JDBC allows Java applications to connect to relational databases and execute SQL statements. It describes the different types of JDBC drivers and the core JDBC classes like Connection, Statement, ResultSet, and their usage. The steps to connect to a database and execute queries using JDBC are outlined. Key concepts like processing result sets, handling errors, batch processing, stored procedures are also summarized.
This document provides an overview of different data storage options in Android including shared preferences, internal storage, external storage, SQLite databases, and network connections. It also includes examples and workshops for using each data storage type with key points on shared preferences, internal and external storage paths, SQLiteOpenHelper, CRUD operations, and displaying data in a ListView.
This document provides information on creating a 3-tier web application architecture in Eclipse using JSP. It discusses dividing classes into sub-tasks like views, services and database layers. It also covers creating packages, JSP pages, beans, getters/setters, and service layers. The service layer interacts with the database layer using JDBC to perform operations like registration. The presentation layer posts data to JSP pages, which then call the service layer.
The document discusses database connectivity between a front-end interface and back-end database. It explains that the front-end is the user interface where data is entered, and the back-end is an invisible database that stores and provides data to the application. It then outlines the key components needed for connectivity - the JDBC API and driver to allow Java applications to interact with MySQL databases. The final sections describe classes used for connectivity like DriverManager, Connection, Statement, and ResultSet, and the typical steps to set up connectivity in a Java application.
Create an android app for database creation using.pptxvishal choudhary
1) This document describes how to create an Android app to perform CRUD (create, read, update, delete) operations on a SQLite database.
2) It involves creating a SQLiteOpenHelper subclass to manage the database, along with methods to insert, query, update and delete data from the database table.
3) The Android app includes layout elements like buttons and text fields, and Java code to handle button clicks and call the appropriate database methods. Validation is also added to ensure required fields are populated.
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...TAISEEREISA
SQLite is an embedded SQL database that is included within Android applications. It allows creating, querying, and modifying a database without a separate server process. Developers can open and query a SQLite database using methods like openDatabase(), rawQuery(), execSQL(), and insert()/update()/delete(). This allows storing and retrieving application data, even when the device is offline.
This document discusses using SQLite databases in Android applications. SQLite is an embedded SQL database that does not require a separate server. It is included in the Android SDK and can be used to create and query database files. The document explains how to open a database, create tables, insert/update/delete rows using SQL queries, and retrieve data using cursors. Raw queries and simple queries can be used to perform retrieval queries on a single table. Transactions are used to commit or roll back changes to the database.
Zybotech solutions, offers job oriented courses on mobile application development for freshers and professionals with placement assistance, interactive training sessions with live project exposure.
This document provides an overview of Android application development training on accessing and manipulating data using SQLite databases on Android. It covers topics like what SQLite is, creating and connecting to databases, setting database properties, creating tables, inserting, updating, and deleting records from the databases using ContentValues and SQLiteDatabase methods. Code examples are provided for each topic.
This document provides instructions for connecting an SQLite database to an Android application using Android Studio. It describes creating a database using SQLite Manager and placing it in the Android project's assets folder. It then explains creating a Connection class with paths to the database folder and file. The document outlines creating a DataDB class to connect to the Connection class and calling getNameDB in the MainActivity to retrieve the database name. It provides code snippets for the Connection and DataDB classes.
SQLite is a lightweight database that can be used to persist data between sessions of an Android app. The SQLiteOpenHelper class manages database creation and upgrading, and provides methods like onCreate() and onUpgrade() to define how the database schema is set up. Queries can be performed on the database using the query() method of the SQLiteDatabase class to retrieve data as a Cursor object.
The document provides an overview of the Java Database Connectivity (JDBC) API. It describes key interfaces like Connection, Statement, and PreparedStatement that are used to connect to a database and execute SQL statements. It also covers ResultSet for accessing query results, and the use of transactions and savepoints for maintaining data integrity. Classes like DriverManager help establish the initial connection to access databases using JDBC.
Asp .Net Database Connectivity Presentation.pptxsridharu1981
This document provides an overview of connecting databases in ASP.NET using ADO.NET. It defines what a database and SQL are, and explains that in ASP.NET there are two main approaches to connecting to databases - ADO.NET and ORM tools like Entity Framework. It then focuses on using ADO.NET, describing how to declare connection strings, establish a connection using SqlConnection, execute commands with SqlCommand, read returned data with SqlDataReader, and close the connection once complete.
The document discusses several JDBC APIs used for connecting Java applications to databases. The Connection interface is used to create a connection to a database and execute SQL statements. The Statement interface executes static SQL queries and retrieves results. The PreparedStatement interface executes dynamic queries with IN parameters by using placeholder values set using methods like setInt() and setString(). Examples of using these interfaces will be provided in subsequent chapters.
This document provides a tutorial on summarizing the Spring Framework. It introduces the main packages in Spring Framework including the JDBC package for data access. The JDBC package has two main subpackages - com.interface21.jdbc.core which implements low-level persistence and com.interface21.jdbc.object which presents an object-oriented view. It provides code samples demonstrating how to perform queries, updates and retrieve results using these packages.
The document discusses how Java applications can connect to and interact with relational databases. It describes the typical structure for Java database access which involves a database driver, connection, and SQL statements. The key classes and interfaces in the java.sql package for working with JDBC are discussed, including DriverManager, Connection, Statement, PreparedStatement, and ResultSet. Examples are provided for how to load drivers, establish connections, execute SQL statements to insert, update, delete and retrieve data, and handle exceptions. Common errors that can occur with database access are also listed.
This document discusses different programming styles (Model A and Model B) for interacting with a database using embedded SQL in a J2ME application. Model A is used when SQL requests don't return a ResultSet, while Model B is used when requests return a ResultSet. Both styles minimize code by containing segments in a try block or DownRow() method. The document also covers SQL statements for creating, modifying and dropping database tables and indexes.
Database Programming: The Design of JDBC, The Structured Query Language, Basic JDBC Programming Concepts,
Result Sets, Metadata, Row Sets, Transactions
The document provides an overview of ADO.NET, which is Microsoft's data access technology for .NET applications to connect to and manipulate data in various data stores. It discusses key ADO.NET concepts like connections, commands, data readers, data adapters, datasets and how they are used to work with different data providers like SQL Server, OLE DB, and ODBC. It also covers data binding using data grids and filtering data views.
- There are four main ways to persist data in Android: shared preferences, file systems, external storage, and SQLite databases.
- SQLite is the default database used in Android. It is a lightweight relational database embedded within Android applications.
- The SQLiteOpenHelper class manages database creation, version management, and handles opening connections to the database. It requires a database name to create the database.
- The SQLiteDatabase class contains methods for executing SQL statements like create, insert, update, delete, and query. It is used to perform operations on the SQLite database like inserting, updating, deleting, and retrieving data.
- There are four main ways to persist data in Android: shared preferences, file systems, external storage, and SQLite databases.
- SQLite is the default database used in Android. It is a lightweight relational database embedded within Android applications.
- The SQLiteOpenHelper class manages database creation, version management, and handles opening connections to the database. It requires a database name to create the database.
- The SQLiteDatabase class contains methods for executing SQL statements like insert, update, delete, and query to perform CRUD operations on the database.
This document discusses using Python to interact with SQLite databases. It provides examples of how to connect to an SQLite database, create tables, insert/update/delete records, and query the database. Key points covered include using the sqlite3 module to connect to a database, getting a cursor object to execute SQL statements, and various cursor methods like execute(), executemany(), fetchone(), fetchall(), commit(), and close(). Example code is given for common SQLite operations like creating a table, inserting records, updating records, deleting records, and selecting records.
Lecture 9: Menus and Additional Actions .pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Ninth Lecture with The title of Menus and Additional Actions.
Lecture 8: Android Types of Storage.pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Eighth Lecture with The title of Android Types of Storage.
Ad
More Related Content
Similar to Lecture 10: Android SQLite database.pptx (20)
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...TAISEEREISA
SQLite is an embedded SQL database that is included within Android applications. It allows creating, querying, and modifying a database without a separate server process. Developers can open and query a SQLite database using methods like openDatabase(), rawQuery(), execSQL(), and insert()/update()/delete(). This allows storing and retrieving application data, even when the device is offline.
This document discusses using SQLite databases in Android applications. SQLite is an embedded SQL database that does not require a separate server. It is included in the Android SDK and can be used to create and query database files. The document explains how to open a database, create tables, insert/update/delete rows using SQL queries, and retrieve data using cursors. Raw queries and simple queries can be used to perform retrieval queries on a single table. Transactions are used to commit or roll back changes to the database.
Zybotech solutions, offers job oriented courses on mobile application development for freshers and professionals with placement assistance, interactive training sessions with live project exposure.
This document provides an overview of Android application development training on accessing and manipulating data using SQLite databases on Android. It covers topics like what SQLite is, creating and connecting to databases, setting database properties, creating tables, inserting, updating, and deleting records from the databases using ContentValues and SQLiteDatabase methods. Code examples are provided for each topic.
This document provides instructions for connecting an SQLite database to an Android application using Android Studio. It describes creating a database using SQLite Manager and placing it in the Android project's assets folder. It then explains creating a Connection class with paths to the database folder and file. The document outlines creating a DataDB class to connect to the Connection class and calling getNameDB in the MainActivity to retrieve the database name. It provides code snippets for the Connection and DataDB classes.
SQLite is a lightweight database that can be used to persist data between sessions of an Android app. The SQLiteOpenHelper class manages database creation and upgrading, and provides methods like onCreate() and onUpgrade() to define how the database schema is set up. Queries can be performed on the database using the query() method of the SQLiteDatabase class to retrieve data as a Cursor object.
The document provides an overview of the Java Database Connectivity (JDBC) API. It describes key interfaces like Connection, Statement, and PreparedStatement that are used to connect to a database and execute SQL statements. It also covers ResultSet for accessing query results, and the use of transactions and savepoints for maintaining data integrity. Classes like DriverManager help establish the initial connection to access databases using JDBC.
Asp .Net Database Connectivity Presentation.pptxsridharu1981
This document provides an overview of connecting databases in ASP.NET using ADO.NET. It defines what a database and SQL are, and explains that in ASP.NET there are two main approaches to connecting to databases - ADO.NET and ORM tools like Entity Framework. It then focuses on using ADO.NET, describing how to declare connection strings, establish a connection using SqlConnection, execute commands with SqlCommand, read returned data with SqlDataReader, and close the connection once complete.
The document discusses several JDBC APIs used for connecting Java applications to databases. The Connection interface is used to create a connection to a database and execute SQL statements. The Statement interface executes static SQL queries and retrieves results. The PreparedStatement interface executes dynamic queries with IN parameters by using placeholder values set using methods like setInt() and setString(). Examples of using these interfaces will be provided in subsequent chapters.
This document provides a tutorial on summarizing the Spring Framework. It introduces the main packages in Spring Framework including the JDBC package for data access. The JDBC package has two main subpackages - com.interface21.jdbc.core which implements low-level persistence and com.interface21.jdbc.object which presents an object-oriented view. It provides code samples demonstrating how to perform queries, updates and retrieve results using these packages.
The document discusses how Java applications can connect to and interact with relational databases. It describes the typical structure for Java database access which involves a database driver, connection, and SQL statements. The key classes and interfaces in the java.sql package for working with JDBC are discussed, including DriverManager, Connection, Statement, PreparedStatement, and ResultSet. Examples are provided for how to load drivers, establish connections, execute SQL statements to insert, update, delete and retrieve data, and handle exceptions. Common errors that can occur with database access are also listed.
This document discusses different programming styles (Model A and Model B) for interacting with a database using embedded SQL in a J2ME application. Model A is used when SQL requests don't return a ResultSet, while Model B is used when requests return a ResultSet. Both styles minimize code by containing segments in a try block or DownRow() method. The document also covers SQL statements for creating, modifying and dropping database tables and indexes.
Database Programming: The Design of JDBC, The Structured Query Language, Basic JDBC Programming Concepts,
Result Sets, Metadata, Row Sets, Transactions
The document provides an overview of ADO.NET, which is Microsoft's data access technology for .NET applications to connect to and manipulate data in various data stores. It discusses key ADO.NET concepts like connections, commands, data readers, data adapters, datasets and how they are used to work with different data providers like SQL Server, OLE DB, and ODBC. It also covers data binding using data grids and filtering data views.
- There are four main ways to persist data in Android: shared preferences, file systems, external storage, and SQLite databases.
- SQLite is the default database used in Android. It is a lightweight relational database embedded within Android applications.
- The SQLiteOpenHelper class manages database creation, version management, and handles opening connections to the database. It requires a database name to create the database.
- The SQLiteDatabase class contains methods for executing SQL statements like create, insert, update, delete, and query. It is used to perform operations on the SQLite database like inserting, updating, deleting, and retrieving data.
- There are four main ways to persist data in Android: shared preferences, file systems, external storage, and SQLite databases.
- SQLite is the default database used in Android. It is a lightweight relational database embedded within Android applications.
- The SQLiteOpenHelper class manages database creation, version management, and handles opening connections to the database. It requires a database name to create the database.
- The SQLiteDatabase class contains methods for executing SQL statements like insert, update, delete, and query to perform CRUD operations on the database.
This document discusses using Python to interact with SQLite databases. It provides examples of how to connect to an SQLite database, create tables, insert/update/delete records, and query the database. Key points covered include using the sqlite3 module to connect to a database, getting a cursor object to execute SQL statements, and various cursor methods like execute(), executemany(), fetchone(), fetchall(), commit(), and close(). Example code is given for common SQLite operations like creating a table, inserting records, updating records, deleting records, and selecting records.
Lecture 9: Menus and Additional Actions .pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Ninth Lecture with The title of Menus and Additional Actions.
Lecture 8: Android Types of Storage.pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Eighth Lecture with The title of Android Types of Storage.
Lecture 7: Android Kinds of Dialogs.pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Seventh Lecture with The title of Android Kinds of Dialogs.
Lecture 6: Android Activity Life Cycle.pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Sixth Lecture with The title of Android Activity Life Cycle.
Lecture 5: Android Routing using Intents.pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Fifth Lecture with The title of Android Routing using Intents.
Lecture 4: Android All Kinds of Lists.pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the ForthLecture with The title of Android All Kinds of Lists.
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Third Lecture with The title of Android basic GUI widgets.
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the Second Lecture with The title of Android Layouts.
Lecture 01: Introduction into Android.pptxYousef Alamir
In your seeking to Learn Mobile Application Programming using an Android native Language like Java, These PPTs will be helpful and amazing for You. This is the First Lecture with The title of Introduction to Android.
Who Watches the Watchmen (SciFiDevCon 2025)Allon Mureinik
Tests, especially unit tests, are the developers’ superheroes. They allow us to mess around with our code and keep us safe.
We often trust them with the safety of our codebase, but how do we know that we should? How do we know that this trust is well-deserved?
Enter mutation testing – by intentionally injecting harmful mutations into our code and seeing if they are caught by the tests, we can evaluate the quality of the safety net they provide. By watching the watchmen, we can make sure our tests really protect us, and we aren’t just green-washing our IDEs to a false sense of security.
Talk from SciFiDevCon 2025
https://www.scifidevcon.com/courses/2025-scifidevcon/contents/680efa43ae4f5
Best Practices for Collaborating with 3D Artists in Mobile Game DevelopmentJuego Studios
Discover effective strategies for working with 3D artists on mobile game projects. Learn how top mobile game development companies streamline collaboration with 3D artists in Dubai for high-quality, optimized game assets.
Societal challenges of AI: biases, multilinguism and sustainabilityJordi Cabot
Towards a fairer, inclusive and sustainable AI that works for everybody.
Reviewing the state of the art on these challenges and what we're doing at LIST to test current LLMs and help you select the one that works best for you
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Andre Hora
Exceptions allow developers to handle error cases expected to occur infrequently. Ideally, good test suites should test both normal and exceptional behaviors to catch more bugs and avoid regressions. While current research analyzes exceptions that propagate to tests, it does not explore other exceptions that do not reach the tests. In this paper, we provide an empirical study to explore how frequently exceptional behaviors are tested in real-world systems. We consider both exceptions that propagate to tests and the ones that do not reach the tests. For this purpose, we run an instrumented version of test suites, monitor their execution, and collect information about the exceptions raised at runtime. We analyze the test suites of 25 Python systems, covering 5,372 executed methods, 17.9M calls, and 1.4M raised exceptions. We find that 21.4% of the executed methods do raise exceptions at runtime. In methods that raise exceptions, on the median, 1 in 10 calls exercise exceptional behaviors. Close to 80% of the methods that raise exceptions do so infrequently, but about 20% raise exceptions more frequently. Finally, we provide implications for researchers and practitioners. We suggest developing novel tools to support exercising exceptional behaviors and refactoring expensive try/except blocks. We also call attention to the fact that exception-raising behaviors are not necessarily “abnormal” or rare.
Download YouTube By Click 2025 Free Full Activatedsaniamalik72555
Copy & Past Link 👉👉
https://dr-up-community.info/
"YouTube by Click" likely refers to the ByClick Downloader software, a video downloading and conversion tool, specifically designed to download content from YouTube and other video platforms. It allows users to download YouTube videos for offline viewing and to convert them to different formats.
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AIdanshalev
If we were building a GenAI stack today, we'd start with one question: Can your retrieval system handle multi-hop logic?
Trick question, b/c most can’t. They treat retrieval as nearest-neighbor search.
Today, we discussed scaling #GraphRAG at AWS DevOps Day, and the takeaway is clear: VectorRAG is naive, lacks domain awareness, and can’t handle full dataset retrieval.
GraphRAG builds a knowledge graph from source documents, allowing for a deeper understanding of the data + higher accuracy.
Landscape of Requirements Engineering for/by AI through Literature ReviewHironori Washizaki
Hironori Washizaki, "Landscape of Requirements Engineering for/by AI through Literature Review," RAISE 2025: Workshop on Requirements engineering for AI-powered SoftwarE, 2025.
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdfImma Valls Bernaus
eady to harness the power of Grafana for your HackUPC project? This session provides a rapid introduction to the core concepts you need to get started. We'll cover Grafana fundamentals and guide you through the initial steps of building both compelling dashboards and your very first Grafana app. Equip yourself with the essential tools to visualize your data and bring your innovative ideas to life!
Apple Logic Pro X Crack FRESH Version 2025fs4635986
🌍📱👉COPY LINK & PASTE ON GOOGLE http://drfiles.net/ 👈🌍
Logic Pro X is a professional digital audio workstation (DAW) software for macOS, developed by Apple. It's a comprehensive tool for music creation, offering features for songwriting, beat making, editing, and mixing. Logic Pro X provides a wide range of instruments, effects, loops, and samples, enabling users to create a variety of musical styles.
Here's a more detailed breakdown:
Digital Audio Workstation (DAW):
Logic Pro X allows users to record, edit, and mix audio and MIDI tracks, making it a central hub for music production.
MIDI Sequencing:
It supports MIDI sequencing, enabling users to record and manipulate MIDI performances, including manipulating parameters like note velocity, timing, and dynamics.
Software Instruments:
Logic Pro X comes with a vast collection of software instruments, including synthesizers, samplers, and virtual instruments, allowing users to create a wide variety of sounds.
Audio Effects:
It offers a wide range of audio effects, such as reverbs, delays, EQs, compressors, and distortion, enabling users to shape and polish their mixes.
Recording Facilities:
Logic Pro X provides various recording facilities, allowing users to record vocals, instruments, and other audio sources.
Mixing and Mastering:
It offers tools for mixing and mastering, allowing users to refine their mixes and prepare them for release.
Integration with Apple Ecosystem:
Logic Pro X integrates well with other Apple products, such as GarageBand, allowing for seamless project transfer and collaboration.
Logic Remote:
It supports remote control via iPad or iPhone, enabling users to manipulate instruments and control mixing functions from another device.
Get & Download Wondershare Filmora Crack Latest [2025]saniaaftab72555
Copy & Past Link 👉👉
https://dr-up-community.info/
Wondershare Filmora is a video editing software and app designed for both beginners and experienced users. It's known for its user-friendly interface, drag-and-drop functionality, and a wide range of tools and features for creating and editing videos. Filmora is available on Windows, macOS, iOS (iPhone/iPad), and Android platforms.
Discover why Wi-Fi 7 is set to transform wireless networking and how Router Architects is leading the way with next-gen router designs built for speed, reliability, and innovation.
PDF Reader Pro Crack Latest Version FREE Download 2025mu394968
🌍📱👉COPY LINK & PASTE ON GOOGLE https://dr-kain-geera.info/👈🌍
PDF Reader Pro is a software application, often referred to as an AI-powered PDF editor and converter, designed for viewing, editing, annotating, and managing PDF files. It supports various PDF functionalities like merging, splitting, converting, and protecting PDFs. Additionally, it can handle tasks such as creating fillable forms, adding digital signatures, and performing optical character recognition (OCR).
How can one start with crypto wallet development.pptxlaravinson24
This presentation is a beginner-friendly guide to developing a crypto wallet from scratch. It covers essential concepts such as wallet types, blockchain integration, key management, and security best practices. Ideal for developers and tech enthusiasts looking to enter the world of Web3 and decentralized finance.
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Eric D. Schabell
It's time you stopped letting your telemetry data pressure your budgets and get in the way of solving issues with agility! No more I say! Take back control of your telemetry data as we guide you through the open source project Fluent Bit. Learn how to manage your telemetry data from source to destination using the pipeline phases covering collection, parsing, aggregation, transformation, and forwarding from any source to any destination. Buckle up for a fun ride as you learn by exploring how telemetry pipelines work, how to set up your first pipeline, and exploring several common use cases that Fluent Bit helps solve. All this backed by a self-paced, hands-on workshop that attendees can pursue at home after this session (https://o11y-workshops.gitlab.io/workshop-fluentbit).
Creating Automated Tests with AI - Cory House - Applitools.pdfApplitools
In this fast-paced, example-driven session, Cory House shows how today’s AI tools make it easier than ever to create comprehensive automated tests. Full recording at https://applitools.info/5wv
See practical workflows using GitHub Copilot, ChatGPT, and Applitools Autonomous to generate and iterate on tests—even without a formal requirements doc.
2. SQLite is an open-source SQL database that stores data in a text file on a
device. Android comes in with built-in SQLite database implementation.
SQLite supports all the relational database features. In order to access
this database, you don’t need to establish any kind of connections for it
like JDBC, ODBC …etc.
Android - SQLite Database
3. Database – Package:
The main package is android.database.sqlite which contains the
classes to manage your own databases
Database – Creation:
In order to create a database you just need to call this method
openOrCreateDatabase with your database name and mode as a
parameter. It returns an instance of SQLite database which you
have to receive in your own object.Its syntax is given below
SQLite Database creation
SQLiteDatabase db = openOrCreateDatabase("database
name“ ,MODE_PRIVATE, null);
4. SQLiteDatabase Methods
Method name Description
1 openDatabase(String path,
SQLiteDatabase.CursorFactory
factory, int flags,
DatabaseErrorHandler
errorHandler)
This method only opens the existing database
with the appropriate flag mode. The common
flags mode could be OPEN_READWRITE
OPEN_READONLY
2 openDatabase(String path,
SQLiteDatabase.CursorFactory
factory, int flags)
It is similar to the above method as it also
opens the existing database but it does not
define any handler to handle the errors of
databases.
3 openOrCreateDatabase(String
path,
SQLiteDatabase.CursorFactory
factory)
It not only opens but creates the database if it
does not exist. This method is equivalent to the
openDatabase method.
4 openOrCreateDatabase(File file,
SQLiteDatabase.CursorFactory
This method is similar to the above method but
it takes the File object as a path rather than a
5. we can create a table or insert data into a table using execSQL method defined in
SQLiteDatabase class. Its syntax is given below:
Create users table:
db.execSQL(“
CREATE TABLE IF NOT EXISTS users(
Username VARCHAR,
Password VARCHAR
);“
);
Insert into users table:
db.execSQL("INSERT INTO users VALUES('admin','admin');");
This will insert some values into our table in our database. Another method that
also does the same job but take some additional parameter is given below
execSQL(String sql, Object[] bindArgs)
This method not only inserts data but is also used to update or modify already
existing data in the database using bind arguments
Database - Insertion
6. We can retrieve anything from the database using an object of the Cursor class. We will call a
method of this class called rawQuery and it will return a resultset with the cursor pointing to the
table. We can move the cursor forward and retrieve the data.
Retrieve data from users table:
Cursor resultSet = db.rawQuery("Select * from users",null);
resultSet.moveToFirst();
String username = resultSet.getString(0);
String password = resultSet.getString(1);
There are other functions available in the Cursor class that allows us to effectively retrieve the data.
That includes:
The the
Database - Fetching
Metod Description
1 getColumnCount() return the total number of columns of the table.
2 getColumnIndex(String
columnName)
returns the index number of a column by specifying the
name of the column
3 getColumnName(int
columnIndex)
returns the name of the column by specifying the index of
the column
4 getColumnNames() returns the array of all the column names of the table
5 getCount() returns the total number of rows in the cursor
6 getPosition() returns the current position of the cursor in the table
7. For managing all the operations related to the database, a helper
class has been given and is called SQLiteOpenHelper. It
automatically manages the creation and update of the database.
Its syntax is given below:
public class DBHelper extends SQLiteOpenHelper {
public DBHelper(){
super(context,DATABASE_NAME,null,1);
}
public void onCreate(SQLiteDatabase db) {}
public void onUpgrade(SQLiteDatabase database, int
oldVersion, int newVersion) {}
}
Database - Helper class
8. Thank You
T. Yousef Alamir 2023
http://Yousef.omairtech.com