Can Sqlite work completely offline?

5

I need to save my alarms so that after the device is restarted, they are put back into operation.

The problem is that I get them all through my database at mysql .

What made me think that maybe it would be a good idea to save it to an offline database and then be able to re-schedule it.

Then came two questions:

  • How can Sqlite function fully offline?

  • If yes, if the user clears the cache or the data. What happens to this database?

  • asked by anonymous 26.06.2016 / 20:18

    2 answers

    5
      
  • Sqlite can fully function offline?
  •   

    SQLite is a library in C that implements a built-in SQL database. Programs that use the SQLite library can access the SQL database without running a separate SGBD process.

    SQLite is not a client library used to connect to a large database server, but the server itself . The SQLite library reads and writes directly to and from the database file on disk , ie it works completely offline.

      
  • If yes, if the user clears the cache or the data. What happens to this database?
  •   

    The data saved in the SQLite database is not cleared (deleted) by the memory manager, only procedures or routines that access the data can make this change.

    See also:

    Sqlite-sync is a framework for synchronizing data between a SQLite database and an MS SQL / MySQL database. this frame your application can work completely off-line (Airplane Mode), then perform an automatic bidirectional synchronization when an internet connection becomes available.

    Here has a project with this architecture as an example.

        
    26.06.2016 / 21:08
    5

    You can create the bank (sqlite), put it in the Assets folder of your project and use the offline bank quietly.

    For example, you can use DB Browser link to create and populate .bd, and you can also use this library here link to help you read the bank.

    But why do not you just use an XML or JSON file to save this data? Would not it be less laborious?

        
    26.06.2016 / 20:29