performance - Android Client-Server architecture: GCM versus webservice -
i have android application local database contains information pictures stored on device. want create server pictures provided on demand devices have application installed. application can provide local pictures or pictures server , needs information related pictures.
i analyzed gcm , great message communication, since size of message limited 4kb can't send pictures. idea have this:
my question is: in context gcm communication useful or more efficient have client-server communication through webservice?
i assume if use gcm, in server-client communication use code bellow in "bitmap fun" example receive picture
bitmapfactory.decodefile(pictureurl, options);
the approach above requires more battery , bandwidth since asking 1 picture @ time instead of array of 50pictures? if don't use gcm, should handle (e.g. device in stand by)?
gcm useful if server needs alert client application new data (in case new pictures). allows server send data client while client app not running (or running in background). in case green line makes sense - server can send picture info client via gcm. then, specified red line, client ask server picture itself.
the blue line marked ask pictures
should go directly client server. client can't send requests gcm server (except of requests register/unregister to/from gcm service).
if sending of pictures server client initiated client, don't need gcm.
in addition, can check this question learn more sending images via gcm.
Comments
Post a Comment