从Android的图片分享至Facebook? [英] Image share from android to facebook?

查看:354
本文介绍了从Android的图片分享至Facebook?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么可以从我的应用程序的Facebook在Android中共享一个形象?

解决方案

 公共无效shareOnFacebook(){
    开放的我们的uri = Uri.parse(http://m.facebook.com/sharer.php?u=+
            website_url +& T公司=+ someTitle.replaceAll(,+);
    意向意图=新的意图(Intent.ACTION_VIEW,URI);
    startActivity(意向);
}
 

在您的网站应持有meta标签如

 <链接相对=image_src类型=图像/ JPEG的href =htt​​p://www.domain.com/someimage.jpg/>
 

这将被用来在Facebook的形象宣传片。当然这也可以动态地对服务器侧进行。

这是在您使用一个形象,也是一台服务器上的某个地方已的办法,这样你就不会需要从你的Andr​​oid设备首先发送到服务器。根据你的使用情况,但是这通常是最简单的方法。

How i can share a image from from my app to facebook in android?

解决方案

public void shareOnFacebook() {
    Uri uri = Uri.parse("http://m.facebook.com/sharer.php?u=" +
            website_url + "&t="+ someTitle.replaceAll(" ","+");
    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    startActivity(intent);
}

where your website should hold a meta tag like

<link rel="image_src" type="image/jpeg" href="http://www.domain.com/someimage.jpg" />

which will then be used on Facebook as the promo image. Of course this can also be done dynamically on server side.

This is the approach where you use an image that's also on a server somewhere already, so you don't need to send it from your Android device to a server first. Depending on your use case, but this is usually the easiest way.

这篇关于从Android的图片分享至Facebook?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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