1
00:00:00,153 --> 00:00:02,903
(cheerful music)

2
00:00:05,370 --> 00:00:07,030
In this section, we're going to look

3
00:00:07,030 --> 00:00:11,200
at how applications can store data in a database.

4
00:00:11,200 --> 00:00:12,600
We're gonna start off with a discussion

5
00:00:12,600 --> 00:00:14,330
of databases in general.

6
00:00:14,330 --> 00:00:15,930
Then we'll have a look at the database

7
00:00:15,930 --> 00:00:18,547
that's included with Android and that's SQLite.

8
00:00:19,720 --> 00:00:23,730
Now, we'll load the SQL Language, often pronounced sequel.

9
00:00:23,730 --> 00:00:26,240
So SQL or Structured Query Language,

10
00:00:26,240 --> 00:00:28,090
was designed for interrogating

11
00:00:28,090 --> 00:00:30,910
and updating relational databases.

12
00:00:30,910 --> 00:00:32,570
Now, it's a fairly simple language,

13
00:00:32,570 --> 00:00:36,610
but it can allow very powerful queries to be created.

14
00:00:36,610 --> 00:00:39,030
Now, when using databases in an app,

15
00:00:39,030 --> 00:00:41,980
there are several approaches that can be used.

16
00:00:41,980 --> 00:00:43,470
Generally though, you'll have to assume

17
00:00:43,470 --> 00:00:46,100
that database access will be quite slow

18
00:00:46,100 --> 00:00:47,990
so Android provides a load of classes

19
00:00:47,990 --> 00:00:49,900
that can be used to prevent your app

20
00:00:49,900 --> 00:00:51,960
from appearing to hang all dialers

21
00:00:51,960 --> 00:00:53,970
fetched from the database.

22
00:00:53,970 --> 00:00:55,520
So I'll also talk about cursors

23
00:00:55,520 --> 00:00:57,400
and the Android content provider

24
00:00:57,400 --> 00:00:59,810
and content resolver classes.

25
00:00:59,810 --> 00:01:02,820
Now we will be creating a very basic app in this section

26
00:01:02,820 --> 00:01:05,069
just to see a couple of ways that we can

27
00:01:05,069 --> 00:01:08,040
access the database in our Android apps,

28
00:01:08,040 --> 00:01:10,190
but later sections will build on this knowledge

29
00:01:10,190 --> 00:01:11,640
and we'll be creating an app that makes

30
00:01:11,640 --> 00:01:14,050
a full use of a database in the next section

31
00:01:14,050 --> 00:01:15,600
after this section of the course.

32
00:01:15,600 --> 00:01:16,913
So let's get started.

