当前位置: 动力学知识库 > 问答 > 编程问答 >

twitter - Sharing a tweet in Android

问题描述:

I'm developing an Android Application and I want to publish a tweet in twitter. My problem is that I don't know how I do to create a tweet in an android app. I searched for information and I find two possible libraries that may be good for tweet content, the libraries are JTwitter and Twitter4J. When I search the information too people say that OAuth it's difficult, and I don't understand nothing of the OAuth.

If it's possible I want to share an image with the tweet, the image can be a Bitmao object?

And, how I do to insert in the predeterminated tweet this image?

Thanks for the time spended

网友答案:

I've personally used Twitter4J with great success. However, there is an easier way to share that will open your app up to many more social networks.

You can use a share Intent. This blog has a great tutorial that walks you through every step. To include an image, you would use sharingIntent.putExtra(Intent.EXTRA_STREAM, uri), where uri is the path of the image on the device (content URI or a direct file path).

网友答案:

The best way that i found to solve this problem is using a sharing intent. In the next link you will have another question with this solution, the only problem is that only work with the official client of twitter.

How to force Share Intent to open a specific app?

So, with that code you will be able to publish the tweet you want using the twitter client.

分享给朋友:
您可能感兴趣的文章:
随机阅读: