Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes you do need a key. Look at this <a href="http://developer.android.com/google/gcm/gs.html" rel="noreferrer">http://developer.android.com/google/gcm/gs.html</a></p> <p><strong>First, we need to send data to/from the client</strong> for the example you set up (<a href="https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae" rel="noreferrer">App engine connected with Android App</a>) using</p> <pre><code>com.google.android.gcm.server.Sender helper class </code></pre> <p>Again, that helper class is step #4 and how to use it is in <a href="http://developer.android.com/google/gcm/gs.html#server-app" rel="noreferrer">Writing the Server-side Application Server-side Application</a> </p> <p><strong>Naturally then you want to persist or look up data.</strong> You can do that in the whatever class is used to send/receive messages (which of course uses the Sender helper class above)</p> <p><em>Then the easiest and maybe best way for AppEngine if you are using Java is to use Objectify.</em> Trust me or google it to see how good it is. <a href="https://code.google.com/p/objectify-appengine/" rel="noreferrer">https://code.google.com/p/objectify-appengine/</a></p> <p>The docs for Objectify are really good and I didn't really have any trouble the first times.</p> <p>Their simple example is:</p> <pre><code>@Entity class Car { @Id String vin; // Can be Long, long, or String String color; } ofy().save().entity(new Car("123123", "red")).now(); Car c = ofy().load().type(Car.class).id("123123").get(); ofy().delete().entity(c); </code></pre> <p>I think you are good to go.</p> <p>Summary:</p> <ul> <li><p>YourMessageClass (on Appengine)</p> <p>-- uses com.google.android.gcm.server.Sender to send/recieve data</p> <p>-- uses Objectify to persist data.</p></li> </ul> <p>The next question is where are you putting YourMessageClass. Will it be in a Servlet that is handling a short-lived request? (<a href="https://developers.google.com/appengine/docs/java/runtime#Requests_and_Servlets" rel="noreferrer">https://developers.google.com/appengine/docs/java/runtime#Requests_and_Servlets</a>) Will it be in a long-running backend? (<a href="https://developers.google.com/appengine/docs/java/backends/" rel="noreferrer">https://developers.google.com/appengine/docs/java/backends/</a>) but that is beyond the scope of this discussion.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload