I want to send my sugar orm database to server, I have read send a file in Android from a mobile device to server using http and Location of sqlite database on the device but I don't know how to get the path of my sugar orm db and send it as file, I don't want to send it as json ,just send it as a file. Can anyone tell me how to send my orm database to server and what is the default path of sugar orm ?
Asked
Active
Viewed 151 times
1 Answers
0
Sugar ORM
is based on sqlite
, so the path of sugar database is the same as sqllite
.
For getting database path you can use:
Context context = this; // for Activity, or Service.
String dbname = "mydb.db";
Path dbpath = context.getDatabasePath(dbname);
The path would be something like:
/data/data/com.me.myapp/databases/mydb.db

Hamed
- 5,867
- 4
- 32
- 56
-
is there a way to send just one of the tables?not the whole db – elham shahidi Jul 15 '18 at 10:54
-
No, except you store it in separate database. If you find answer useful accept and up-vote it. – Hamed Jul 15 '18 at 15:16
-
but according to (https://stackoverflow.com/a/47791933/9881118) it seems impossible to make more than one db with sugar,tnx for yr answer – elham shahidi Jul 16 '18 at 06:56