yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Q&A, Help & Troubleshooting] :
Thanks for that information! Would you be so nice to load into your bootloader and check for that green secure boot notification I mentioned? Thanks in advance for your efforts!

Gesendet von meinem Nexus 4 mit Tapatalk
[Android Apps and Games] andQlimax:
FEATURED by Whatsapp Support Page

Hi everyone,

Are you experiencing delayed push notifications from GTalk/Hangouts, GMail, Whatsapp (partial fix), Facebook, Play Store web install, etc? If so, then this app its for you!!

It's FREE! No banners. No ads. Please consider donating to the developer (link in the app).

This app work for EVERY phone. ROOT is NOT required

Root version here: http://xdaforums.com/showthread.php?t=2142503

This app basically keep alive the push connection on your phone. It avoid the tcp connection timeout that can occurs on some wifi routers or on some mobile carriers.

You will always receive instantly push notifications.

● Why were my notifications delayed in the first place?

Apps using Google's push service (Hangouts, Gmail, Facebook Messenger, e.g.) connect your phone to Google’s servers via one TCP connection (on port 5228).

To keep this connection alive, Android uses a periodic heartbeat to prevent the connection from timing out. By default, this heartbeat occurs every 15 minutes on wifi and every 28 minutes on a mobile data connection.

This is problematic because most Wi-Fi routers and mobile carriers will automatically terminate this connection after a short time of inactivity.

Because your phone is not aware that this connection was externally closed, you will not receive push notifications until this connection is reestablished when the next heartbeat is sent.

● How does PNF solve this problem?

Every x minutes it invoke an android activity that will send an heartbeat network packet on the push connection. Sending an heartbeat every 5 minutes should be enough to always keep the connection alive and all your push notifications will be instantly.

The battery should not be much impacted over a day.

Download here: PLAY STORE LINK (or get the attached APK in case not available on your country for some reason)

Please, if the are problems don't rate bad, send me an email ( ask.andqlimax@gmail.com ) or post the problem in this thread and I'll answer you as soon as possible.

Feedback are welcome!

Changelog:

See post Number 2

FAQ:

See post Number 3

Report to google here: https://productforums.google.com/fo...onnecting-to-networks-and-devices/fslYqYrULto

Download it from play store to receive future app updates ;)
[Android Apps and Games] andQlimax:
Changelog:

Version 2.5, 2016/09/10:

- Small update. Soon new things!

Version 2.0, 2015/06/30:

- Fix PNF auto-startup after phone reboot

Version 1.5, 2015/01/04:

- Material design for android lollipop

Version 1.1, 2014/03/06:

- Fix app not autostart at network changes on some phone

- The app start at phone boot itself, no need to start it or do anything

Version 1.0, 2013/11/05 :

- First release
[Android Apps and Games] andQlimax:
FAQ

Q: Does this app drain battery in background? Does lowering the heartbeat interval too much cause more battery drain?

A: It should have not a big impact on the battery during your daily use. I recommend hearbeat set to 5 minutes, it should be enough to make you receive instantly notifications.

Q: What does mean "set the heartbeat to x minutes" ?

A: It means only that android will send a network packet over the push connection every x minutes instead of the default 15/28 minutes to keep alive that connection. It does NOT mean that you receive push notification every x minutes. Notifications are instantly if the push connection is alive.

Q: Why Whatsapp messages are still delayed sometimes?

A: Whatsapp, and some others apps, don't completely rely on google push service (GCM). Those apps start their own connection when you open the application, and the messages come through this connection. The heartbeat is sent by android only on the push connection on the port 5228, and so it only keep-alive that particular connection. Blame those apps that doesn't have a keep-alive mechanism for their connection or that doesn't use full push messaging.

A workaround for whatsapp is to swipe it away from the recent apps when your finished a chat session. In this way it's connection is dropped and you will be notified of new messages through google push notifications.
[Android Apps and Games] andQlimax:
I start seeing some download, but few stars.. Come on show your gratification with 5 stars :D

Inviato dal mio Galaxy Nexus utilizzando Tapatalk
[Android Apps and Games] Hitsbam:
How?

Hi, Im using your application, the root one.

But I'm interested in how this one works.

I recently developed an app that use GCM to send messages between devices.

If you can answer me... How do you send the heartbeat through an Activity? This can help a lot of people since Google don't do anything.

Thank you :D
[Android Apps and Games] andQlimax:
Basically to trigger an heartbeat you only need those 2 lines (those are undocumented, I it discovered by decompiling GSF):

context.sendBroadcast(new Intent("com.google.android.intent.action.GTALK_HEARTBEAT"));
context.sendBroadcast(new Intent("com.google.android.intent.action.MCS_HEARTBEAT"));

where context is the application context.

Those intents will be "catched" by GoogleServicesFramework (GSF) that will physically send the heartbeat packet to the google servers. If an aswer come back instantly the push connection is alive, otherwise if in 60 seconds there is no answer back, GSF will initiate a new push connection without to wait the next heartbeat.

The first intent is for Ice Cream Sandwhich and below "I think", while the second one is used in new android versions, should depend from the GSF version installed..But you can safety fire both, since one of the two won't just do anything.

Not sure if it is a good practice to place it inside an application, since if every developer will do that the battery will be killed. Maybe you can invoke that only in some situations.
[Android Apps and Games] Hitsbam:
Thanks a lot.

Your right, if every developer use it then can turn in to a problem.

I'm not going to use it, only in the start of the app if the users reports me problems. But first i'm going to suggest your application, i think is a better solution by the moment :good:.

Thanks for satisfy my curiosity.
[Android Apps and Games] andQlimax:
PNF root reached 50.000+ downloads!

PNF no-root need more advertising..Share it to people may need this app and give 5 stars!
[Android Apps and Games] lefty68:
Great app :good:

I'm new with android. How can I swipe whatsapp away from the recent apps in settings when I finished a chat session?

Thanks in advance ;)
[Android Apps and Games] andQlimax:
Depends from your phone I think, just launch the recent apps list and remove / swype whatsapp from there..

On the Nexus phones there is a dedicated on screen button to open the recent app list, on some Samsung phone I think you can long press the home button.

Inviato dal mio Galaxy Nexus utilizzando Tapatalk
[Android Apps and Games] lefty68:
On Huawei g300 phone I can long press the home button to open the recent app list too, but it seems like in android 2.3.6 I can't swipe apps away. Any alternative action?
[Android Apps and Games] dd00_xda:
Hi, I'am using the same method in my product.

Can we reach an agreement how to reduce the frequency of these intent calls? :)

I have no idea to realize any heartbeat timeout settings in my app (hard policy).

I can't listen for these intents cause it requires com.google.android.c2dm.permission.SEND permission that can't be acquired.

For example, can you send some additional broadcast intent (w/o permissions) when fire heartbeat?

I'll listen for it and reset own alarms to not to do the same action.
[Android Apps and Games] andQlimax:
I have to check, there is an other intent directly fired by android which indicate that an heartbeat has been sent, you can listen that intent I think

I don't remember it right now what, I will check tomorrow maybe and will let you know
[Android Apps and Games] andQlimax:
[MENTION=5549173]dd00_xda[/MENTION]

It seems there isn't an android system intent that you can listen to check if an heartbeat has been sent.

About your request to send some broadcast intent in my app, what will be the advantage for you? I mean, if you already need my app installed, then you don't need at all your own alarm..My app by default send and heartbeat every 5 minutes for example (the alarm will start every time a connection is made) and in that way the push connection is already alive..and every notification you app need to listen, it will always being received
[Android Apps and Games] funksoulbrother:
Thanks very much for creating this app! I have a question about it.

I previously had a Samsung Galaxy S3 running Android 4.1.2. Push notifications worked fine over Wi-Fi when I was at home.

I have now switched to a Nexus 5 running Android 4.4. I'm still using the same router at home, but I'm getting an issue with notifications being delayed. Sometimes I will not get any notifications for a while, then a bunch will turn up at once from different apps.

Does the issue I've described sound like it's related to the problem that this app is designed to fix? If so, how come everything worked fine with my S3 with the same router?

Many thanks!
[Android Apps and Games] andQlimax:
maybe the issue is that the device loose the network while the screen is off? that's a common problem on some device, it is not fixed by PNF
[Android Apps and Games] funksoulbrother:
Thanks for the reply!

Do you have any recommendations of how I could troubleshoot this issue? I really don't know what the cause is - I just know it happens, and if it was a widespread issue with the Nexus 5 then a lot more people would be talking about this issue. I've only seen a handful of folks mentioning it.

Thanks again.
[Android Apps and Games] andQlimax:
if the phone disconnect from the wifi while the screen is off (happen also with only some routers sometimes), you usually should see the phone reconnect as soon as you wake the screen..if you pull down the notification bar and open the toggle switch, you should see the wifi icon orange (no connection to google server) and in few seconds become white again (connected).
[Android Apps and Games] funksoulbrother:
Thanks again.

I don't believe the Wi-Fi is disconnecting. I can ping the device when the screen has been off for ages and notifications do come in when the screen is off - they're just delayed and sometimes I don't get a notification at all, yet I'll get an email notification on my PC.
[Android Apps and Games] andQlimax:
that's strange...anyway my nexus 5 is arriving, I will do some tests and see if PNF is working correctly on KitKat :)
[Android Apps and Games] Strider Nemesis:
Which router are you using? I use a Linksys E1200, and PNF wasn't able to fix my issue on 4.3 with a Nexus 4. I can't ping my phone a few minutes after the screen goes off.
[Android Apps and Games] andQlimax:
PNF doesn't fix connection drops...

It fixes a connection timeout to Google push service.

Inviato dal mio Galaxy Nexus utilizzando Tapatalk
[Android Apps and Games] tfouto:
Hi,

Thanks for this app... Altough i still have sometimes delays in hangouts when on network connection... Does hangouts uses the standard Google Push notification service? Might be that this tasker is not always ran by android tasks?

Many thanks
[Android Apps and Games] andQlimax:
Hi,

Hangouts should use Google push from what I know.

What can happen is that PNF could be terminated by Android and the heartbeat is not sent anymore with short frequency in some occasions.

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] tfouto:
So, this version cant be 100% reliable? Isn't there a way to PNF dont be terminated by Android? PNF doesn't use an Android tasker to run from x to x minutes? Doesn't that should run always? Android might not run based on some circumstances?

Does the root version is 100% reliable, ok, 99%?

I dont like to root my phone, but if the root is more reliable i will root.

Many Thanks
[Android Apps and Games] andQlimax:
The root one is 100% reliable because it doesn't have to run in background, it directly modify the default Android heartbeat.

The non root one run an android alarm that should be reliable but under some circumstances like low memory ram it could be stopped, from what I know there is no way to avoid that. The way to make it more reliable is to show a permanent notification on the status bar, in that way the app get a major priority and also you will be able to see in case it has been termiated for some reason. Show a notification could boring some users I think, maybe I could put that an option to enable or disable in a future version.

Anyway keep in mind that even if in some circumstances it stops, it will restart at the next reconnection to the Google services, because the app wakes on that event (which also occurs when a network connection is acquired or when Android send the heartbeat and the connection results in timeout)

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] tfouto:
Could it be that if the connection stops momentarily, because you pass on a place where there is no network, even if it reconnected just a moment later, the alarm just never became active again until the next reconnection to Google services?
[Android Apps and Games] andQlimax:
After a reconnect, also the push connection is fresh started, as well as the PNF alarm starts again and after 5 minutes trigger the heartbeat

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] ragingsilver:
I knew I wasn't going crazy for the past year about this. I've gone through 3 phones thinking it was the phones fault. I then thought it may be the routers (Virgin Media Superhub) fault, still partially is. I've tried port forwarding and that improved a little but I wanted better.

Right now I'm trying the root free version on my Moto G and I will report back of the results later and give you 5 stars in the review on the play store. I just want to know two things:

- Does this work on Android 4.3 and higher?

- Does this need to be running in the background because I don't see it running right now?

