Anypush

From GeekWiki

Jump to: navigation, search

Contents

[edit] What is this?

AnyPush allows you to send arbitrary messages from your webbrowser, your selfwritten program, a cronjob, your torrent client or simply the commandline to your phone. This is done by "pushing" the messages - you will be notified (virtually) instantly without draining your battery much.

[edit] Whats new about this?

New is the arbitrary character and its openness. Many applications (twitter, ebay, gtalk, your mail client, ...) use push messages to deliver data instantly to your phone, but with AnyPush you can deliver data conveniently from almost every source without involving more third parties (e.g. google, or, even worse, even more maybeevildoers(TM)) than absolutely necessary.

[edit] How does it work?

AnyPush comes with a simplistic "Data Backend". This backend runs on any PHP-enabled webserver and will receive register calls from your phone and store this information in a database. Now as it knows your phones name -> google cloud2device-messaging ID it will receive your messages, store them in a mysql database and publish the id of the message to your phone. Your phone will be woken up by googles C2DM (eventually with the help of your phone provider who sends a GSM wakeup signal to your phone), a small(!) part of the AnyPush App will start and query the DataBackend for your actual messages, then display it according to your preferences. This means that google only knows *when* and *how many* messages you receive, but not the *content*. This is rather important for paranoid people like myself.

[edit] Can't it be done without googles service?

It probably can, K9Mail does it for IMAP Mailboxes, but even after talking with the developers (THANKS cketti!), digging their sources for a while and experimenting around for days i haven't been able to reproduce their reliable, google-less push service.

[edit] So how do i get this to work?

First off you'd need

  • a webserver with php and a mysql server
  • a android device with at least android 2.2 and "market" installed
  • at least one google account (...sadly).

Now you need to register your google account to be able to send C2DM messages, this can be conveniently done on: http://code.google.com/android/c2dm/signup.html Where you will need to choose the "Package Name" as "de.ghostdub.anypush" and "No" for "published in the market". Wait for the confirmation mail plus a few hours.

Meanwhile lets install the backend.

  • Clone the GIT Repository or grab the files from [gitorious]
  • Put the pushData.php file somewhere on your webserver, best is to password-protect it with [.htaccess].
  • Rename pushData.php to your needs and open it with a editor, configure the constants at the top of the file.
  • Import the mysql schema into the database you configured

Thats it, you're finished with your backend. The only thing left is now to install the application on your android phone. Make sure you select "Unknown Sources" in Settings->Application settings. Download [the APK file] and install it on your phone, or [click here] for a QR-Code-Image to scan on your phone.

Then set the application up accordingly (menu button -> prefs), register your phone on C2DM and your DataBackend (menu -> register) and try pushing data by opening:

http://url.to/your/pushData.php?devname=YOUR_DEVICE_NAME&msg=YOUR_COOL_MESSAGE

This of course also can be done using curl/wget or any http client library from anywhere you want!

Thats it, enjoy (as) free (as possible) Push Messages on your 'Droid!

[edit] Where do i get it?

Personal tools