title: Android Push Notifications Client
body: <p>I fount this server-side code for android push notifications:</p>
  
  <pre><code>&lt;?php
  
  // API access key from Google API's Console
  define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
  
  
  $registrationIds = array( $_GET['id'] );
  
  // prep the bundle
  $msg = array
  (
      'message'       =&gt; 'here is a message. message',
      'title'         =&gt; 'This is a title. title',
      'subtitle'      =&gt; 'This is a subtitle. subtitle',
      'tickerText'    =&gt; 'Ticker text here...Ticker text here...Ticker text here',
      'vibrate'   =&gt; 1,
      'sound'     =&gt; 1
  );
  
  $fields = array
  (
      'registration_ids'  =&gt; $registrationIds,
      'data'              =&gt; $msg
  );
  
  $headers = array
  (
      'Authorization: key=' . API_ACCESS_KEY,
      'Content-Type: application/json'
  );
  
  $ch = curl_init();
  curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
  curl_setopt( $ch,CURLOPT_POST, true );
  curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
  curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
  curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
  curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
  $result = curl_exec($ch );
  curl_close( $ch );
  
  echo $result;
  </code></pre>
  
  <p>But I couldn't understand how to implement the android part. I need a service that listens for those notifications. What should I do, can you give an example? Thanks!</p>