Best way for social sharing in Android

三世轮回 提交于 2019-12-03 02:22:33

I have worked with the Facebook API and I know that it's a really good one. It looks if a native Facebook app is installed, if not it pops a little popup on your screen where it does it things, if yes, it uses that app to do your things.

I think you have to take the same approach for all your Social Networks: check if app exist. if yes, use. if no, use own implementation

Evan Leis

The Android OS uses intents to do this... While searching for an answer to this question I came across:

Social sharing on mobile

Quoting @NewProggie

Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/jpeg") // might be text, sound, whatever
share.putExtra(Intent.EXTRA_STREAM, pathToPicture);
startActivity(Intent.createChooser(share, "share"));

Depending on the MIME type you put in for setType, the chooser will show email, gmail, SMS, twitter, facebook, flickr, or whatever!

This is the easiest way to share content for the developer, and a proven method.

You might also check Socialize out http://www.GetSocialize.com . Full feature list at http://go.GetSocialize.com/features It'll let you share social actions in the app out to social networks (currently Facebook; Twitter coming this month, then likely Google+ after that).

What about the case when user does not have specific social network API installed? Then you are left with only using the API. Some might argue that if user doesn't have facebook app installed, he should not be able to share stuff on facebook, but I for example use facebook throught their mobile site, I won't waste precious space on my G1 for the hefty facebook app.

I'd go with using the API.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!