I'm a bit of an Android noob so bare with me please. I came from iOS and Windows Phone 8 not long ago.
[Android Apps and Games] andQlimax:
Hi,

- Yes it works on any android version 2.2 and higher;

- If you are using the ROOT version (requires ROOT/jailbreaked phone, refer to this thread: http://xdaforums.com/showthread.php?t=2142503), the app does NOT run in background, since the root app does permanently modify the android heartbeat. If you are using the no-root version, it runs in background

About your wifi router, you can check in advanced options if there are some settings regarding "tcp idle timeout", you should increase this value to something like 30 minutes, and your problems will be solved.
[Android Apps and Games] ragingsilver:
- I am using the non root version and I see it in the cached running background (Settings > manage apps > running). Is this right?

- My router doesn't have all the options like I used to have on my old router which I put Tomato firmware on it. This is one from my ISP and I rather not use another router just to solve one app issue lol.

- Should I port forward? so far I've use TCP with 5228 and 5223

I will report back in a few days.
[Android Apps and Games] ragingsilver:
Hi,

After 3-4 days of testing I can confirm this works. It's only about 30 seconds off but I'll take that over 10 minutes anyday! I find it works best when I leave it running in the multitasking menu. I'm not sure if I can take that off as I mentioned before, I don't see it running in the apps > running section.
[Android Apps and Games] burdo:
Perfect

It works perfectly. My carrier kills the connection after 90 seconds. I had to set it to 1 minute. Tried both versions. Thank you so much!

Even whatsapp works, if it doesnt make sure you close the app by pressing the back button instead of the home button when you dont use it anymore.

Please add the option for a persistant notification in the non-root app so it doesnt get killed by the system. If you play a game sometimes it does get killed when the system needs ram.

Root version is flawless.

PS: If I understood correctly by reading this thread, even if the app gets killed by the system It should relaunch itself the next time the hertbeat in the GCM gets sent ? And stays alive from there on?
[Android Apps and Games] andQlimax:
Yes, you understood correctly.

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] poled:
And do you know how does whatsapp timeout work? In my previous carrier I had no whatsapp delays, so I think my actual carrier kills an idle tcp connection sooner. Whatsapp uses to connect to remote 433 and 5222 ports. Would it be possible to make a program that keeps alive an existing tcp connection?

Thanks for your work
[Android Apps and Games] andQlimax:
" because in my previous carrier the whatsapps were received immediately" INFACT the problem are some carriers and some wifi router as i said millions of times.

My app doesn't send any heartbeat if you read the description, my app (the non root one) trigger a system activity that send the heart beat. The heartbeat mechanism is completely managed by Android with fixed intervals.

My app ONLY short that interval. The root one change the intervals values, the non root does trigger an activity every x minutes to send the heartbeat.

If you look with netstat you see a connection on the port 5228, the gcm connection (where the Android keepalive hertbeat is sent) . And a connection on the port 5223, the whatsapp connection.

If you do some research you will see that carries and routers does kill unused tcp connections after a certain amount of time. So everything depends from that.

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] andQlimax:
I did some research and didn't find nothing about that. Only who initiated the connection can send packets on it (it's also a security measure of the tcp protocol). You can't hijack an other connection. The only thing that works is to kill every x minutes whatsapp so that it's connection is reinstantiated every time.

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] poled:
Could you add that in your app as an option? to kill whastapp when it is not in use. I don't know the battery impact, and maybe to kill another app is only for root users...

Do you thing it could be possible to modify the whatsapp apk to include a keep alive mechanism?
[Android Apps and Games] andQlimax:
Modify the apk to add a keep alive is impossible without source.

What I was already thinking is to add an option to kill whatsapp every x minutes, it should be possible without root, but needs testing to see what will happen if a message was going to be received and the app is killed, it could be marked as received from the server but not get displayed to the user.. Pretty hacky solution anyway.

An other option I was looking is to cross compile the linux binary "tcpkill" and port it to an android binary to use it like a shell command, with it will be possible to kill a particular tcp connection without kill the entire process, to force the reconnection. Anyway not have much time to do all this, need time.

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] DelBoy:
Any updates for ART?

