This folder contains examples of Mojo Messaging service which is also refered to as publish/subscribe. There are two folders, Device-MojoMsgSample - This is device Mojo app that recieves or subscribes to the messages. Cloud-MojoMsgSample - This is the server component that pushes messages from the cloud. What do the sample applications do? ----------------------------------- Device-MojoMsgSample: This app creates an endpoint and shares the publish key to the Cloud app. It also gets a deviceCode to identify the device from the Cloud app. It then subscribes and waits to receive messages pushed from the cloud app. Cloud-MojoMsgSample: The app provides a form on a web browser to enter a text message and push it to the device. The device code, identifies the device you want the message to be pushed to. The devicecode is visible on the device app if it successfully registers with the cloud app. Importing and using the examples: --------------------------------- Cloud-MojoMsgSample: The cloud example is written using a java app on google app engine. Before you import this project make sure you have the java appengine plugin for eclipse. http://code.google.com/appengine/docs/java/gettingstarted/installing.html Once you have installed the appengine plugins, Import the project - go to File->Import->General->Existing Projects into Workspace Choose, the PushExampleApp folder inside Cloud-MojoMsgSample and click Finish. Device-MojoMsgSample: This section assumes you have the Eclipse setup along with the Palm plugins when you set up your sdk. To import the project, go to File->Import->General->Existing Projects into Workspace Choose, the MojoMsgSample folder inside Device-MojoMsgSample and click Finish. Running the Sample Applications ------------------------------- Cloud-MojoMsgSample: 1. Get the certificate file ps15.sb.palm.com.cert from the MojoMsgSample folder. 2. Goto the java bin directory (of the VM that you are your eclipse cloud app is using). 3. Type the following command. keytool -keystore ..\lib\security\cacerts -alias ps15palm -import -file If asked for password, try 'changeit' which is the default and say 'yes' to accept certificate. 4. Select the PushExampleApp on Project Explorer pane right click and choose Run As -> Web Application You should see a Google Web Toolkit browser window that has shows a simple form with a heading fo 'Example of Mojo Push ...' pop up. Device-MojoMsgSample: 1. Goto MojoMsgSample app and open app/assistants/mojomsg-assistant.js. 2. Navigate to the function MojomsgAssistant.prototype.shareKey(), Fix the variable name 'URL' from localhost to the IP of the computer you are running the Cloud-MojoMsgSample. 4. Make sure your Palm emulator is running. 5. Launch First Use application on the emulator and login. This will automatically log your device into Palm's mojo messaging service dev environment. Close the First User app. 6. In eclipse, Select the application root (MojoMsgSample) on Project Explorer right click and choose Run As -> Palm Application