Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (22 sloc) 993 Bytes

Android Receiver


Listen for broadcast messages from android-notifer coming over a specific port. Parse the message, format it, and hand it off to a handler function.

This was done mostly as a learning exercise in C.


android-receiver &


Two constants are defined at the top of android-receiver.c:

  • PORTNO is the port number to listen on (10600 is android-notifier's default)
  • HANLDER will be executed with the formatted message passed as the first argument when one is receieved.

You can find the dzen2 handler I'm using in my scripts repo. You could also write your own wrapper around gnome-dbus, notify-osd, etc.

My machine is setup to block TCP broadcast packets as per Arch's "Simple stately firewall". Rather than change this setting, I've elected to setup the notifier app on my phone to send a UDP packet to a specific IP address instead.

That is what this program expects.