title: how to count android gcm payload length
body: <p>In the android GCM document, it is said the payload has a limit of 4096 bytes.</p>
  
  <p>However, I found that I can send a payload with 16834 byes. </p>
  
  <p>Did I make a mistake? I computed the length as follows:</p>
  
  <hr>
  
  <pre><code>Map&lt;Object, Object&gt; jsonRequest = new HashMap&lt;Object, Object&gt;();
  setJsonField(jsonRequest, GCMConstants.PARAM_TIME_TO_LIVE, message.getTimeToLive());
  setJsonField(jsonRequest, GCMConstants.PARAM_COLLAPSE_KEY, message.getCollapseKey()); 
  setJsonField(jsonRequest, GCMConstants.PARAM_DELAY_WHILE_IDLE, message.isDelayWhileIdle());
  jsonRequest.put(GCMConstants.JSON_REGISTRATION_IDS, registrationIds); 
  Map&lt;String, Object&gt; payload = message.getData(); 
  if (!payload.isEmpty()) { 
      jsonRequest.put(GCMConstants.JSON_PAYLOAD, payload);
  }  
  String requestBody = gson.toJson(jsonRequest); 
  System.out.println(requestBody.getBytes("UTF-8").length);
  </code></pre>
  
  <hr>
  
  <p>Furthermore, what's the response from GCM if the payload is too long?</p>