简体   繁体   中英

How to send media from server to android app?

I am working on an Android app. I want to send images and videos from my server to my Android app. GCM allows only 4kb of data to be sent, but media files are generally of larger size so how to do this?

You don't send it over to your client using gcm. You use gcm to inform the client about new stuff to fetch from your server / the cloud.

Read the gcm-docs and the " send-to-sync " idea under advanced topics.

Check the Google IO web-api video (~ minute 30) for the big picture Google I/O 2012 and the files in android-sdk/extras/google/gcm/samples

I actually wrote two blogs posts on this. The first one shows how to send a link in the payload and then download the files using the URL.

The second shows how to send small images as part of the 4K payload.

将媒体(图像,视频等)存储在您的服务器上,并通过GCM将它们的链接发送到Android应用程序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM