GCM发送短信的形象,而不是 [英] GCM send image instead of message

查看:136
本文介绍了GCM发送短信的形象,而不是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个Android的新手,而我使用的谷歌GCM发送纯文本邮件。是否有可能发图片的文件流或者其他方法?

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?

爪哇 - 服务器

Android的 - 客户端

Android - Client.

    Message message = new Message.Builder()
                .collapseKey("1")
                .timeToLive(3)
                .delayWhileIdle(true)
                .addData("TEST",
                        "Hello Android")
                .build();

下面的平原消息 .addData(TEST,你好Android的)

推荐答案

我写一篇关于如何做到这两个博客的帖子:

I wrote two blogs posts on how to do this:

<一个href="http://blog.andromo.com/2012/tutorial-using-airbop-to-push-images-for-bigpicturestyle-notifications/"相对=nofollow>教程:使用AirBop发送图像的消息负载说明如何通过Base64编码的图像做

Tutorial: Using AirBop to Send Images in the Message Payload which shows you how to do it by base64 encoding the image.

教程:使用AirBop推动BigPictureStyle通知这表明你如何把图像的URL,然后下载的图片图像。

Tutorial: Using AirBop to Push Images for BigPictureStyle Notifications which shows you how to push image urls and then download the image.

这两个教程使用AirBop作为应用程序服务器,但客户端code是分开的,并且可以被一般使用。

Both tutorials use AirBop as the Application server, but the client code is separate from that and can be used generically.

这篇关于GCM发送短信的形象,而不是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