There is
com.sugree.twitter, java me api
I have used Twitter4j
Click on the following link to get source code
http://automateddeveloper.blogspot.com/2011/06/android-twitter-oauth-authentication.html
You should go for Twitter4j OAuth
OAuth is an open protocol which allows
the users to share their private
information and assets like photos,
videos etc. with another site without
sharing their credentials (username
and password) to the latter. Hence
making it very secure way of
transmission of data..
here is link for this...
http://www.xoriant.com/blog/mobile-application-development/twitter4j-oauth-on-android.html
Related
I am trying to get permission to access user's public profile so I can provide a link to this person's profile to other people using an app.
within the api response, we have a "link", but it is a https://facebook.com/... link, and not some intent link like fb://profile/<id>
So how can I create this link without global user id and username?
I also tried to use fb://facewebmodal/f?href=<link> but it redirects me to my own facebook home page (feed)
Thank you!
Dhiogo's anwser is not working anymore. Facebook's API retrieves an user_id when the user authenticates within your application. So all you have to do is use this user_id like this:
fb://facewebmodal/f?href=https://www.facebook.com/profile.php&user_id=[user_id]
This is a closed bug that Facebook didn't fixed: https://developers.facebook.com/bugs/332195860270199
But I could find a solution!!! All you have to do is to get the scoped link that facebook graph api generates (link permission) and replace the https://facebook.com/app_scoped_user_id/ with fb://profile/?app_scoped_user_id/ leaving the rest of the link as it is.
I hope this can help you.
i'm using the Dropbox Core Api for Android.
I want to generate a http-link to private files, so i can place it in text documents.
So the link opens the browser, which handles authentication.
if i browse the webinterface, i get a link like https://dl-web.dropbox.com/get/########?_subject_uid=#####&w=#############
Is there a way to do that with the Android Api?
Shared Links are no solution! (no /shares or /media )
Thanks...
No, the Dropbox API doesn't currently offer anything exactly like what you describe. If you need to access file content from your app, the best way to do so is using the /files (GET) API call, which returns the file data directly:
HTTP docs: https://www.dropbox.com/developers/core/docs#files-GET
Android docs: https://www.dropbox.com/static/developers/dropbox-android-sdk-1.6.2-docs/com/dropbox/client2/DropboxAPI.html#getFile(java.lang.String, java.lang.String, java.io.OutputStream, com.dropbox.client2.ProgressListener)
If you need a link to the data, the next best option is /media:
HTTP docs: https://www.dropbox.com/developers/core/docs#media
Android docs: https://www.dropbox.com/static/developers/dropbox-android-sdk-1.6.2-docs/com/dropbox/client2/DropboxAPI.html#media(java.lang.String, boolean)
The links returned by /media aren't share links, exactly, as they automatically expire after four hours and aren't listed on https://www.dropbox.com/links . Further, calling /media also doesn't automatically make the files non-private, as one would need the (reasonably unguessable) link to access it.
I am trying for a facebook integration on my android application.
My requirement is to read each news feed as and when it comes, and to display it using a toast.
All the sample application I see on net are based on the web GUI.
Can anyone help me with a sample code or hint to read the updates into a variable/string in my application?
Regards,
Dhanesh
using this after login in facebook dialog..
Facebook fb = new Facebook(APP_ID);
String newsfeed=fb.request("me/home");
System.out.println(newsfeed);
for get user news feed....
I'm guessing it's easiest done using Facebook Android SDK (you need permission for your application to access someone's news feed);
http://developers.facebook.com/docs/guides/mobile/#android
And Graph API documentation is a good read too;
http://developers.facebook.com/docs/reference/api/
Maybe there's some better examples but I found those documents rather complete while I was dealing with Facebook accessing.
Check out the Facebook API at http://developers.facebook.com/
Have you looked at facebook's owns api. Mobile Apps. If they don't have a solution on getting new news, then theres probably no clean api to get news an you have to turn to a scrape api or write your own scrape functions.
I would like to integrate Twitter into my Android application so that I can post messages to Twitter.
It really depends on how you want the interaction to work. You can:
Use their API (helped by a library such as twitter4j, as suggested by Heiko Rupp), or
Find a way to integrate with the Twitter app, although there is no published protocol for this as far as I know. This is also not a good idea because many people use other apps such as Twidroyd, TweetDeck and so on, but it would definitely be cool, or
If you don't expect the user to do this very often, you can just open up http://twitter.com/?status=<what-to-tweet> using a simple intent.
Method 3 can be easily described here:
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("http://twitter.com/?status=" + Uri.encode(message)));
startActivity(i);
You can also combine 2 and 3. You can try a few known apps (official Twitter, TweetDeck, ...) and if all of them fail (because they're not present or because they have been updated and broke the protocol) you resort to opening up the browser.
Also note that it might be possible for method 3 to actually launch an app instead of the browser (or at least give the user a choice between the two), if the app handles the correct intents.
Another thing worth mentioning is that it's very possible that you will not be able to integrate with any Twitter apps. What I've said here is purely hypothetical, I have no idea whether these apps support such integrations. You should consult each app and see if they expose some intents that you could use. If they don't, you can still hack around a little and you might find them, but that will be unreliable because they will most probably break after a couple of updates.
You could use the twitter4j library to talk to twitter. Since Twitter has changed over to oAuth, the initial authentication is not trivial.
Basically you need to register your app with Twitter (go to your profile and then to the developer page to register your app - you will then get consumer token+secret). Then follow this example to authenticate with Twitter.
You may have a look at Zwitscher (rev 0.65, code of oAuth has not been updated for the nw internal changes after 0.65), which is an open source Twitter client for a larger example.
You may have a look at one of my examples of how to get Sign-in with twitter working on android.
It uses twitter4j, and with slight modification, you can make it post tweets too!
find it here.
UPDATE: there's one question specific to this issue: twitter,update status
I use twitter4j and oauth-signpost to create facebook like oauth authorization (webview dialog). Checkout this post
You can send the appropriate Intent to start the default twitter application
You can do this without Twitter4j, thus avoiding the massive headache of implementing the OAuth flow.
String tweetText = "We be tweetin!";
String url = "twitter://post?message=";
try {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url + Uri.encode(text)));
startActivity(i);
} catch (android.content.ActivityNotFoundException e) {
Toast.makeText(this, "Can't send tweet!", 2).show();
}
Other supported twitter:// urls are listed here.
If the user has the Twitter App installed on their device it'll open it directly to a share view. When cancelled or shared it'll return direct to your App. Super simple. Similar to how iOS handles sharing now (with Facebook and Twitter integration).
This doesn't handle cases where the user uses another App as their primary Twitter client.
I can't get Oauth to work with Twitter. I have tried the following (all result in the same 401 error):
jTwitter (using the default OauthSignpostClient)
jTwitter using the commonshttp library (CommonsOauthProvider) instead of the "DefaultOauthProvider"
jTwitter using the OauthScribeClient (instead of the OauthSignpostClient)
oauth-signpost (by itself... no jTwitter)
Twitter4J
http://code.google.com/p/agirardello/
http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/
http://github.com/kaeppler/signpost-examples/blob/master/OAuthTwitterExample/src/TwitterMain.java
I've tried my own implementation and copy/pasted the sample code from each of the sites, and nothing seems to work. I'm also 100% sure I also downloaded and included any dependencies (where needed).
Here's the interesting part. Using jTwitter and the oauth-signpost library, I can initiate a connection to Twitter, open a browser window for the user, have them log-in and generate a PIN for my app. When the app goes to post a status update however, (using the pin, and the stored access token and token secret), the 401 error pops up. All other things I've tried won't even let me open a browser window and ask the user to generate a PIN (they die with the 401 error on the request for the "request token").
Please help. Thanks
I don't know if it will help you much with Android, but this post on Twitter OAuth by Chris Shiflett just came up on my interwebs.
First of all for OAuth you need to register your application with twitter I am assuming you have registered it. Now in case of desktop and mobile application you need request twitter for custom callback URL, as default callback url just works only for web apps. Once twitter approves requested call back URL , it will work .
But there is workaround, rather than OAuth request twitter for xAuth by submitting details of your applications. Then if twitter approves it , you can uses xAuth which works almost similar to OAuth.
Make sure your application had read&write access when you created it....