views:

409

answers:

3

Hi,

I have an application that creates an SQLite database and saves information to it over the course of a day. At the end of the day i want to export this database to a web server.

Could anyone point me in the right direction for this?

Should I use httppost or put. I have researched this myself online but there seems to be so many different ways to explore. The server side does not exist yet either. I have access to an apache server so i am hoping to use that.

Could anyone advise me the best/most simple way to do this?

Thanks

+1  A: 

Couple of ways ...

  • you can ftp up the db each day
  • you can export the data to a csv file and post it to the server; once there you can then import it into the db on the web server

Is it for backup purposes? Or do you require a number of dbs on the web server?

WestDiscGolf
I will require a number of dbs on the server. The idea is that an application running on the server will use the information in the dbs each day. And i will want to keep the dbs from each day. I didnt realise i could use ftp in android. That seems like my solution. Do you know of any resources/solutions i could use to get started?Thanks
Shane
Edit - I said the application would be running on the server. It wont be, the application will be on someones computer and will use the dbs on the server
Shane
I've had a search about and found ftp app for andriod, but I'm yet to find an ftp api to hook into yet ...
WestDiscGolf
A: 

Do you want this to be an automatic or manual transfer? SQLite data is just a file, so (from the SQLite site)... "If SQLite can read the disk file then it can read anything in the database. If the disk file and its directory are writable, then SQLite can change anything in the database. Database files can easily be copied onto a USB memory stick or emailed for sharing." So (provided everything your app needs is set up on the server) just move the file to the server.

Dave Everitt
I want it to be both! I'll want to transfer the db at a certain time every day. But for now, for demonstration purposes i want to be able to send it manually.Thanks, that seems to confirm what westdiscgolf said. If its just a file then shouldnt ftp upload be relatively simple? Any resources would be appreciated!
Shane
If the data isn't sensitive, ftp is fine. If it is, sftp will do. It should be a simple matter to set up a timed script within Android to: check for a connection, then connect and upload the SQLite data file to the server periodically. See AlarmManager: http://www.androidguys.com/2009/04/02/wake-up-with-the-alarm/.
Dave Everitt
...and AndFTP: http://www.lysesoft.com/products/andftp/.
Dave Everitt
A: 

Thanks guys, Just wanted to let you know that i used the intent provided by the andFTP app in the end. Its very simple to use and details can be found at: http://www.lysesoft.com/support/forums/viewtopic.php?f=5&t=158

Shane