3

According to this Android C2DM keeps a socket alive with a heartbeat mechanism, making it able to receive push messages. This made me hope I could deliver messages to sleeping phones with an active wifi connection.

I've made an implementation setting the "delay_while_idle" to '0'. The message is delivered if my phones' screen is powered off, but not if the phone goes to sleep (tested with intervals 20mins, 1-6 hours).

I have acquired a partial cpu lock + a full wifi lock just in case.

Have I simply made something fundamentally wrong or did I misunderstand the C2DM push functionality?

Can I send messages to sleeping phones or not?

4

1 に答える 1

2

ウェイクロックの代わりにアラームマネージャーを使用すると、電話を十分に活用できます. この実装を参照してください。これの変種をテストします。

于 2011-01-16T14:21:34.540 に答える