Android share to facebook twitter g+ and others - android

New to android here but not to stackoverflow, i know this was asked before but hear me out first:
So regular Share through chooser:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, message);
sendIntent.setType("text/plain");
No longer works!, facebook doesn't allow pre-filled text to be sent(so i understood).
BUT I've seen apps do it anyways, by first presenting a pre-filled dialog they created with the text and then showing a custom chooser for sharing.
I have no idea how they do that, i can't find any answers in the forums for pre-filled text share to facebook.
Worst part is, i want to share text with an image, like in this photo here.
Where can i get a good sample project / Tutorial for:
1. simple facebook share.
twitter and google+ sharing.
custom chooser.
Also, would like to hear your comments and regards on best practices with social media sharing AND using a chooser.
Cause i also want the be able to share to apps like WhatsApp and other of that sorts.

With facebook's new SDK you can no longer use ACTION_SEND to share text information.
You can post on behalf of the user but not pre-fill the text for a status update, at least i did not find a way to do that.
You must also have your app actions checked and accepted by facebooks policy.
The answer: Stop working with facebook untill they remove their app from the ACTION_SEND in the android chooser.

Related

Share instagram post on my app

I'd like to let a user share an Instagram post on my app.
I've noticed that Instagram shows a dynamic list of apps that accept its shared content, but I couldn't find the exact way to add my app into that list.
A screenshot with Instagram's share menu:
As you can see, only WhatsApp is enabled, after I've installed it.
I can confirm that installing other specific apps, such as Facebook's Messenger, would populate this menu.
This makes me realize that there must be some intent filter that these "client" apps (WhatsApp etc') use to say "Hey Instagram, I accept your shared content".
Maybe there's another way.
I'd like my app to be able to do that. How? Thanks!

Can someone please explain to me the quickest and easiest way to share one link on facebook from an Android activity?

Long story short: I have an android app, from which I want users to be able to share the play store link of my app on their facebook walls.
I don't care about fancy logins with custom user pictures, or taking over the user's news feed, or having facebook take over my app...
I don't need this to happen automatically; a simple redirect to facebook.com or the facebook app with the link already typed in the field the user can submit is all I require.
Is there any way to accomplish this without implementing facebook login or open graph?
If so... HOW?
Thank you!
Use the Android share intent like this:
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
More info can be found here:
http://developer.android.com/training/sharing/send.html

sharing android application content on facebook

how can I allow users to share the data(text data) they have saved in android app on their facebook wall through a share button within the app. I am not sure if I should use facebook android sdk device or share-intent. I will be thankful if someone could provide me with some information on this or tell me about any tutorials related to this.
Thanks
You can not share the text on facebook wall using intent in android. For to achieve this you need to use facebook sdk. Using intent you can share the text on email, twitter and can share the photo on facebook.
I used intent earlier to send text on facebook its was not working earlier.
As per the Facebook's Platform Policies, We cannot pre-fill the share dialog using Intent.EXTRA_TEXT. It is usually thought to be a bug, but as per a Bug Report filed here and also, here, Facebook clearly mentions that this is not the case (it's not a bug).
I found that we cannot add a caption to a photo we are uploading using Intents. The only way we can do it, is integrating the Facebook SDK in your App then photo with text caption will be shared on facebook wall.
To get started for facebbok sdk in android:
https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

Google+ sharing using Android application

Need to share our application in all social site like Facebook,Twitter,google+ ..Using Share auth api we can share in Facebook and Twitter.
Share Auth API:
http://code.google.com/p/socialauth-android/wiki/GettingStarted
Not able to share in google+ ,is there any plugin available?
Now am using this sample program,not able to share using this.
https://github.com/imellon/Google-Plus-Android-Sample
Please help..
Google plus does not have a publicly available API yet although there are some options available at https://developers.google.com/+/mobile/android/
I would highly recommend not to use a unique SDK for each social network since they contain a lot of bugs, and are not very reliable.
If you just want to share simple text from your app to Facebook,Twitter,Google+ and so on... I would recommend to create a chooser to let the user pick which app from his phone he wants to user for sharing. It is simple, reliable and this is how it's usually done in android.
Sample code :
Intent shareIntent=new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"your text here");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "post title");
startActivity(Intent.createChooser(shareIntent, "Share..."));
This will display to the user, all the apps that are capable of sharing a text post. If the user has facebook, twitter and google+ apps in his/her phone, then it will show all of them and the user can choose which ones to share to.
You might be looking for Google plus sdk for android.
Sign in
Sharing
Write moments to your user's Google+ history
+1 content in your app

share using intent to facebook in android

I use the following code to share content
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "The status update text");
startActivity(Intent.createChooser(intent, "Dialog title text"));
It is OK for email, sms and whatever except Facebook.
I google the reason and it seems that it is a bug of facebook since April but unfortunately no one fixes it.
However, I find that many app can still use intent chooser to invoke Facebook successfully such as Google reader. How can they do it?
As I know, we can use Facebook API, but how they can know user choose facebook in the chooser and invoke the facebook API?
According to the latest updating to the bug tracker this is 'By Design' and the bug has been closed.
https://developers.facebook.com/bugs/332619626816423/
So looks like this isn't going to be possible via intents..
You could only send pure URL to facebook. It should be a bug on facebook App.
For more detailed information, refer to the following post
Share Text on Facebook from Android App via ACTION_SEND
Someone has posted this issue to official facebook bug tracker, but it's still not solved yet.
Bug 16728 - Android ACTION_SEND is not handled correctly

Categories

Resources