【问题标题】:How to tweet using Android app?如何使用 Android 应用发推文?
【发布时间】:2011-06-17 02:16:48
【问题描述】:

在我的应用程序中,我需要发布推文,我该怎么做?我找到了一个 jar,但它的构造函数已被弃用。

【问题讨论】:

标签: android twitter tweets


【解决方案1】:

只需使用 [SEND Intent][1],这样您的用户就可以决定他们想对您的消息做什么:

Intent shareIntent = new Intent(    android.content.Intent.ACTION_SEND);
 shareIntent.setType("text/plain");
 shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,”Sharing info");
 shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ”is very easy this way”);
startActivity(Intent.createChooser(shareIntent, ”Share Track"));

【讨论】:

    【解决方案2】:

    如果您只需要发帖;然后是上面显示的链接; twitter4j 和 Winterwell 就足够了。

    否则你需要看看 OAuth,这很痛苦。那是推特(以及 facebook 和 LinkedIn 等)确认用户和密码的“新”方式。

    http://apiwiki.twitter.com/w/page/22554657/OAuth-Examples 在这种情况下会很有用。

    祝你好运,玩得开心! :)

    【讨论】:

    • 如果你只需要发帖,发intent是最好最轻松的方式!
    【解决方案3】:

    您可以发送appropriate Intent: 请求ACTION_SEND,然后根据已知应用程序包列表限制符合条件的意图。

    【讨论】:

    • 你能在这里发布一个摘要而不是一个指向你博客的链接吗?
    猜你喜欢
    • 2011-08-10
    • 2012-05-20
    • 2014-02-21
    • 2013-07-06
    • 2011-05-10
    • 2012-05-19
    • 1970-01-01
    • 2011-06-17
    • 2013-09-20
    相关资源
    最近更新 更多