Hey there.
So we implement our goal up Olympus contract class and create it inside a static final class member
entry in which we formed the structure of our members table and now we can implement the database as
we did before.
In the application costs the B this application I have opened this project so we can create a glass
database handler which inherits expense from X girl and open helper and folder implement all methods
and graph methods in the same way.
But this is not where a good approach.
Why.
First because that we can enter and correct in valid value into our database.
For example when adding a new object that new car in the database we can specify some other value by
mistake instead of the price we can specify the name for example.
Or we can accidentally create the minus and specify a negative value.
In general we can enter any incorrect value and the database will contain this incorrect value.
And we can't add any verification or the correctness or the value of the end to the matter and to do
this we better use another class that is used to for with that a basis in Android.
This is the content provider class a content provider.
It's like an abstract layer between your code and a database.
That is when working with content provider.
We do not put directly into the database that data like here in our case we use a content provider for
this.
We put the data in the content provider and then in the content provider we can do data verification
validation checking.
And if the data is valid then the content provider itself puts the data into the database.
This is one of the benefits of using these apps or player in our database.
Also content providers can be used to store data not only in databases but you can also serve data in
the form of files.
For example if we want to save all our data about costs in this case not in the database but in text
file we can easily change the code on the content provider and we will not need to change the whole
code later in the entire application.
That is we are interacting with a content provider and it already implements some kind of functionality
inside it's interacting with one or another database storage or it with file system.
This is also very convenient.
Also with the help of content providers we can easily update our interface user interface.
For example if we store data about our cars in this case in the form of a leased view or a cyclone view
and when adding some new record to the database we need to constantly update this interface.
We need to take care of these make a request to the database that is it is difficult when the user content
provider it implements the functionality itself.
That is what adding or removing entries from the database it updates the user interface itself.
This is also way too convenient.
And another advantage of content providers is that we kind of share data from our database with other
applications.
Now in this form our database is closed to all other applications.
We can use these database only in the cost VB application.
But if a situation arises for example we will create some other application online store for example
for a car or an application for a repair car repair.
And we need to share data from the same database.
Now we can't do it but using content providers there is a way to open the database of your application
to another applications.
And therefore in this application in our new application the club Olympus we will interact with our
database with the help of content provider.