SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
Software Engineering Large Practical

Working with databases in Android

                  Stephen Gilmore

     School of Informatics, University of Edinburgh


               October 17th, 2012




             Stephen Gilmore   Software Engineering Large Practical
A database example




   In this lecture we will look at an example Android application
   which creates a database of TODO notes, with reminders of things
   which need to be done, and descriptions of these.

   The application is due to Lars Vogel (http://www.vogella.com).




                        Stephen Gilmore   Software Engineering Large Practical
Lars Vogel example: TODOs




                 Stephen Gilmore   Software Engineering Large Practical
A database example




                     Stephen Gilmore   Software Engineering Large Practical
TodoDatabaseAdapter




                 Stephen Gilmore   Software Engineering Large Practical
TodoDatabaseHelper (onCreate())




                 Stephen Gilmore   Software Engineering Large Practical
TodoDatabaseHelper (onUpgrade())




                 Stephen Gilmore   Software Engineering Large Practical
TodoDatabaseAdapter (open(), close())




                 Stephen Gilmore   Software Engineering Large Practical
The create, update, and delete methods




                   Stephen Gilmore   Software Engineering Large Practical
The insert() method




                Stephen Gilmore   Software Engineering Large Practical
The update() method




                Stephen Gilmore   Software Engineering Large Practical
The delete() method




                Stephen Gilmore   Software Engineering Large Practical
Fetch data




             Stephen Gilmore   Software Engineering Large Practical
Create content values




                   Stephen Gilmore   Software Engineering Large Practical
Resources




            Stephen Gilmore   Software Engineering Large Practical
Running the application




   When we run the application we are able to create a TODO note,
   and set its category to Urgent or Reminder.




                       Stephen Gilmore   Software Engineering Large Practical
Running the TODOs application




                  Stephen Gilmore   Software Engineering Large Practical
Editing a TODO item




                 Stephen Gilmore   Software Engineering Large Practical
Setting category to “Urgent”




                   Stephen Gilmore   Software Engineering Large Practical
TODOs application code




  We look at the application code to see how the Java code interacts
  with the XML layout and see how the database state is managed.




                       Stephen Gilmore   Software Engineering Large Practical
TodoDetails (imports)




.14.20.png




                      Stephen Gilmore   Software Engineering Large Practical
TodoDetails (onCreate)




.14.31.png




                      Stephen Gilmore   Software Engineering Large Practical
Graphical layout of todo edit.xml




.32.52.png


                     Stephen Gilmore   Software Engineering Large Practical
Text of todo edit.xml




.32.48.png


                    Stephen Gilmore   Software Engineering Large Practical
Outline of todo edit.xml




.32.48.png


                     Stephen Gilmore   Software Engineering Large Practical
TodoDetails (populateFields)




.14.38.png




                      Stephen Gilmore   Software Engineering Large Practical
Save state, onPause, onResume




.14.48.png




                     Stephen Gilmore   Software Engineering Large Practical
Save state




.14.56.png




                Stephen Gilmore   Software Engineering Large Practical
TodosOverview (onCreate)




.15.04.png




                     Stephen Gilmore   Software Engineering Large Practical
Options menu, item selected




.15.10.png




                      Stephen Gilmore   Software Engineering Large Practical
Options item selected




.15.22.png




                       Stephen Gilmore   Software Engineering Large Practical
Accessing the insert menu




.16.16.png

                      Stephen Gilmore   Software Engineering Large Practical
Inspecting the database




   During development we might have bugs in our code which cause
   problems with the database. In this case we would like to be able
   to see the content of the database and check that it is as we
   expect. We can use the Dalvik Debug Monitor Server (DDMS) to
   do this and we can also inspect the database using other tools for
   processing SQLlite databases.




                         Stephen Gilmore   Software Engineering Large Practical
Dalvik Debug Monitor Server (DDMS)




.21.38.png




                     Stephen Gilmore   Software Engineering Large Practical
File explorer in DDMS




                   Stephen Gilmore   Software Engineering Large Practical
/data/data/de.vogella.android.todos/...




                    Stephen Gilmore   Software Engineering Large Practical
Pulling a file from the device




                    Stephen Gilmore   Software Engineering Large Practical
Pulling a file from the device




                    Stephen Gilmore   Software Engineering Large Practical
Get the device file




                     Stephen Gilmore   Software Engineering Large Practical
Inspecting the file with sqlite3




                   Stephen Gilmore   Software Engineering Large Practical
Inspecting the file with sqlite3 on DiCE




                   Stephen Gilmore   Software Engineering Large Practical
Other tools for inspecting the database

   Numerous browsers exist for SQLite databases.
       The CellObject SQLite & XML Browser is an Eclipse
       plug-in tool built on top of Dalvik Debug Monitor Server
       (DDMS), intended for Android application developers. It is
       available from http://cellobject.net/
       SQLite Manager is an add-on for Firefox which allows users
       to browse SQLite databases using the Firefox browser. It is
       available from https://addons.mozilla.org/en-US/
       firefox/addon/sqlite-manager/
       SQLite Database Browser allows users to create, design and
       edit database files compatible with SQLite using a familiar
       spreadsheet-like interface. It is available from
       http://sqlitebrowser.sourceforge.net/


                        Stephen Gilmore   Software Engineering Large Practical
Using LogCat




  As usual, the effect of Java exceptions and other problems will
  appear in the LogCat view.




                       Stephen Gilmore   Software Engineering Large Practical
Debugs and errors displayed in LogCat




.22.45.png




                      Stephen Gilmore   Software Engineering Large Practical
Can filter messages displayed in LogCat




.34.51.png




                      Stephen Gilmore   Software Engineering Large Practical
Can use view menu to export messages




.40.30.png




                     Stephen Gilmore   Software Engineering Large Practical

Mais conteúdo relacionado

Destaque

Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android ApplicationsSteelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android ApplicationsTom Keetch
 
Toll app - Android project
Toll app - Android projectToll app - Android project
Toll app - Android projectArun prasath
 
UseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESSUseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESSPutcha Narasimham
 
Activity diagram railway reservation system
Activity diagram railway reservation systemActivity diagram railway reservation system
Activity diagram railway reservation systemmuthumeenakshim
 
Payroll and attendance system
Payroll and attendance system Payroll and attendance system
Payroll and attendance system Moses Nkrumah
 
Usecase diagram railway reservation system
Usecase diagram railway reservation systemUsecase diagram railway reservation system
Usecase diagram railway reservation systemmuthumeenakshim
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentationconnectshilpa
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering pptshruths2890
 

Destaque (9)

Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android ApplicationsSteelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
 
Toll app - Android project
Toll app - Android projectToll app - Android project
Toll app - Android project
 
UseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESSUseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESS
 
Activity diagram railway reservation system
Activity diagram railway reservation systemActivity diagram railway reservation system
Activity diagram railway reservation system
 
Payroll and attendance system
Payroll and attendance system Payroll and attendance system
Payroll and attendance system
 
Usecase diagram railway reservation system
Usecase diagram railway reservation systemUsecase diagram railway reservation system
Usecase diagram railway reservation system
 
Ziilion E245 final presentation
Ziilion E245 final presentationZiilion E245 final presentation
Ziilion E245 final presentation
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentation
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering ppt
 

Semelhante a Working with databases in Android

Feedback on Part 1 of the Software Engineering Large Practical
Feedback on Part 1 of the Software Engineering Large PracticalFeedback on Part 1 of the Software Engineering Large Practical
Feedback on Part 1 of the Software Engineering Large PracticalStephen Gilmore
 
James Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docx
James Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docxJames Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docx
James Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docxpriestmanmable
 
Extending uBuild and uDeploy with Plugins
Extending uBuild and uDeploy with PluginsExtending uBuild and uDeploy with Plugins
Extending uBuild and uDeploy with PluginsIBM UrbanCode Products
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGerger
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGerger
 
Easy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & MercurialEasy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & MercurialWidoyo PH
 
Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Darwin Biler
 
Common Java problems when developing with Android
Common Java problems when developing with AndroidCommon Java problems when developing with Android
Common Java problems when developing with AndroidStephen Gilmore
 
Software Project Management
Software Project ManagementSoftware Project Management
Software Project ManagementWidoyo PH
 
Getting started with Django 1.8
Getting started with Django 1.8Getting started with Django 1.8
Getting started with Django 1.8rajkumar2011
 
What's new in android 2018 (dev fest)
What's new in android 2018 (dev fest)What's new in android 2018 (dev fest)
What's new in android 2018 (dev fest)Shady Selim
 
Android presentation
Android presentationAndroid presentation
Android presentationImam Raza
 
Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.UA Mobile
 

Semelhante a Working with databases in Android (20)

Feedback on Part 1 of the Software Engineering Large Practical
Feedback on Part 1 of the Software Engineering Large PracticalFeedback on Part 1 of the Software Engineering Large Practical
Feedback on Part 1 of the Software Engineering Large Practical
 
Ab initio training Ab-initio Architecture
Ab initio training Ab-initio ArchitectureAb initio training Ab-initio Architecture
Ab initio training Ab-initio Architecture
 
James Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docx
James Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docxJames Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docx
James Williams_IT110_IP1.doc.docxIT110-1404A-02 Introduction.docx
 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
 
Extending uBuild and uDeploy with Plugins
Extending uBuild and uDeploy with PluginsExtending uBuild and uDeploy with Plugins
Extending uBuild and uDeploy with Plugins
 
Django by rj
Django by rjDjango by rj
Django by rj
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQL
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQL
 
Dost.jar and fo.jar
Dost.jar and fo.jarDost.jar and fo.jar
Dost.jar and fo.jar
 
Container Security Scanning by Timo Pagel
Container Security Scanning by Timo PagelContainer Security Scanning by Timo Pagel
Container Security Scanning by Timo Pagel
 
Container Security Scanning by Timo Pagel
Container Security Scanning by Timo PagelContainer Security Scanning by Timo Pagel
Container Security Scanning by Timo Pagel
 
Easy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & MercurialEasy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & Mercurial
 
Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4
 
Common Java problems when developing with Android
Common Java problems when developing with AndroidCommon Java problems when developing with Android
Common Java problems when developing with Android
 
Industrial IoT bootcamp
Industrial IoT bootcampIndustrial IoT bootcamp
Industrial IoT bootcamp
 
Software Project Management
Software Project ManagementSoftware Project Management
Software Project Management
 
Getting started with Django 1.8
Getting started with Django 1.8Getting started with Django 1.8
Getting started with Django 1.8
 
What's new in android 2018 (dev fest)
What's new in android 2018 (dev fest)What's new in android 2018 (dev fest)
What's new in android 2018 (dev fest)
 
Android presentation
Android presentationAndroid presentation
Android presentation
 
Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.
 

Mais de Stephen Gilmore

Feedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLPFeedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLPStephen Gilmore
 
More Stochastic Simulation Examples
More Stochastic Simulation ExamplesMore Stochastic Simulation Examples
More Stochastic Simulation ExamplesStephen Gilmore
 
Quick quiz on Objective-C
Quick quiz on Objective-CQuick quiz on Objective-C
Quick quiz on Objective-CStephen Gilmore
 
Getting started with Xcode
Getting started with XcodeGetting started with Xcode
Getting started with XcodeStephen Gilmore
 
Crash Course in Objective-C
Crash Course in Objective-CCrash Course in Objective-C
Crash Course in Objective-CStephen Gilmore
 
The Stochastic Simulation Algorithm
The Stochastic Simulation AlgorithmThe Stochastic Simulation Algorithm
The Stochastic Simulation AlgorithmStephen Gilmore
 
Computer Science Large Practical coursework
Computer Science Large Practical courseworkComputer Science Large Practical coursework
Computer Science Large Practical courseworkStephen Gilmore
 
Software Engineering Large Practical coursework
Software Engineering Large Practical courseworkSoftware Engineering Large Practical coursework
Software Engineering Large Practical courseworkStephen Gilmore
 
Introduction to the CSLP and the SELP
Introduction to the CSLP and the SELPIntroduction to the CSLP and the SELP
Introduction to the CSLP and the SELPStephen Gilmore
 
Fixing errors in Android Java applications
Fixing errors in Android Java applicationsFixing errors in Android Java applications
Fixing errors in Android Java applicationsStephen Gilmore
 
Feedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual PracticalFeedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual PracticalStephen Gilmore
 
Creating and working with databases in Android
Creating and working with databases in AndroidCreating and working with databases in Android
Creating and working with databases in AndroidStephen Gilmore
 
Continuing Android development
Continuing Android developmentContinuing Android development
Continuing Android developmentStephen Gilmore
 
Project management for the individual practical
Project management for the individual practicalProject management for the individual practical
Project management for the individual practicalStephen Gilmore
 
Beginning Android development
Beginning Android developmentBeginning Android development
Beginning Android developmentStephen Gilmore
 
CS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVDCS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVDStephen Gilmore
 

Mais de Stephen Gilmore (16)

Feedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLPFeedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLP
 
More Stochastic Simulation Examples
More Stochastic Simulation ExamplesMore Stochastic Simulation Examples
More Stochastic Simulation Examples
 
Quick quiz on Objective-C
Quick quiz on Objective-CQuick quiz on Objective-C
Quick quiz on Objective-C
 
Getting started with Xcode
Getting started with XcodeGetting started with Xcode
Getting started with Xcode
 
Crash Course in Objective-C
Crash Course in Objective-CCrash Course in Objective-C
Crash Course in Objective-C
 
The Stochastic Simulation Algorithm
The Stochastic Simulation AlgorithmThe Stochastic Simulation Algorithm
The Stochastic Simulation Algorithm
 
Computer Science Large Practical coursework
Computer Science Large Practical courseworkComputer Science Large Practical coursework
Computer Science Large Practical coursework
 
Software Engineering Large Practical coursework
Software Engineering Large Practical courseworkSoftware Engineering Large Practical coursework
Software Engineering Large Practical coursework
 
Introduction to the CSLP and the SELP
Introduction to the CSLP and the SELPIntroduction to the CSLP and the SELP
Introduction to the CSLP and the SELP
 
Fixing errors in Android Java applications
Fixing errors in Android Java applicationsFixing errors in Android Java applications
Fixing errors in Android Java applications
 
Feedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual PracticalFeedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual Practical
 
Creating and working with databases in Android
Creating and working with databases in AndroidCreating and working with databases in Android
Creating and working with databases in Android
 
Continuing Android development
Continuing Android developmentContinuing Android development
Continuing Android development
 
Project management for the individual practical
Project management for the individual practicalProject management for the individual practical
Project management for the individual practical
 
Beginning Android development
Beginning Android developmentBeginning Android development
Beginning Android development
 
CS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVDCS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVD
 

Último

Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 

Último (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 

Working with databases in Android

  • 1. Software Engineering Large Practical Working with databases in Android Stephen Gilmore School of Informatics, University of Edinburgh October 17th, 2012 Stephen Gilmore Software Engineering Large Practical
  • 2. A database example In this lecture we will look at an example Android application which creates a database of TODO notes, with reminders of things which need to be done, and descriptions of these. The application is due to Lars Vogel (http://www.vogella.com). Stephen Gilmore Software Engineering Large Practical
  • 3. Lars Vogel example: TODOs Stephen Gilmore Software Engineering Large Practical
  • 4. A database example Stephen Gilmore Software Engineering Large Practical
  • 5. TodoDatabaseAdapter Stephen Gilmore Software Engineering Large Practical
  • 6. TodoDatabaseHelper (onCreate()) Stephen Gilmore Software Engineering Large Practical
  • 7. TodoDatabaseHelper (onUpgrade()) Stephen Gilmore Software Engineering Large Practical
  • 8. TodoDatabaseAdapter (open(), close()) Stephen Gilmore Software Engineering Large Practical
  • 9. The create, update, and delete methods Stephen Gilmore Software Engineering Large Practical
  • 10. The insert() method Stephen Gilmore Software Engineering Large Practical
  • 11. The update() method Stephen Gilmore Software Engineering Large Practical
  • 12. The delete() method Stephen Gilmore Software Engineering Large Practical
  • 13. Fetch data Stephen Gilmore Software Engineering Large Practical
  • 14. Create content values Stephen Gilmore Software Engineering Large Practical
  • 15. Resources Stephen Gilmore Software Engineering Large Practical
  • 16. Running the application When we run the application we are able to create a TODO note, and set its category to Urgent or Reminder. Stephen Gilmore Software Engineering Large Practical
  • 17. Running the TODOs application Stephen Gilmore Software Engineering Large Practical
  • 18. Editing a TODO item Stephen Gilmore Software Engineering Large Practical
  • 19. Setting category to “Urgent” Stephen Gilmore Software Engineering Large Practical
  • 20. TODOs application code We look at the application code to see how the Java code interacts with the XML layout and see how the database state is managed. Stephen Gilmore Software Engineering Large Practical
  • 21. TodoDetails (imports) .14.20.png Stephen Gilmore Software Engineering Large Practical
  • 22. TodoDetails (onCreate) .14.31.png Stephen Gilmore Software Engineering Large Practical
  • 23. Graphical layout of todo edit.xml .32.52.png Stephen Gilmore Software Engineering Large Practical
  • 24. Text of todo edit.xml .32.48.png Stephen Gilmore Software Engineering Large Practical
  • 25. Outline of todo edit.xml .32.48.png Stephen Gilmore Software Engineering Large Practical
  • 26. TodoDetails (populateFields) .14.38.png Stephen Gilmore Software Engineering Large Practical
  • 27. Save state, onPause, onResume .14.48.png Stephen Gilmore Software Engineering Large Practical
  • 28. Save state .14.56.png Stephen Gilmore Software Engineering Large Practical
  • 29. TodosOverview (onCreate) .15.04.png Stephen Gilmore Software Engineering Large Practical
  • 30. Options menu, item selected .15.10.png Stephen Gilmore Software Engineering Large Practical
  • 31. Options item selected .15.22.png Stephen Gilmore Software Engineering Large Practical
  • 32. Accessing the insert menu .16.16.png Stephen Gilmore Software Engineering Large Practical
  • 33. Inspecting the database During development we might have bugs in our code which cause problems with the database. In this case we would like to be able to see the content of the database and check that it is as we expect. We can use the Dalvik Debug Monitor Server (DDMS) to do this and we can also inspect the database using other tools for processing SQLlite databases. Stephen Gilmore Software Engineering Large Practical
  • 34. Dalvik Debug Monitor Server (DDMS) .21.38.png Stephen Gilmore Software Engineering Large Practical
  • 35. File explorer in DDMS Stephen Gilmore Software Engineering Large Practical
  • 36. /data/data/de.vogella.android.todos/... Stephen Gilmore Software Engineering Large Practical
  • 37. Pulling a file from the device Stephen Gilmore Software Engineering Large Practical
  • 38. Pulling a file from the device Stephen Gilmore Software Engineering Large Practical
  • 39. Get the device file Stephen Gilmore Software Engineering Large Practical
  • 40. Inspecting the file with sqlite3 Stephen Gilmore Software Engineering Large Practical
  • 41. Inspecting the file with sqlite3 on DiCE Stephen Gilmore Software Engineering Large Practical
  • 42. Other tools for inspecting the database Numerous browsers exist for SQLite databases. The CellObject SQLite & XML Browser is an Eclipse plug-in tool built on top of Dalvik Debug Monitor Server (DDMS), intended for Android application developers. It is available from http://cellobject.net/ SQLite Manager is an add-on for Firefox which allows users to browse SQLite databases using the Firefox browser. It is available from https://addons.mozilla.org/en-US/ firefox/addon/sqlite-manager/ SQLite Database Browser allows users to create, design and edit database files compatible with SQLite using a familiar spreadsheet-like interface. It is available from http://sqlitebrowser.sourceforge.net/ Stephen Gilmore Software Engineering Large Practical
  • 43. Using LogCat As usual, the effect of Java exceptions and other problems will appear in the LogCat view. Stephen Gilmore Software Engineering Large Practical
  • 44. Debugs and errors displayed in LogCat .22.45.png Stephen Gilmore Software Engineering Large Practical
  • 45. Can filter messages displayed in LogCat .34.51.png Stephen Gilmore Software Engineering Large Practical
  • 46. Can use view menu to export messages .40.30.png Stephen Gilmore Software Engineering Large Practical