English 中文(简体)
如何在黑莓里发送推特
原标题:how to send a tweet in the blackberry

我想在黑莓里发推特,

我用下面的代码发推特 请建议我

protected class MyBrowserFieldListener extends BrowserFieldListener {
   public void documentLoaded(final BrowserField browserField, Document document  
        throws Exception {
        //Dialog.alert("Loaded");
        if(i==1){
            //Dialog.alert("111");
            String c=OAuth.accessToken();
            //Dialog.alert(c);
            if(c.equals("200")){
                            Token token = new Token(Const.token, Const.tokenSecret);
                Credential cj = new Credential(Const.name, 
                                   Const.consumerKey,Const.consumerSecret, token);

                                           m = UserAccountManager.getInstance(cj);

                if (m.verifyCredential()) {
                                      Const.persistentHashtable.put("Token", l);
                    Const.persistentHashtable.put("Token_Secret",   Const.tokenSecret);
                    Const.persistentHashtable.put("uam", m);
                    try{


                    Tweet t = new Tweet("jomymaratt", "Hi!!! Now I can send DM.");
                        TweetER ter = TweetER.getInstance(m);
                        t = ter.send(t);
                    }
问题回答
Token token = new Token(token, tokenSecret);
Credential cj = new Credential(name, consumerKey,consumerSecret, token);
m = UserAccountManager.getInstance(cj);
  if (m.verifyCredential()
       {
          Tweet t = new Tweet("Hi!!! ");
      TweetER ter = TweetER.getInstance(m);
      t = ter.post(t); 
        } 
    else {
          Dialog.alert("Error");      
          }




相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签