1. Give an information and the IP address to my server, running on PHP (I know how to do this)
2. Close, or whatever.
3. When the server has an information for the app, the app should start automatically.
A Push Notification is a free service of google (GCM).
With this service you can receive notifications on any data that interests you. I've used it to receive commands from a server to open a particular application, to vibrate the phone, save messages to a file, etc.
I've done it with a servicemodule whith the property # StartAtBoot: True, so that when you reboot the device, start the service again.
To my knowledge, there is no need to scan. It works by intents.
The advantage is that it is a free service from Google, at least for now.