0

I am creating an app that is for my grandmother as she suffers from Alzheimer. I would like to have a feature where I could remotely update the schedules from my mobile to her tablet .Now I am thinking of various possibilities to have the same set of data in both Tablet and Mobile for example:Authenticating the application with caretaker's username and password requires checking data from SQLite table.Now how is it possible to have same set of SQLite data in both mobile and tablet. Any update on SQLite table in tablet should also update the mobile SQLite database. -I don't want any cloud service or third party apis. -One way I think is have a PHP enabled server and have both devices integrated to it. -Is there a way to have the tablet send data directly to mobile through HTTP?(Of course mobile should be connected to Wifi but that is fine!)

Vyshakh Amarnath
  • 636
  • 6
  • 17

1 Answers1

1

As I see it there are two ways you can go.

Server based: You write a server and then post updates to it, the tablets periodically pulls any updates from it, you need to write a web server in language and framework of your choice communicating over JSON or XML with phone and tablet. This has the advantage that the phone can post multiple updates and the tablet can pull whenever it has net available.

Direct: Use (tcp) sockets to send commands from the phone to the tablet over the net. If you know that both will be connected to the internet or the same wifi all the time this will be more efficient, and you don't need to write a server.

dutt
  • 7,909
  • 11
  • 52
  • 85
  • I definitely agree with you on Direct approach but is it really possible to send SQLlite data from tablet to phone through sockets? Do you know any tutorials regarding this ?(Of course I will search in Google but if you know please let me know) – Vyshakh Amarnath Feb 05 '13 at 13:34
  • You don't have to send actual SQL data, you can just send the commands. If you enter the same commands from the same start state you will end up at the same end state. There are probably lots of socket tutorials, google "socket tutorial android" or something along those lines. – dutt Feb 05 '13 at 13:43
  • I am sorry it hasnt been clear to me.I want to remotely schedule my ta blet's schedule information and it should update my local sqlite table as well as remote sqlite table. Now implementing the way you mentioned then you mean to say each time any update is there i better send the sqlcoomand through SOCKETS? – Vyshakh Amarnath Feb 05 '13 at 14:18
  • Wouldn't this require to have a java server socket in one android device and java socket in the other. I would like this to be bi directional. – Vyshakh Amarnath Feb 05 '13 at 15:01
  • why? don't you just want to keep the tablet updated to the phones state? Anyway, you could run a server in the phone as well but that might be draining on the battery, and I'm not sure how IPs are handled for phones either. – dutt Feb 05 '13 at 16:20
  • What I meant was that each time you do "insert blabla into blublu" on your phone you send "do command" to the socket. If you do that via socket or via a server doesn't really matter on this point. – dutt Feb 05 '13 at 16:21
  • For using direct method it can be connected to the internet at all times but it may not be at the same WIFI and both server and client will have dynamic IP,so can sockets automatically fetch the IP and communicate or should we know the IP in advance? – Vyshakh Amarnath Feb 06 '13 at 09:50