Best way for social sharing in Android

你离开我真会死。 提交于 2019-12-03 11:53:26

问题


I've been looking for a way to share information to social networks. 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?


回答1:


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




回答2:


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.




回答3:


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).




回答4:


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.



来源:https://stackoverflow.com/questions/4656641/best-way-for-social-sharing-in-android

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