How to share image from my app on Facebook - android

I want to allow users to share image from my app on Facebook. Say I already have an image (i.e. file path). How do I go about letting a user share it on Facebook? Basically I want the user to agree once. Then from there on, whenever the user takes a certain action in my app, share a particular image on Facebook on behave of the user. Notice that the image is to be shared automatically without the user having to take action each time; so the Facebook sharing is incidental to some other action in my app. I am looking at the Facebook documentations. It is not clear which path to take to accomplish what I need. So thanks for any guidance.
Again, the user agrees once and goes on her merry way. Then the app, each time a user takes a certain action, share an image on Facebook.
UPDATE
Here is the path I have identified for sharing a photo on behalf of a user
Setting up your app to use Open Graph
Creating an Open Graph Story
Posting with API calls
The problem with this approach is that, at least in the sample project, the user has to click on Share each time. But I don't want the user to have to click on share each time. I want them to give me permission once. And then from there the app shares for them automatically.
Trial and error is expensive here as it is a lot to implement just to see if it were what I was looking to do: Which is why I am asking here, hoping someone here has done this in the past and don't mind sharing their experience.

You should ask the user for the publish_actions permission, and then use Request.newUploadPhotoRequest to publish a photo. https://developers.facebook.com/docs/reference/android/current/class/Request/#newUploadPhotoRequest

You need uses-permission Facebook, try this; https://developers.facebook.com/docs/android/getting-started
After you do this, you need to take method onClick and send the picture directly for facebook, but for this, is necessary the login of user's.

Related

How to share Text between app users after sharing on Facebook

My application is an app for making a travel schedule.
I want to make the app that shares user's schedules.
For this, I tried to simply share text between app users.
Let me explain the steps.
One user shares the app on Facebook to the other. When he shares the app, Text "abc" should be included, not on Facebook, but on the app.
(And I already made Textview to see if it can be sent.)
The other user opens the app on Facebook. Then Text "abc" should be seen on Textview.
I don't even know what keyword I should search.
I tried to use 'intent' and 'action.SEND'. But it doesn't work.
Could you please let me know the steps to do the above function?
Thank you in advance.

Can I publish open graph story in background?

I have android application.
I need to post messages to FB on some user actions.
As I understand from brief documentation read:
I can do it without specific permissions but using FB share popup. User should type some message here
I can publish open graph stories in background. But I need publish_actions permission for that. Also need some confirm popup before publish so that user to be aware of this. But I can set messages I need without ability for user to change text.
Are my assumptions correct?

android facebook sdk publish feed to user's timeline

In my app I need to post certain content on user's timeline. I followed official tutorial given on https://developers.facebook.com/docs/howtos/androidsdk/3.0/publish-to-feed/. But in this tutorial, they've mentioned to set up Login flow first. And they have given a nice guide to do that. That's fine.
But the way I want is, user will be presented with Share Story button only. If user is logged in, story should be posted directly. And if not, normal login flow should be followed asking desired permissions and on login callback story should be published. I don't want to display Login button explicitly.
I stuck on this because in docs, everywhere they've mentioned to use <com.facebook.widget.LoginButton .... /> for login purpose. I don't want to use this at all as this will require user to interact two times. First tapping on Login button and second time to publish story he/she has to tap on Share Story button.
I can't find a way to check if user is not logged in and force him/her to login first from my code block.
It might be a bit late, but this appears to answer your question:
Android - Facebook SDK 3 - How to login programmatically without LoginButton

Picasa - Automatically create profile

I'm programming an Android application which synces pictures to Google Picasa. The problem is that whenever a user wants to upload a picture to his account, but doesn't have the profile created just yet, I get an error about "Unknown user.".
When a visit google picasa web I get the following picture asking me to create a profile:
Then I have to create a profile in order to be able to upload pictures from an Android phone. But the problem is that I don't want this step to be done by every user manually, which isn't a very good user experience, so I'm asking you if there's a way to automatically create a profile.
So I would present a new Activity to a user saying if we wants to create a profile and if he clicks yes, I would automatically send a GET request to do it. My question is the following: is there any such URI that I can use that would automatically create Google Profile when requested.
I found a link like this, but clicking on it sends me to Google+ page where additional stuff is needed.
https://profiles.google.com/me/createprofile/
The developer's guide doesn't say nothing about this problem: http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_protocol.html#CreatingAccount
I guess the other option would be to get the html+javascript+css code of the webpage presented on the picture and showing that in a WebView. The problem is that I can't just use some URL within the WebView, because I also have an OAuth token already and don't want the user to relogin just to create their profile.
Why don't you use Google Sync. Your user already has a Google Account (from market). You could just ask for permission to use his account. Then you can use anything that needs Google account

Choosing default intent in android share app

Hi guys I'm developing an app where in i need to choose an app to share my status.
I'm using something like this
startActivity(Intent.createChooser(Myintent, "Share..."));
But the above line opens a window asking user to select the app to share with.
I want that option to be automated.. precisely I'm looking to update status on google plus..
So I need to start activity which chooses google plus to share...
Im guessing I need the activity name but com.google.android.app.plus opens google plus app but not the page that shares the status... Im looking to prepopulate the status string so that user just have to press send
Have you thought about using the Google plus API? You could send the data via http requests so that you would be able to stay in-app throughout the whole process. I think this kind of solution could be a much smoother experience for the user so they wouldn't have to move in and out of your app in order to accomplish posting to google plus.
Check this answer: https://stackoverflow.com/a/9229654/857583
In this case, call initShareItent("plus");
But you'll have to change the mime type to plain/text or something else.
It is starting the Google+ app, but the recipient or mail address is not filled in unfortunately.
So, EXTRA_TEXT is filled in but EXTRA_MAIl is not.

Categories

Resources