<p>This example shows how you can send a message to a mobile device by leveraging <ahref="http://aerogear.org/push/">AeroGears push</a> technology which
provides support for different push notification technologies like Google Cloud Messaging, Apple's APNs or
Mozilla's SimplePush.</p>
<p>For this example you will need an AeroGear Application running somewhere, a good way to do this is to deploy the
Push Application on <hrefa="">openshift</href>, you can follow the AeroGear Push 0.X Quickstart.</p>
<p>Once you have created your AeroGear Push Application you can create a mobile application. Simply log into the application
on the web and create a new mobile application by clicking the 'create' button. Once created you will see an application id
and a master secret, you will need the later to run the example.</p>
<p>lastly you will need to create a variant. For this example we will be using Android so you will need to create a google project,
this <ahref="http://aerogear.org/docs/guides/aerogear-push-android/google-setup/">article</a> explains how to do this.
Once created click on your app then click 'add' to add a variant. choose 'google cloud messaging', enter your google
API key and the project number from your google project and click create</p>
<p>Now before we run the example we need a mobile application to receive it. Writing a mobile app is beyond the scope
of this example but for testing purposes we have supplied an Android app you can use, simply install on your android phone.
<p>Firstly you will see that we have to create a core queue so it is available when the connector is started, the following are mandatory parameters:</p>
<ol>
<li>endpoint - The endpoint or URL of you AeroGear application</li>
<li>queue - The name of the queue to consume from</li>
<li>application-id - The application id of your mobile application in AeroGear</li>
<li>master-secret - the secret of your mobile application in AeroGear</li>
</ol>
<p>as well as those there are also the following optional parameters</p>
<ol>
<li>ttl - The time to live for the message once AeroGear receives it</li>
<li>badge - The badge the mobile app should use for the notification</li>
<li>sound - The sound the mobile app should use for the notification</li>
<li>filter - A message filter(selector) to use on the connector</li>
<li>retry-interval - If an error occurs on send, how long before we try again</li>
<li>retry-attempts - How many times we should try to reconnect after an error</li>
<li>variants - A comma separated list of variants that should get the message</li>
<li>aliases - A list of aliases that should get the message</li>
<li>device-types - A list of device types that should get the message</li>
</ol>
<p>More in depth explanations of these can be found in the AeroGear docs.</p>
<p>Now lets look at a snippet of code we used to send the message for our JMS client</p>