GCM send image instead of message

后端 未结 4 1008
无人共我
无人共我 2020-12-11 05:10

I\'m an Android newbie, and I\'m using Google GCM to send a plain text message. Is it possible to send an image file as stream or by some other method?

Java -

4条回答
  •  情话喂你
    2020-12-11 06:00

    Okay let's think about the bigger picture here. As everyone has said it is very hard or impossible to send an image using gcm unless you have a tiny image. Another technique is to send it in parts but hey that's annoying no one wants to code that all out. My suggestion is to code the server to store passkeys and image credentials which can be sent to the device. The device then queries the server with the credentials to get an image download. This technique is similar to the theory of using push to notify the device that new data is available on the server. It was originally used to make a server that uses as little push as possible but it is adpted in this case to be a placeholder for sending big data.

提交回复
热议问题