0

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 ?

Sagar Zala
  • 4,854
  • 9
  • 34
  • 62
elham shahidi
  • 771
  • 6
  • 11

1 Answers1

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