Database of client-side application

Up to this point, you have learned about databases for the server-side. Now we are going to understand databases for the client-side. The Android application will be our client-side application. The demand for Android is now rapidly increasing, and it has also surpassed the PC-based operating systems. Even nowadays, hardware is also more powerful than a PC or laptop. 

The database is the essential part for a smart device, and it is the best way to store and manage the data on a device. This data can be handled in two ways. One way is online based, which means all the data is handled by a server-side or cloud and mobile communicates with them through the network. Without the internet connection, this system is almost useless. The second option is to store all the data in the local database. This means that it can be used offline and is also less dependent on the internet.

There are some criteria for the mobile-based database:

  • Lightweight and fast
  • Secured
  • Independent from an online server
  • Easy to handle using the code
  • Can be shared publicly or privately
  • Low power consumption and low memory

There are lots of mobile databases available on the market but very few databases have met these criteria. SQLiteRealm DB, and ORMLite are few of them. 

We will use the SQLite database throughout this book. However, we are not going to use the raw SQLite. We will instead use a library called room persistence library, which is part of the architecture components. IT provides an abstraction layer over the SQLite. This allows database access that is more robust and helps with much less code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.77.158