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.