App is working, but there is any effect, while on dalvik I see effect.
[Android Apps and Games] andQlimax:
Hi,

It's work fine on nexus 5 with art.

If you dial *#*#426#*#* you can see the heartbeat countdown behaving correctly. The countdown start from Android defaults values 15/28 minutes (wifi/mobile) but it's correctly reset every x minutes (eg 5 minutes) according to your pnf settings. Every time the countdown reset, the heartbeat packet is sent and the push connection is being keep alive and apps that use Google push messages (not whatsapp) can receive instant messages ;)

If you don't receive instantly messages, unfortunately you have to look something else to solve your issue.

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] DelBoy:
It was up to me. I pulled the buck up, but forgat to click set heartbeat. Stupid me. Its fine now
[Android Apps and Games] andQlimax:
New version of PNF no-root pushed on the play store, it will appear soon:

Version 1.1, 2014/03/06:

- Fix app not autostart at network changes on some phones

- The app start at phone boot itself, no need to start it or do anything

Give 5 stars to encourage further developing
[Android Apps and Games] No_Signal:
Thanks for the update!

It might be a little bit OT; afaik to use GCM I need to be logged in to a Google account or at least registered once.

Anything known to use the GCM service with limited Google services installed - or at best, none at all (for like Threema)?
[Android Apps and Games] andQlimax:
GCM works also without Google account on your phone (differently to the old c2dm), that what documentation said, I didn't tried that anyway.

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Android Apps and Games] michalurban:
How is it possible that it works on non-rooted phone? Is the non-rooted variant as reliable as the rooted one is (I used it and it worked good!)?
[Android Apps and Games] andQlimax:
On non-rooted phone the app doesn't change the heartbeat interval, but triggers the intent to send the heartbeat every x minutes. So at the end the effects is same. The non-root version should consume little bit more battery since it has to run an alarm every x minutes to fire the heartbeat send, while the root version does not need to run in background since it permanently change the interval values.
[Android Apps and Games] michalurban:
Thanks for your answer! :)
[Android Apps and Games] joubertvasc:
Event canceled

Hi andQlimax! Thank you for your work. Very helpful.

I'm very lost developing an app that is pure dependent of GCM. If I send messages to a list of devices (all of them are the same model, version, etc.) and some of them are off, the message is not delivered when I turn them on. Using your application I can see the log: RECEIVED jv.android.atm CANCELED.

Do you know why the messages are canceled before my application received them? And the weird thing is the message works in some devices and other don't!

Thank's in advance!

Joubert
[Android Apps and Games] iamdwinner:
Open Source?

It really seems to be a useful app. Are you willing to make it open source as you have kept if free in play store with no banners or ads. And by the way thanks a lot for the app and keeping it free.
[Android Apps and Games] joubertvasc:
Opensource

All the best!
[Android Apps and Games] wirelesscord:
Edit: doh, didn't read FAQ properly.
[Android Apps and Games] scotyard:
[MENTION=2790445]andQlimax[/MENTION]

I tried this 3-4 days back and it worked then but now I'm back to square one; no notifications. I ran this app again a number of times but now it's not working(restarted phone after running app). Any solutions? HTC Desire 820s on kitkat 4.4.4
[Android Apps and Games] MaxGood99:
Nice App. Thanks for sharing.
[Android Apps and Games] scotyard:
[MENTION=2790445]andQlimax[/MENTION]

Any help? I've noticed that my phone shows "connected" in *#*#486#*#* only at 2:30 in the morning and it's only then that I receive notifications everyday(notifications only once a day).
[Android Apps and Games] BabyJesus:
...which is how I got here.

Your solution works perfectly to fix my WiFi push notifications issue (no problem on mobile data), but had to set it to a rather aggressive 2 minutes.

It's all quite odd, since my router allows near total control over TCP timeout settings, including separately for SYN, FIN, Close, Last ACK, etc. *and those settings are just fine and dandy*!

There are some UDP settings in my router I could tune. But do UDP settings have any influence at all on the time-outs that are causing these problems?