title: Android Client-Server architecture: GCM versus webservice
body: <p>I have an Android application with a local database that contains information about pictures stored on the device. I want to create a server with pictures that could be provided on demand to all devices that have my application installed. So my application can provide local pictures or pictures from my server and also needs some information related to those pictures.</p>
  
  <p>I analyzed GCM and it great for message communication, but since the size of the message is limited to 4kb I can't send the pictures. My idea was to have something like this:<img src="https://i.stack.imgur.com/RXrq2.jpg" alt="enter image description here"></p>
  
  <p>My question is: <strong>in this context is the GCM communication useful or it would be more efficient to have only client-server communication through a webservice?</strong></p>
  
  <p>I assume that if I use GCM, in the server-client communication I only use the code bellow as in <a href="http://developer.android.com/training/displaying-bitmaps/index.html" rel="nofollow noreferrer">"Bitmap Fun" example</a> to receive the picture</p>
  
  <pre><code> BitmapFactory.decodeFile(pictureURL, options);
  </code></pre>
  
  <p>The approach above requires more battery and bandwidth since I am asking for 1 picture at a time instead of an array of 50pictures?
  If I don't use the GCM, what should I handle (e.g. device is in stand by)? </p>