Twitter API in android - android

I'm a beginner of android and reading a book on android and found that code snippet there
twitter = new Twitter("student", "password");
twitter.setAPIRootUrl("http://yamba.marakana.com/api");
All the post I tweet goes to the site yamba.marakana.com but I don't want to see my twits in that marakana site, I want to post those directly to my twitter account(changing the "student" and "password" field ).
How can I do that? Is it a problem of APIRoouUrl? If yes then let me have the correct URL for the setAPIRootUrl() method.
By the way, I'm using jTwitter API from twitter in Android. Thanks in advance for the repliers :)

I followed the video series of the book on Youtube. He mentioned that if you want to post to the actual Twitter site, you have to submit some sort of form to Twitter as a developer for them to give you the proper information. Also, Twitter's API is probably a bit different from that of jTwitter, so it's probably not a good idea when you're just starting to learn.

Related

Android - facebook automatically post

I want to integrate an android app with facebook.
I've managed to fetch friends list and to post on wall on demand (a facebook url view is loaded and the user can post on wall whatever he texts).
I want, when the app is started and the user accepts the permisions, to post a message on wall that he is started to play my game without showing that url view for posting (an automatically post)
Can someone help me?
It's probably late and maybe you've got your answer for this question.
But for anyone else who need an answer:
First, you can use the Graph API, there is an example of how to post on
a wall.
But there is a restriction!!
Facebook is not allow us to enter a prefiil message!
The content of this message must come from the user itself!
Watch this video of Facebook on Platform Policy 2.3 Example and Explanation

Upload photo on friend/fan page with Android

I want to upload a foto from my android app to a facebook fan page using the facebook API.
When i look in the hackbook android example app (link). the code looks as following to a upload photo:
Bundle params = new params.putString("url",
"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg"); params.putString("caption",
"FbAPIs Sample App photo upload");
Utility.mAsyncRunner.request("me/photos", params,
"POST", new PhotoUploadListener(), null);
This code works, it posts the photo on my own facebook page. But i don't want the photo to be posted on my page but on a fan page.
As explained in the facebook documentation 'me' could be changed with a facebook User_ID. I tried changing the "me/photo" in "[fanpagename]/photo" or "[fanpageID]/photo", but that did not work. when i used the username i got an error, when i used the ID it post the photo on my own page. In the graphAPI photo documentation (link) no example or explanation is givin on how to upload a foto on fan page.
also the
params.putString("to", [fbid]);
does not work.
Any suggestions?
I have been busy with this research for three full days and did not find the answer for my problem. But i think i have an explanation for it.
if a user posts a photo to friend/fan_page with the official android FB app it uses a "feed" with a picture(url-link). The user can't see on his own wall that he actually shared or posted a picture on the friend/fan_page. (for example: "Bob - posted a photo on CocaCola")
This is probably the reason why the function is disabled because developers could use this to send photo's to all kinds of friends/fan_pages without the user being aware of it.
I came to this hypotheses because i found a sort of work around. First upload the photo to users own album. get the URL of that photo and then post a "feed" on the friend/fan_page with a picture(url-lnk). Facebook then gave this error: "FBCDN image is not allowed in stream" in other words, you can't use photos that are on FB website domain to link to. So I think there is quite a bug/lazyness in the facebook developement departmet :P which is a pity because it is a nice socialnetworking function for mobile apps.
You are on the right track, but to publish photos to a Page you will need the publish_stream and manage_pages permissions, and the Page Access Token to prove you have them. You can read more about this here:
http://developers.facebook.com/docs/reference/api/page/#photos
http://developers.facebook.com/docs/reference/api/page/#page_access_tokens
Some example code (using the PHP SDK, but the logic should be the same in any language) is here: https://stackoverflow.com/a/7222078/164439
Update:
If you want to post to the Page's Wall/Feed (without being a Page Admin), you can do that without the Manage Pages permission and the Access Token stuff.
But it's different than publishing a Photo object to the Page's Photos collection, which is what I thought you asked. You actually want to do a regular Post to the Page, with a Picture attachment.
Here are some resources to do this:
Facebook Post API: http://developers.facebook.com/docs/reference/api/post/
http://facebook.stackoverflow.com/questions/691425/how-do-you-post-to-the-wall-on-a-facebook-page-not-profile
http://facebook.stackoverflow.com/questions/5756474/post-to-facebook-page-wall
Using Facebook Graph to simply post a wall message with just javascript
Good luck!

By Using Facebook Graph API, How to read Facebook wall?

I am using the facebook API in my app, i know how to post message on wall. my requirement is, i want read the wall information of user recent status information through code .
How can i achieve this...
for example. from my facebook account i want to get the latest status information.
Here's a great example of using the GraphAPI to do that
https://graph.facebook.com/me/feed?access_token={}
Try it out here: https://developers.facebook.com/tools/explorer
EDIT
I stumbled across this the other day. There's a connection from the user object called statuses, which filters the stream even more than feed. As with many graph calls, you can add ?limit=N to limit the result set. So this new way I discovered would look like:
https://graph.facebook.com/me/statuses?limit=1&access_token={}
You should use a third party API such as Easy Facebook SDK. It allows you to do what you are trying to do with ease.
U should check it out here:
http://developers.facebook.com/blog/post/385/

Facebook news feed reader on android

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.

Twitter Application-android

I am new to twitter .I like to develope one twitter Application. Can anyone tell me:
The methods to be used for replying the tweets.
How to retweet with userID in arraylist
you can use OAuth for your twitter application. You can refer to these links to learn how to make calls using the same
Android: Twitter and OAuth anyone?
http://www.devx.com/webdev/Article/40511/0/page/1
http://blog.sogeti.com/mobile/2010/03/twitter-oauth-for-android.html
http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/#awp::2009/07/16/android-oauth-twitter-updates/

Categories

Resources