Eugenio Anselmino
Eugenio Anselmino

Reputation: 145

"Share" a sqlite table with another smartphone

Maybe I'm going to ask a stupid question, but I can't find anything on the internet about this (explained in a simple way).

Here is the issue: I've got an app, in which the user organize data in SQLite Tables (you create a table so you can insert data in it). I would like to know if it's possible for me to send a table that I have previously created to another smartphone with the same app installed. I've no experience of these kinds of issues, so if anybody knows where to find a simple tutorial or has a hint... I would really appreciate the help.

Upvotes: 0

Views: 44

Answers (1)

royB
royB

Reputation: 12977

There are a couple of ways to achieve it:

Sqlite is stored in a file in the device file system, Usually at: //data/data/<Your-Application-Package-Name>/databases/<your-database-name> So assuming this is your application you can:

  1. read the content of the DB into List of objects (List of rows for each table) and then to send this data over the internet.
  2. Just send the sqlite file to the device and read it's content.

There are a lot of ways to do it. The simplest one is through a server - Upload the data to the server and notify the recipient that he has data to fetch from the server (Using FCM for example)

Upvotes: 1

Related Questions