Download presentation
Presentation is loading. Please wait.
1
Mobile Applications (Android Programming)
Semester II Dr. Saman Mirza Abdullah
2
Class Objective The objective of this class is:
To explain the concept of database in Android based application. To describe the classes and methods that work with the database package in Android. To describe the SQLite in Android applications. Mobile Application - Ishik
3
SQLite Database Open a new project.
Create a subclass from the SQLiteOpenHelper class. It has the same process of the creating a class. Chose name “DatabaseHelper” Change the extends of the subclass to SQLiteOpenHelper. Add the following: Import the necessary library. Add necessary methods. Mobile Application - Ishik
4
Crating the super subclass
Step 1 Crating the super subclass Step 2 Do extends Mobile Application - Ishik
5
Press OK Mobile Application - Ishik
6
Still there is red line. Mobile Application - Ishik
7
We need to build a default constructor
Mobile Application - Ishik
8
Mobile Application - Ishik
9
Creating Database In general, for any database you should have:
Database name Table name Column name. Student.db (database) Student (Table) ID NAME SURNAME MARKS 1 AAA A1 87 2 BBB B1 88 3 CCC C1 90 4 DDD D1 77 Mobile Application - Ishik
10
Adding Database Variables
Mobile Application - Ishik
11
onCreate() and onUpgrade()
Mobile Application - Ishik
12
Main Activity Code Mobile Application - Ishik
13
Class End Mobile Application - Ishik
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.