Android Twitter4j - android

I want to create a application where user can login with twitter account and whatever activity he does (depending on other cases) should be tweeted.
Now since twitter has removed basic authentication how to achieve this ????
Any help will be appreciated

You can use third party libraries to perform OAuth. See the following threads to get some insight on OAuth and how to perform 3 legged authentication:
1. Some questions about OAuth and Android
2. OAuth on Android
3. OAuth + TWitter on Android with code
Hope that helps...

Related

Does Twitter support OAuth 2.0?

I want to integrate Twitter with my Android application. Can I do this using OAuth 2.0?
I have searched the internet but couldn't find any good explanation regarding this. If anyone has done this before, can you please guide me through this. I saw in a old post here that Twitter doesn't support OAuth 2.0.
Basically, no, Twitter still uses OAuth 1.0a for most parts of their backend. Since march however, they support the OAuth 2 client credentials flow for application-only authentication.
This means, if you:
have an application that only shows tweets from other users or stuff like that, you can get authorized using OAuth 2.
want any users to use your app to post tweets or do anything else on a user's behalf, you have to struggle with OAuth 1.0a.
You should check out the Twitter4J library, which abstracts most of the OAuth 1 hassle away from you.
This might be of interest:
"... we're releasing our application-only authentication scheme, based
on the OAuth 2.0 client credentials flow."
Posted to dev.twitter 2013-03-11 https://dev.twitter.com/blog/application-only-authentication (current: https://blog.twitter.com/developer/en_us/a/2013/application-only-authentication.html)

How to use Facebook OAuth within Android native?

I'm using official Facebook Android SDK to integrate Facebook to my application. When it comes to authorize, the SDK use a custom dialog with Webview in it, loading facebook login page for user to enter username & password, this sounds OK.
However, when reading javadoc for the method "authorize" in Facebook.java (in the SDK package), I found that "Note that User credentials could be handled natively using the OAuth 2.0 Username and Password Flow, but this is not supported by this SDK"
How can I achieve this ?
Thanks in advance
Hum, I have not used the Facebook SDK yet, but I already coded communications with webservices based on OAuth 2.0 for the credentials; so my answer will not deal with Facebook specifically but with OAuth 2.0.
What you need to communicate with an OAuth webservice is first to get a token, in order to get it you need to give to the webservice your private developer key & password & your clients password & login.
I think that it is exactly what your documentation is talking about.
Note that good webservices provide an already written wrapper in order to do not have each developper rewritting the same wrapper.
If you need a wrapper example, look at Soundcloud Official Wrapper on github.

Facebook SSO, Android and authentication against Google App Engine

I followed the tutorial here: https://developers.facebook.com/docs/mobile/android/build/#enablesso
I am able to authenticate on the android side, but what I want to do is to use SSO or some sort of authentication using facebook [preferrably OAuth] to authenticate against my web application on GAE. I expect it to work something like this: blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app
This is the sort of flow I expect:
The user starts my app, and is prompted with an option to authenticate to FB.
The FB app/web dialog opens and asks the user to confirm permissions to be given to my app.
Once that is done, FB provides me with a cookie [or something similar].
I use that cookie for subsequent requests to my web service, where I can get the username simply using:
user = oauth.get_current_user()
user.nickname()
Is anything like this possible? The problem I face is that while performing SSO, there is no place where I specify an OAuth end point. GAE provides OAuth endpoints [http://code.google.com/appengine/docs/python/oauth/overview.html], which I think I should be using. Any clue as to how I can proceed about this?
Any help is appreciated. Regards, rohan
You need to implement the server-side authentication flow: http://developers.facebook.com/docs/authentication/
I implemented it in Java: see the LeanEngine oss project. You could probably reuse the android client part: the login dialog.

twitter in android

Is there any SDK of Twitter available through which we can implement Twitter in our application? I want that my application would load on his/her Twitter account and then the tweet should be sent to his/her account, but I cannot find any simple examples.
Something like the Facebook Android SDK is what I'm look for.
You can use twitter4j. This site also contains some usage examples.
Unfortunately with the introduction of oAuth, login is no longer trivial. You have to register your application with Twitter (go to your account, then applications and add the app there). This will give you a consumer key/token pair, that you need for logging in and that you need to keep secret.
I've implemented this in my Android-Client called Zwitscher.
You can have a look at the Login procedure in the LoginActivity (of the v0.65 tag).
If you just want to post a tweet to twitter, use the Android SEND Intent. That way, the user can choose what he want's to do with the post himself. It's much easier for you as well. No worrying about OAuth etc.
As #Heiko said, twitter4j is quite good. You should use it.
For an example of how it works, I have created a simple sample app that can be found here.
Check that out, maybe it helps you.
AFAIK there is no sdk provided for twitter. You can however use XAUTH for twitter.
It is fairly easy to implement it.
This post might be able to help you.
xAuth Authentication for Twitter Share in Android?

twitter oath authentication android

i am developing app.its having post message on facebook and twitter.i searched on net and got many example but i confused with twitter.
if i am using oath authentication how should i provide login screens for clients.many example
what i found just they are using consumer and secret key where i need to pass uname,pword
can you pl suggest me its very urgent to me
Thanks in advance
Aswan
Twitter using oAuth at present, so whatever api's you will get, they will open the official twitter login page in webview, so you cannot use your own login page for that, twitter does not want's that........Hope it help's youGood luck.......
I've done this using a WebView (to hold the login UI which comes from twitter.com) and Signpost for the OAuth authentication. There's a good example here.
However, this turned out to be a less than brilliant mobile user experience - WebView login screens just suck - so I switched to using XAuth instead of OAuth, which you have to apply to Twitter for. The benefit of doing that is that you can have your own custom login UI, which isn't web-based. Unfortunately Signpost doesn't yet support XAuth so I also changed to using a stripped-down version of JTwitter.
If you are interested in using Singpost and Android's HttpURLConnection to obtain access token based on username and password you can have a look at my post. I was referring to Twitter XAuth so that's should be what you looking for. It works for me.
http://3citydev.blogspot.com/2013/05/how-to-obtain-xauth-access-token-using.html

Categories

Resources