Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9307845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:28:56+00:00 2026-06-19T00:28:56+00:00

While working on a little project that integrates with GCM, I’ve stumbled across a

  • 0

While working on a little project that integrates with GCM, I’ve stumbled across a bit of a strange issue.

Some times when I start watching the log to see if messages are received, messages do not appear to be coming through until I have changed the network state (I.E. originally on WiFi, if I turn off WiFi and move to Mobile Data, the messages arrive fine). After I’ve changed the network state, messages start to arrive perfectly fine, and the same applies once I change the network state back to what it was before (in this case, WiFi) the messages continue to be received.

The project itself includes the ability to start on boot (starts the GCMBaseIntentService on boot), which again works perfectly fine, and I’m sure the app / service is running as I’ve manually started up the app when this issue occurs (which also checks to see if the service is running, and if it’s not it runs it and checks to see if it’s registered).

Has anyone else come across this issue, or has any pointers as to how I could resolve this? I’m not seeing anything of much help in the log between the time messages are not being received and when they are (after changing the network state). I’ve gone through the GCM docs and can’t see any mention of messages not being received due to a time-out (on the device itself), or any config options that might affect this.

Appreciate any assistance – I can provide source if needs be, although it hardly deviates from the demo app provided in the android-sdk.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:28:58+00:00Added an answer on June 19, 2026 at 12:28 am

    I’ve noticed this as well. Although I haven’t dug into the actual code, here’s my understanding of why this happens.

    GCM (and most push messaging services) works by keeping a long-lived socket open to Google’s push notification server. The socket is kept open by sending “heartbeat” messages between the phone and server.

    Occasionally, the network state may change and this socket will be broken (because the IP address of the device changes, from 3g to wifi, for example). If the message comes in before the socket is reestablished, then the device will not immediately get the message.

    The reconnection only happens when the phone notices the socket is broken, which only happens when it tries to send a heartbeat message.

    Again, just my basic understanding of how it works and why it happens, and I could be wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some template/starting point code that I reuse across projects. While working on
I've been working for quite while on little project of mine with some XBee's.
I am working on a little mini compiler while trying to learn some MIPS
I have been working with Rails for a little while now. I got some
While working on my first project that completely uses css for layout rather than
I'm working on a little web project that needs to keeps to a NumViews
I have a project that I have been working on for a while, just
I've been trying to get started with unit-testing while working on a little cli
I have been working on a Windows Mobile app for a little while now
I've been working on writing my first MVC3 application for a little while and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.