push notification


Last Updated:

  1. sonisoe

    sonisoe Member This Topic's Starter

    Joined:
    Jun 11, 2009
    Messages:
    16
    Likes Received:
    0
    push notification is becoming a standard feature for smartphones, is google working on it ? apple's done it - not quiet there yet but close...
     

    Advertisement
  2. justjimjpc

    justjimjpc Premium Member VIP Member

    Joined:
    Nov 3, 2008
    Messages:
    10,543
    Likes Received:
    210
    What push notification are you referring to ? Updates, email, SMS, Voicemail, ?

    Android does them all ... even from mutliple email accounts .. like for me i use both Gmail and yahoo and get new mail notifications ...

    Maybe you are talking about something else .??
     
  3. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    @justjimjpc - Maybe you can clarify for me, how exactly do you set up your phone to do "push" email? I have my Magic set up with my Gmail account, and I also have multiple POP accounts set up in the default email program. I have them set up to check for email on a regular basis (when running in the BG) and if there is email, to get it.

    But from my understanding that is not _techinally_ push email, but pull email. The email app is checking the email server, and if there is an email there, it downloads it. That's no different from using an email app on your PC.

    Wouldn't true push email mean that when someone sends an email to you, the email servers automatically send it out to your phone _without_ your phone checking first to see if there is anything there?

    How do you set up Gmail to do _that_?
     
  4. justjimjpc

    justjimjpc Premium Member VIP Member

    Joined:
    Nov 3, 2008
    Messages:
    10,543
    Likes Received:
    210

    No expert Here !! I think you are right about the difference between PUSH and POP ...

    I use Gmail ... it is a true push email server to the phone ...
    I set up yahoo as a pop email ,,, simply used the app that came on my G1 out of the box ...

    To make yahoo a push then i believe you could forward your yahoo to gmail ... I have not tried this .. but recall reading posts on this site that Gmail can id the yahoo as from yahoo....

    If anyone has more to add ... Please Share !!
     
  5. cwrig

    cwrig Well-Known Member

    Joined:
    Aug 31, 2009
    Messages:
    220
    Likes Received:
    14
    Yea; GMAIL, Goggle contacts, Google calendar are all pushed to the phone and it works well.

    If you setup POP3 to email, I dont think POP3 supports push. It siply downloads at intervals or on demand. I believe (though not certain) if yo use IMAP protocol to access a mail server it allows push (mail stays on the server).

    Ive moved all my mail to Gmail because it just works so well with android.
     
  6. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    @cwrig: Okay, so I sent a test email to my Gmail account at 12:14pm, started the Gmail app on my phone and left it running in the background. And then I waited.

    Nothing yet...

    Checked my Gmail account online at about 12:18pm. The test email appears in my inbox with the time stamp of 12:14pm. I didn't open it, left it unread. Waited.

    Nothing yet...

    Checked settings on my phone. I had Background Sync and Auto Sync turned off, so I tuened them on. Checked Gmail as something that should sync. As soon as I checked it, it started syncing to Gmail.

    No email came through.

    Left it like that and waited.

    And waited.

    It's 12:34pm now, still no email pushed to my Magic.


    So, what gives? Cwrig, can you explain exactly how I should have my phone set up for this to work?

    Also, maybe it's just semantics, but it seems to me that if you have to have "Sync" turned on, that implies that the phone will routinely "Sync" itself with the external server. This suggests to me that it is polling the server on a regular basis to see if there is anything there. Is that correct? If so, that's not Push. Am I missunderstadning "sync" or does it have nothing to do with Push?

    What am i doing wrong?

    UPDATE: I rebooted my phone and waited. No notifications. I opened the Gmail app. It "synced" and downloaded three of the four emails that are showing in my inbox in my web browser. The only email it did not download was the test email.

    I sent _another_ test at 12:48. I can see it in my inbox on the web, but it's now 12:54 and still nothing is being "pushed" to my phone.

    Is this option (push) dependent on your carrier's network? I'm with Rogers in Canada. is it possible push doesn't work with Roger's network?
     
  7. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    The GMail, Google Calendar and Contacts are truly push on the Android phone such as the Hero. Setting the "Sync" is basically enabling the two-way push; otherwise you have to manually refresh your GMail or contacts or whatever.

    POP accounts setup in Mail are "pull." Those work off of a set interval to login and check for new messages.
     
  8. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    Edit: Apparently there are problems with Gmail this morning for a "subset of users". So maybe that's why my push isn't working?

    I'll have to wait until Gmail is back up, and then try it again.
     
  9. andyclap

    andyclap Member

    Joined:
    Nov 5, 2008
    Messages:
    5
    Likes Received:
    2
    Na, it's not really push. It's poll.

    Go to settings->data synchronization and you'll see the last time things were synched. There's a synch now option which wouldn't be needed for push (and even that only vaguely seems to work for me).

    Push would be the server saying: is the client connected? Yes = push the mail through the connection; no = send SMS or some other telephony trigger to launch the client app (if it's not already running) and load the item.

    Hmm, just had a thought.... sneaky, but you only pay the telcos when a call is connected. So if you build a server that makes a telephone call for a couple of rings when you have new mail, you can put a call state listener hook in for calls from that number, launch your app and sync your mail.

    Prolly get the Blackberry patent lawyers breathing heavily down your neck though...
     
  10. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    Again, not true for the Google pieces....they are push. The synchronization timestamp is a way for cleanup to occur if there was a loss of data connection. So, it synchronizes to make sure you're up to date.

    But you can test the push mechanism easily: Send yourself an email or update a contact from the website. The change or email is instantly on your Android phone with no background sync. necessary! :)
     
  11. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    Okay, so trying to test the whole "push" Gmail thing on my HTC Magic.

    I know Gmail is working. When I "refresh" in the GMail app, it downloads email from my Gmail account, however, when I send a test email to my Gmail account, it is NOT being pushed to my phone.

    I have the Gmail app running, and I have the following settings:

    Background Data = ON
    Auto-Sync = ON
    Gmail Sync = ON
    Enable Always-on Mobile = ON

    And I'm still not getting new emails "pushed" to my phone.

    what gives?
     
  12. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    Well do you switch between Wi-fi and mobile data connection? I know that originally when I got my Hero I was on wi-fi all of the time and it tended to lose its perfect sync. often. When I stayed on mobile data connection, the synchronization was solid.

    Also, Google support published a troubleshooting article with regard to a sync. issue with its applications. It just instructed the user to clear the data cache of GMail and GMail Storage (not Google Apps) and that should fix the problem.
     
  13. saidelike

    saidelike New Member

    Joined:
    Dec 11, 2009
    Messages:
    1
    Likes Received:
    0
    Hi, I would like to understand if it is really push or if it is polling from the phone. First, let's define how i understand these terms.
    - push is possible when the phone is available from the Internet world so the server (on the Internet) contacts the phone and delivers (instantaneously) the e-mail.
    - polling is the fact that a phone regularly contacts the server on the Internet in order to asks if there is any new e-mail available.

    Let's suppose :
    1) First possibility: what is interesting here is that it is possible to have an application in the background (that is not visible to the user) that regularly polls a server on the web, let's say every 10 seconds, and it appears e-mails are pushed to the phone whereas they are not.
    2) Second possibility : as andyclap is implicitly saying, the option 1) is not a good idea, because the phone is consuming battery life every 10 seconds for no reason. So we could imagine an application running in the background that intercepts phone calls from a special server on the web, and will NEVER answer them. However, it will consequently contact the server on the Internet when receiving a phone call.
    3) However, the option 2) is quite strange anyway...

    The problem with all these assumptions is that there is a priori no capability for a server on the web to directly contact the phone (at least in certain countries) because there is a NAT in the telecommunication network architecture, so the phone does NOT have a public IP address...
    Saying it differently, any phone can access the Internet without any problem, however, it is NOT possible to connect directly to a phone from the Internet, at least, this is WHAT I UNDERSTAND right now...

    I have no answer, but I do not understand HOW they have implemented their *real push* functionnality, so if an expert can explain that, I would really appreciate.

    See you
     
  14. arnodenhond

    arnodenhond Member

    Joined:
    Jun 16, 2009
    Messages:
    9
    Likes Received:
    0
    this is correct.

    so how does apple do it?
    does every iphone supporting telco have a big apple server sitting on the intranet side where the phone's addresses are visible?
    If so, that would mean an iPhone with a simcard of a non-iPhone telco would not be able to receive push messages.
    Does anybody know if the above is actually the case?
     
  15. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    You are correct in your point, but you're missing something that's critical to how this process works.

    In the case of Google synchronization, when one enables the data sync. option, there is a service that establishes with a Google server, opens a data port (equivalent to a socket), and sends and listens for data via that open connection. Therefore, it's the handset that establishes the connection--the fact of it being NAT is no longer relevant.

    The 3 Google services do indeed push a data feed whenever there is a change flagged on any of them. The fact that the listener is setup means notification and updates are automatic.
     
  16. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    JoeC, sorry, I'm still a little confused, so I'll ask what I think is a simplified question.

    With Datasync on as you've mentioned, if a new email arrives in my Gmail account _online_, does it automatically get sent to my phone, or does it not get sent to my phone until my phone checks to see if there is a "difference"?

    The former is real "push", the latter, as far as I am concerned is not push, because I don't find out about the email until the _phone_ checks the server.

    As I understand it, Blackberries have true "push" because the email is sent to the phone _without_ the phone checking to see if any email is there.
     
  17. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    No, it is a REAL PUSH. GMail, Google Calendar, and Contacts all send out data to any currently registered clients--your phone being one of them. Your phone, assuming it is registered to your Google account and has data sync. selected, will notify you instantly of that change.

    If it were not a real push, there wouldn't be any point to having the Google applications specifically set to data sync. on the device. One may as well just set up GMail in the Mail app. instead.
     
  18. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    So, then even when I have Data Sync off, Gmail is still _trying_ to push email to my phone, but failing? (ie, Gmail queries my phone, sees Data sync is OFF and does NOT send the email).
     
  19. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    That is possible, but the Google development team would have to answer that one. I suspect that it wouldn't be sending unnecessary packets of data if no service would accept them.

    Your second statement would not be true. The GMail server cannot query your phone if it has no open data channel. When the data sync. option is enabled, a data channel is opened from your phone, and a flag and address+port is entered in a Google DB that means 'data sync. enabled' for instance. As soon as any change is made to the database, a db trigger is fired and sends the data to any/all registered and listening devices.
     
  20. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    Ahhh... okay, it is becoming clearer t ome now, and I think I understand how it is not the phone checking the server. Would I be correct in my understanding then to say it works like this:

    1. Turn on Datasync on Phone.
    2. Data sync alerts Gmail server that it is on, and then does no more until/unless it is turned off.
    3. Gmail server records that that particular phone account is set to receive.
    4. An email arrives in the Gmail account.
    5. Gmail server checks the record to see if the value for Data Sync is True or False. If true it sends the email, if False, it does not.

    So if I have understood correctly, the phone is not checking on a regular basis to see if mail exists, it acts only once (when the setting is changed) to indicate to the Gmail server a value of true or false for future checks by the server for the phone's availability.
     
  21. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    Yes! You got it!
     
  22. mjschmidt

    mjschmidt Well-Known Member

    Joined:
    Jun 27, 2009
    Messages:
    1,272
    Likes Received:
    113
    Great! Now if only I could get it to work on my Rogers HTC Magic. ;-)

    I have tried this:

    Gmail running in the BG
    Background Data = On
    Sync = On
    APN and/or WiFi = ON

    However, not only do I _not_ receive notification of new emails in my Gmail account (and I am sending it test emails) but when I go in to Gmail and manually refresh, sometimes it does not get those emails, and sometimes it only gets _some_ of the emails I know to be there.
     
  23. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    1
    I have had some sync. issues when enabling and then disabling Wi-Fi. I think the issue stems from that open data socket being closed when the carrier's data channel and Wi-Fi flip. In that case, the Google server doesn't know the flag has been changed, and yet, the sync. is still enabled.

    You can go and clear the GMail Storage and GMail application cache and data, and it refreshes the sync completely.

    Other than that, it may be an issue with your carrier. You could also try keeping your data connection to 2G to see if that helps (just for testing, not implying that is your long-term solution).
     
  24. arnodenhond

    arnodenhond Member

    Joined:
    Jun 16, 2009
    Messages:
    9
    Likes Received:
    0
    i am not so sure whether the gmail app actually keeps a socket open to a gmail server. keeping the radio link up would cost a lot of power.
     
  25. aslada

    aslada New Member

    Joined:
    Mar 10, 2010
    Messages:
    1
    Likes Received:
    0
    What ever! Currently, Google does not support push notification service for application developers.
    Is google working on a push notification service for andoid application developers?
    Like the apple's Apple Push Notification Service. Not for a gmail or google developed applications.
    That is what I want to know.
    If is there any information, please let me know.
    I would really appreciate.

    Sorry my english is awful.
     

Share This Page

Loading...