Ways to guess if C2DM is connected

后端 未结 8 1442
花落未央
花落未央 2021-02-02 15:13

I\'m trying to place a best guess estimate as to whether C2DM messages can be received.

I\'ve created an application that relies on pushing information to a phone while

相关标签:
8条回答
  • 2021-02-02 15:48

    try to shut down all network connections and reconnect again. if you will get an registration id, then you can receive messages.

    0 讨论(0)
  • 2021-02-02 15:49

    Something related to the long running C2DM-connection that is used to deliver the triggers:

    • On WLAN it sends a heartbeat every 15 minutes.
    • On mobile networks the timeout is 28 mintes.

    28 Minutes might be to long, depening on the hardware your mobile carrier uses, 2g/3g repeaters in garages, etc.

    You can get lots of information about the connection by opening the Google Talk Service Monitor Application: http://www.honeytechblog.com/monitor-google-talk-service-android/

    Dial: ##8255##

    Theres also a button that sends a heartbeat right now and resets the timeout.

    If you want to ensure (on the client side) that c2dm-messages can be received at a given time, your best bet is to re-send the heartbeat. This can be done programmatically - only on rooted devices though. I might release an apk to the market sometime that does exactly that.

    0 讨论(0)
提交回复
热议问题