Difference between revisions of "Teams Winter 2011/team1/BlackBerry/Use SQLite"

From CDOT Wiki
Jump to: navigation, search
(11.1 Add SDCard to Simulator)
(11.1 Add SDCard to Simulator)
Line 4: Line 4:
 
To be able to have data preserved on database, first we need to make sure that simulator can simulate SDCard, so that we can run our application with database. For this purpose first create a folder on your file system. Then run the simulator and from the top menu choose: Simulate > Change SD Card... .<br/>
 
To be able to have data preserved on database, first we need to make sure that simulator can simulate SDCard, so that we can run our application with database. For this purpose first create a folder on your file system. Then run the simulator and from the top menu choose: Simulate > Change SD Card... .<br/>
 
Then Mount Directory, and select the folder you just created. Every time you restart the simulator, before running the app you need to make sure that the folder is mounted as SD Card. later on you will see that the database file gets created there.<br/>
 
Then Mount Directory, and select the folder you just created. Every time you restart the simulator, before running the app you need to make sure that the folder is mounted as SD Card. later on you will see that the database file gets created there.<br/>
[[Image: BB_SDCard.png | 300px]]<br/>
+
[[Image: BB_SDCard.png | 350px]]<br/>
  
 
===11.2 Create Database File===
 
===11.2 Create Database File===

Revision as of 21:21, 11 April 2011

11. Use Database and SQLite to Store Data

11.1 Add SDCard to Simulator

To be able to have data preserved on database, first we need to make sure that simulator can simulate SDCard, so that we can run our application with database. For this purpose first create a folder on your file system. Then run the simulator and from the top menu choose: Simulate > Change SD Card... .
Then Mount Directory, and select the folder you just created. Every time you restart the simulator, before running the app you need to make sure that the folder is mounted as SD Card. later on you will see that the database file gets created there.
BB SDCard.png

11.2 Create Database File

11.3 Add id to Student Class

11.4 Check for presence of SDCard

11.5 Copy Database File into SDCard

11.6 Create SQLiteManager Class

11.6.1 Open Database
11.6.2 Close Database
11.6.3 Select All Students
11.6.4 Insert New Student
11.6.5 Delete Student
11.6.6 Update Student

11.7 Modify StudentsList Class to use SQLiteManager

11.7.1 Load list
11.7.2 Add Student
11.7.3 Edit Student
11.7.4 Delete Student

11.8 Student View Application in Action