Razgriz
Razgriz

Reputation: 7343

Android - Uploading sqlite data and photos to a server

Hello I have several questions in mind.

I have an application that stores log data of the user as he or she logs in or out. After logging in or out, the user is prompted to take a photo and it is stored in a custom folder with a custom file name. Data regarding the time stamp, file name, room, file path, etc are stored in an SQLite database. I know it's stored properly because I'm able to view the results in a ListView properly.

The second step is uploading the said database to an online server (something like CPanel I guess) along with the photos. Here I got the impression that I need to export the SQLite database and upload it. The same goes for the photos in the said folder.

So here are my questions:

  1. What is the best way of exporting an SQLite database keeping in mind that it will be uploaded to an online server? I know it is possible to export the SQLite as CSV, but is it possible to export the SQLite database as queries?
  2. Is it possible to upload photos from a folder on the smartphone to another folder in the server?
  3. Will I need to do some back end php scripting in order to to screw up the way the database and photos are uploaded into the server?

Thanks.

Upvotes: 1

Views: 651

Answers (1)

Ragunath Jawahar
Ragunath Jawahar

Reputation: 19723

What is the best way of exporting an SQLite database keeping in mind that it will be uploaded to an online server?

Upload the data, not the database itself to your web server. This can be accomplished using a RESTful web service.

I know it is possible to export the SQLite as CSV, but is it possible to export the SQLite database as queries?

Yes this is possible but you have to generate your own SQL queries since the SQLite dialect is different from the MySQL dialect.

Is it possible to upload photos from a folder on the smartphone to another folder in the server?

Yes it is possible. Use a Web service / FTP Server / HTTP File Server

Will I need to do some back end php scripting in order to to screw up the way the database and photos are uploaded into the server?

Yes, you will need a web service to do the tasks for you.

Upvotes: 2

Related Questions