Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

As you are probably aware, when browsing the web-based PlayStore, it is actually possible to install an app right-away. Upon pressing the "Install" button (like the one in the image - taken from the app page), I immediately receive a notification on my phone telling me that the app is being downloaded.

Sample app

I would be very interested to know how Google implemented this feature. I suppose being logged to my Google account on both the PC and the phone helps, but still - is the phone continuously polling some network resource to see whether it should start downloading an app? Or is the notification somehow pushed to the phone (I cannot imagine how this would be done)?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The Play Store on the handset is running as a service in the background and by clicking on the 'Install' from the web front-end on desktop PC browser, this triggers a push notification (Am guessing its GCM - Google Cloud Messaging) which is broadcast across the network only to designated Google accounts which you happen to be signed in.

When the Play store service receives the broadcast, that triggers it to pull it down.

As for asking how is this implemented is beyond the scope as that is bordering on asking in the direction of development efforts.

Only Google is allowed to do that and is part of the terms and conditions of Play store usage.

That I would also think is how Google can send a kill switch to designated handsets (it happened before, on pre-release of ICS on Galaxy Nexus, which happened to get leaked by accident on Google employee's handset, by one of the US Carriers, and the kill was issued which wiped the ROM, after it was posted on reddit - IIRC)

Edit: I am speculating on how the play store does it, and is proprietary...

share|improve this answer
    
To add a detail concerning the "continuously polling", try the following: Set your WiFi Standby policy to have WiFi "sleep while the phone sleeps", and do not connect via the mobile network. Then trigger an app-install to that device. You will notice the delay: As soon as you "wake up" the device by switching on the screen, and the WiFi connection being re-established, the installation starts. Also when permanently connected, I sometimes experienced this "lag". So I assume a "periodical poll for broadcasts" being part of the game. –  Izzy Mar 10 '13 at 22:00
    
That's correct @Izzy :) –  t0mm13b Mar 10 '13 at 22:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.