Architecture for Phone to Cloud to Tablet
I want to send messages from an Android handset (and possibly from embedded devices) to the Cloud, and then 开发者_运维技巧from the Cloud to an Android app running on a Tablet.
Does anybody have ideas/suggestions for the architecture? Gotchas? Recommendations on what or which cloud services/providers are best? IOW, which Cloud services have both a good API and make it easy/cheap for the end user (MY end user, that is)?
Just replace overhyped word 'Cloud' to 'Server' and you will google tons of answers. I will give you one here: use simple rest over http, once you got this working you can move your app to any cloud you want (depending on the server technology you'll choose of course).
If you want to send messages between two devices all you need to do is have a server to centralize the communication. Server could be anything, but generally a webapp is best. Python, PHP, Ruby, Java. The Android application, on either phone or tablet, would send a message to the server over HTTP. The server would receive the message and store that to some persistence storage (DB, Cassandra, MongoDB, etc). In fact here is an article discussing just that:
http://www.rackspace.com/cloud/blog/2010/05/12/cassandra-by-example/
Then your other Android application would periodically poll for messages from the server by hitting a different URL. On polling the server it would look up in it's topic bucket had it received any messages since the last time it checked. If so the server would reply with the messages it has.
For deployment you can deploy this server to the cloud or regular old web hosting service. By cloud I mean a virtualized hosting server like Amazon EC2, Rackspace, Google App Engine, Slicehost, etc. There are plenty of them. But, you don't have to live in the cloud for this to work. You can just as easily deploy to a traditional web hosting service. Rackspace offers both virtual hosting, and non-virtual hosting with renting models for physical hardware.
精彩评论