Android SQLite Example by Nikos Maravitsas on May 25th, 2013 | Filed in: SQLiteDatabase In this example we are going to see how yo interact with an SQLite database with your Android Application. SQLite is an Open Source Database for structued data in relational databases. It is embeded in Android, to you don’t have to do anything special to set up or administer an SQLite server (e.g like in a Linux box). Android offers a really fast and conviniet API to work with SQLite databases from applications. It uses a wrapper class, SQLiteOpenHelper which offers three basic API methods to interact with the database: onCreate(SQLiteDatabase db), called when the database is created for the first time. onOpen(SQLiteDatabase db), called when the database has been opened. onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion), called when the database needs to be upgraded. to name a few. For this tutorial, we will use the following tools in a Windows 64-bit platform: JDK 1.7 Eclipse 4.2 Juno Android SKD 4.2 1. Create a new Android Project Open Eclipse IDE and go to File -> New -> Project -> Android -> Android Application Project. You have to specify the Application Name, the Project Name and the Package name in the appropriate text fields and then click Next.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Android SQLite Example by Nikos Maravitsas on May 25th, 2013 | Filed in: SQLiteDatabase
In this example we are going to see how yo interact with an SQLite database with your Android
Application. SQLite is an Open Source Database for structued data in relational databases. It is
embeded in Android, to you don’t have to do anything special to set up or administer an SQLite
server (e.g like in a Linux box). Android offers a really fast and conviniet API to work with SQLite
databases from applications. It uses a wrapper class, SQLiteOpenHelper which offers three basic
API methods to interact with the database:
onCreate(SQLiteDatabase db), called when the database is created for the first time.
onOpen(SQLiteDatabase db), called when the database has been opened.
onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion), called when the
database needs to be upgraded.
to name a few.
For this tutorial, we will use the following tools in a Windows 64-bit platform:
JDK 1.7
Eclipse 4.2 Juno
Android SKD 4.2
1. Create a new Android Project
Open Eclipse IDE and go to File -> New -> Project -> Android -> Android Application Project. You
have to specify the Application Name, the Project Name and the Package name in the appropriate