开发者

Best way for social sharing in Android

I've been looking for a way to share information to social ne开发者_JS百科tworks. I've found 2 possible solutions:

  • Look for installed apps and sent an intent (like android uses in it's gallery)
  • Use the socials network api

When looking for quick ways to implements i say use the installed apps for that but if it goes customization and generalization i think the second option is the best.

I've a hard time deciding if one outweighs the other or not.

So my question is: What is the best approach? One of the ones i suggested or a whole different way?


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