I want to transfer data between a smart phone app and a website. What are the conventional and not-so-conventional ways of doing it?
Here’s what I have thought of so far:
- Simple HTTP GET/POST with data being represented as JSON array string, variations of this being encrypted/compressed string as parameter.
- Webservice calls ( I am not sure if this is even possible, just a guess)
- Two step communication : Smartphone to/fro Desktop App to/fro Website) (Cumbersome to develop/use)
Also, what do I need to consider to avoid spamming/snooping?
If your goals is convince, security and ease of development. I’d have the client (phone) make requests to the server over HTTPS using POST. The data sent should be what ever library is available for your target system. Good choices are URL Encoded parameters, XML and JSON. Avoid Binary protocols.
The downside of this approach is using network connectivity from a device to the web service may not be available or expensive, with the plan the user has. (this is becoming less so with the current wave of smart phones (iPhone/gPhone/Blackberry etc)) This is also a polling interface, so pushing data from the server to the handset is tricky and dependent on the User initiating some action.
Depending on the phone platform, you could also use SMS, for bi-directional communication. The limitation here is privacy, bandwidth and cost. SMS’s are more expensive to send the ip data depending on user plan. (and sometimes to receive) The bi-directional trick is performed by registering a SMS hook in the phone application. Thus the application can be automatically started and notified when a certain SMS is received.
Please post additional information, like target platforms and I can discuss further options.