How does google do it?

Community Forums/General Help/How does google do it?

Matty(Posted 2013) [#1]
We are developing for our smart tv at work and we are stumped as to how Google does this:

When you buy an app on google play/android market on your desktop google is able to download the app directly to your phone or tablet even if that phone or tablet is invisible behind a router.

How do they manage to forward through the router to the phone or tablet?

We need to do the same for communicating with the user through their television and handling interactivity between users and the content providers. (real time).


Derron(Posted 2013) [#2]
Pushing vs Polling.


The app does:
1.) user clicks "buy" -> send request to google-> response is "bought" (and some other data)
2.) on receiving "bought", display "bought" and send request "getDownloadUrl" -> response is "http...."
3.) request "http..."
4.) start install process (and show requested permissions)

So it is not "ahh, user wants to buy app ABC, send the file to him", it is "user wants to buy, ok, let him buy... ohhh user wants to download and has bought already, send download url".


bye
Ron


xlsior(Posted 2013) [#3]
I'd think that the phone itself initiates a connection to the google mothership, and keeps a (very low traffic) data tunnel open.
the mothership can use the same connection to send info to the phone itself.

That's how the exchange 'push' stuff works too, where the server can notify the phone of new email messages as soon as they come in on the server, instead of having the phone check every -x- minutes for new messages.

It's also how programs remote desktop solutions like logmein.com and teamviewer can punch through your firewall: The PC that hosts the program creates an outgoing tunnel to a hosting server in the cloud, and when you connect to the master server you can piggy-back over the existing tunnel, without having to allow incoming connections or open ports on your firewall first.


Matty(Posted 2013) [#4]
Thanks xlsior - I'll forward that on to the guy who handles the apk development.