Don't post Tweet using the API Twitter ME v 1.8

Hello..
I'm doing with Twitter blackberry application...

I followed the examples of code given by David Mourao Jr...

I tried to send the new tweet after the connection, but it did not work...

Here is the code:

package com.twiter;

import java.io.IOException;

import impl.rim.com.twitterapime.xauth.ui.BrowserContentManagerOAuthDialogWrapper;
import impl.rim.com.twitterapime.xauth.ui.BrowserFieldOAuthDialogWrapper;
import net.rim.device.api.browser.field.BrowserContentManager;
import net.rim.device.api.browser.field.RenderingOptions;
import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.TextField;
import net.rim.device.api.ui.container.MainScreen;

import com.twitterapime.rest.Credential;
import com.twitterapime.rest.TweetER;
import com.twitterapime.rest.UserAccount;
import com.twitterapime.rest.UserAccountManager;
import com.twitterapime.search.LimitExceededException;
import com.twitterapime.search.Tweet;
import com.twitterapime.xauth.Token;
import com.twitterapime.xauth.ui.OAuthDialogListener;
import com.twitterapime.xauth.ui.OAuthDialogWrapper;

public class TestTwitter extends UiApplication {

    public TestTwitter() {
        // TODO Auto-generated constructor stub
        pushScreen(new BrowserFieldScreen());
    }

    public static void main(String[] args) {
        // TODO Auto-generated method stub
            TestTwitter app = new TestTwitter();
            app.enterEventDispatcher();
    }

}

class BrowserFieldScreen extends MainScreen implements OAuthDialogListener {
    private final String CONSUMER_KEY = "consumer key";
    private final String CONSUMER_SECRET = "consumer secret";
    private final String CALLBACK_URL = "call back url";

    public BrowserFieldScreen() {
        setTitle("Twitter API ME - OAuth");
        BrowserContentManager myBrowserField = new BrowserContentManager(0);
        add(myBrowserField);
        //
        OAuthDialogWrapper loginWrapper =
            new BrowserContentManagerOAuthDialogWrapper(
                myBrowserField,
                CONSUMER_KEY,
                CONSUMER_SECRET,
                CALLBACK_URL,
                this);
        //
        loginWrapper.login();
    }

    public void onAuthorize(Token token) {
        System.out.println("onAuthorize: " + token);
        //
        String name = token.getUsername();
        Dialog.alert(name);

        Credential c = new Credential(CONSUMER_KEY,CONSUMER_SECRET,token);
        UserAccountManager m = UserAccountManager.getInstance(c);

        try {
            System.out.println(m.verifyCredential());
            if (m.verifyCredential()) {
                //user authorized!
                TweetER.getInstance(m).post(new Tweet("I can tweet!!!"));
                Dialog.alert("AA");
            }
        }
        catch(Exception e){
            Dialog.alert(e.getMessage());
            Dialog.alert("FAILED");
        }
    }

    public void onAccessDenied(String message) {
        System.out.println("access_denied: " + message);
    }

    public void onFail(String error, String message) {
        System.out.println("error: " + error + " message: " + message);
    }

}

I found in the page url call... But there is no new tweet on twitter account...
Someone knows the solution?

Hello

A week back, I met the same problem when you use v 1.8 because some changes by Twitter, so after changing total API to v1.9 they it works.

I think that you get an IOException is right?

Kind regards

Lakshman K

Tags: BlackBerry Developers

Similar Questions

  • How to connect from Twitter (using the API of Twitter ME v 1.9)?

    Hello..

    I am doing an application with twitter and I use the API Twitter ME v1.9

    I am already able to post tweet with her... But is it possible to log on to the twitter application?

    Kind regards

    Eric

    Why not.. When you save the access token. You use any file Storetoken.java for the registration of access token. You can have a method to clear the access token...

  • How to create VI execution asynchronous step using the API

    I want to create a "run way asynchronous step VI" using the API TestStand in LabVIEW.

    Navigation on the details of the step and the properties of the object, apparently, that it is a type of 'special' step that is actually a SequenceCall.  However, I don't see how to access the data contained in this type of step.  I enclose my current VI used to 'Browse' the data for reference.

    Please advise on how to create this step.

    Thank you

    Hey LVB,

    I'm sorry, I didn't know that you always wanted to use the "Use the Prototype sequence" checkbox option.  In this case the attached code should demonstrate how this can be accomplished.

    Thank you

  • Object LVOOP read/write using the API TestStand

    Is it possible to read/write a LVOOP object to a variable TestStand from LabVIEW using the API of TestStand?

    SetPropertyObject() takes a green wire reference, which is incompatible with an LVOOP object.  SetValVariant(), SetValIDispatch(), and SetValInterface() seems to just write a value null of type variant.  I don't know if I use the wrong API function or if it's just not possible.

    Hi jsiegel,

    That's right, it is not quite possible to what I believe, it is your intention. As mentioned, TestStand cannot create the object of LabVIEW. To make and use references of LabVIEW with TestStand, you need LabVIEW out this reference, which may then store it TestStand as an object reference. For VI requiring the obeject LabVIEW as an input, the registered object reference can be passed in. To make calls to LabVIEW classes using the class member call with a step of the VI Action instead of the call to VI for the Type.

    Of course, you need both LabVIEW and TestStand 2012 or newer in order to use these functions.

    Kind regards

  • Unable to create the pool of IP required for configuration VXLAN using the API REST NSX

    Basically, I want to configure VXLAN using the REST API. To set up VXLAN, VMKNic IP addressing accepts DHCP or IP Pool. I decided to go with Pool of IP.

    To create a Pool of IP "NSX-DEV-IPPOOL-01', I used the REST APIs.»

    POST https:// < nsx - ip > /api/2.0/services/ipam/pools/scope/ < id data center >

    < ipamAddressPool >

    < name > NSX-IP-POOL-02 < / name >

    < LG > 24 < / LG >

    < gateway > 10.99.134.1 < / gateway >

    Lab.local < dnsSuffix > < / dnsSuffix >

    < dnsServer1 > 10.99.134.2 < / dnsServer1 >

    < dnsServer2 > < / dnsServer2 >

    < Plages_ip >

    < ipRangeDto >

    < startAddress > 10.99.134.225 < / startAddress >

    < endAddress > 10.99.134.229 < / endAddress >

    < / ipRangeDto >

    < / Plages_ip >

    < / ipamAddressPool >

    Now I can see the Pool of IP in vCenter under NSX Manager-> [NSX-Manager-IP]-> manage-> object-> Pools of IP group.

    nsx_ipPools.png

    But when configuring VXLAN, no IP pool is present.

    nsx_configurev_xlan.png

    Y at - it all the additional steps required after the addition of pool of IP using the REST API?

    Thanks in advance.

    Remove the existing IP pool.  Then recreate the pool by using the API, but instead of using with globalroot-0.

  • Set the signature using the API field only

    I have a situation where all PDFs you signed are created for each customer individually and on the fly.

    I must be able to define the scope of the signature using the API only.

    Is this possible? I can't change the pdf file and add any kind of labels. It must be done using an x, the value of the coordinate y.

    Hello Lawrence,.

    If you are looking to set the fields of the form through the API, you can see below reference material:

    https://secure.NA1.echosign.com/public/docs/EchoSignDocumentService21#FormField

    Kind regards

    -Usman

  • How to use the API of the IOM in Self Service identity custom region

    Hi all

    I developed a custom in Self Service identity using this guide area: customization of the Interface - 11 g Release 2 (11.1.2.1.0)

    Inside this area, I have a simple form that allows the creation of users. This form uses the API of the IOM, in particular the following line:

    UserManager usermgr = Platform.getService(UserManager.class);
    

    The error I got is:

    < error > < oracle.iam.platform.utils.SpringBeanFactory > < BEA-000000 > < parsin instantiation Spring Bean Factory Failed.IOExceptiong XML document resource path of class [META-INF/iam-spring-config. XML]; nested exception is java.io.FileNotFoundException: resource path of class [META-INF/AIm-spring-config.] XML] could not be opened because there is no >

    I use it because I think that I am inside the ISS. For this reason I don't want to use the client method to retrieve the UserManager (which obviously works):

            String ctxFactory = "weblogic.jndi.WLInitialContextFactory";
            String serverURL = "t3://" + HOSTNAME + ":" + PORT;
            
            Hashtable env = new Hashtable();
            env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, ctxFactory);
            env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, serverURL);
            
            OIMClient oimClient = new OIMClient(env);
            try {
                oimClient.login(OIM_USERNAME, OIM_PASSWORD.toCharArray());
            } catch(LoginException e) {
                e.printStackTrace();
            }
            UserManager usermgr = client.getService(UserManager.class);
    

    It is possible to use the UserManager methods in this case?

    Thanks in advance for your help.

    Manual

    Solved.

    Just replace

    UserManager usrmgr = Platform.getService(UserManager.class);
    

    with

    UserManager usermgr = OIMClientFactory.getUserManager();
    

    Manual

  • How to use the API to perform a "Power on and Force Recustomization" 1.5?

    With the help of VMWare vCloud Director, when the virtual machine is turned off, I have the menu ' power on and Force Recustomization "to turn on the machine and do some recustomization work such that reset the administrator password.

    However, I can't do this using the API. The vm/vapp. PowerOn() has no parameters. The vm/vapp. Deploy (true, 0, true) can (re) deploy the vm/vapp and plugged. But the recustomization never runs.

    My code can update the section "customization of the OS invited." I can see it in vCloud Director. And then if I manually ' power on and Force Recustomization ", the machine will be powered on to reset the password. But if I use the above codes, none of them works. So, I conclude that the problem occurs in the sending of the statement of "Power on and Force Recustomization ' using the API.

    Any help will be evaluated.

    Ref:

    http://communities.VMware.com/message/1691773

    http://communities.VMware.com/message/1837194

    http://communities.VMware.com/message/1805142

    http://communities.VMware.com/message/1844513

    Hello

    To perform the PowerOn + ForceCustomization option in the UI by using the API.

    Perform the same operation of the virtual machine deployment.

    Ex: POST - api/vApp/vm-uuid/action/deployment

    XML MESSAGE

                          http://www.VMware.com/vCloud/versions"xmlns:ns6 ="http://www.vmware.com/vcloud/v1.5"powerOn ="true"forceCustomization ="true"deploymentLeaseSeconds ="10000"/ >"

    Using Java SDK - use of the virtual machine-> deploy();

    Make sure that the customization of the comments is enabled on the virtual computer.

    Make sure that the deployment - forceCustomization and powerOn settings are set to true;

    Kind regards

    Rajesh Kamal.

  • Send out notifications by using the API in r2

    guys,

    I want to send an e-mail notification using the api and unathenticated service in case of forgotten password.

    Please give me some code for this snippet.

    I don't think it's possible to send the notification by using service unauthenticated.

    To send notifications by e-mail, you need to connect to oimclient with a user id other wise notification can be sent.

  • Utility that uses the API of HFM

    Hello

    I want to create a utility, using the HFM API, in c# that runs from repetitive consolidation and extraction tasks.
    I think I need to install professional all HFM so apart from the SDK.

    If so, I'm looking for 2 things now
    1. where can I download the SDK from
    2. where can I download the HFM customer since and do I need anything else apart from these 2 to create and run my utility.

    My machine is running * 64-bit Windows 7, and our HFM server is version 11 *.

    A correct link would be appreciated, I'm looking at edeliver.oracle.com but I can't find good versions for each of them.

    Thank you.

    The link is for a c# .NET application that will show you how to use the API. Even if you don't use immediately, you can consult the source code for clue you on how to work with the API.

    Personally, I think the rule of no-3 rd party is silly something like that, because the source code is included and you can change/see exactly what it does. (Basically just call the appropriate API) I understand also is probably not your rule so that the comment is not intended to you by itself.

    In regards to what you install, start here:

    http://docs.Oracle.com/CD/E17236_01/NAV/portal_1.htm

    Look at the beginning of the Installation here and installation and configuration guides. (epm_insatll_start_here_11121.pdf and epm_install_11121.pdf respectively)

    The cliff notes, is that you have to make the installation package:

    Oracle Hyperion Enterprise Performance Management System install, version 11.1.2.1.0 for PlatformName Fusion
    Oracle Hyperion Foundation Services output 11.1.2.1.0 for PlatformName part 1 of 7
    Oracle Hyperion Foundation Services output 11.1.2.1.0 for PlatformName part 2 of 7
    Oracle Hyperion Foundation Services output 11.1.2.1.0 for PlatformName part 3 of 7
    Oracle Hyperion Foundation Services output 11.1.2.1.0 PlatformName part 4 of 7
    Oracle Hyperion Foundation Services Release 11.1.2.1.0 part 5 of 7
    Oracle Hyperion Foundation Services Release 11.1.2.1.0 part 6 of 7
    Oracle Hyperion Foundation Services Release 11.1.2.1.0 part 7 of 7

    * NOTE: All files are on delivery and where we see PlatformName you should replace it with the platform type (e.g., x 86, x 64, etc.)

    In addition, you have the following modules to install the financial management Client:

    Financial Management Client
        Required Assemblies
            l commonComponents
            l hfm_client
            l hfm_common
        Required Download Files
          l Oracle Hyperion Foundation Services Release 11.1.2.1.0 for PlatformName Part 1 of 7
          l Oracle Hyperion Financial Management, Fusion Edition Release 11.1.2.1.0
    

    Hope that helps.

    Published by: beyerch2 on April 11, 2012 09:13

  • How to get the role name of the OIM 11 g using the API

    Hello
    I have a scenario in which I create role/group of OIM 11 g & she gets supplied with AD [= works great] & other party it is when I remove role in OIM 11 g then it should
    removed from the AD. I wrote the postprocess event handler to achieve this goal.
    In the authoring part of role I get all the parameters by using "orchestration.getParameters ()"; but when I delete the role then "orchestration.getParameters ();" is empty, so I'm
    Unable to get the name of the role.
    Is there a way to get the role name when you remove roles by using the API?

    Thank you
    Rahul Shah

    Hello

    To implement using pre-wet the handler rather post-processing.

    Kind regards
    Ralu

  • How to use the API of PL/SQL DBFS

    Hi guys,.

    I re-post this question to see if someone can help out me. I'm trying to use the API of PL/SQL DBFS to manipulate the files stored in DBFS.

    Details of the environment:
    Windows 7 or 5.5 OEL (I tried both platforms)
    Database: Oracle DB EE 11.2.0.2
    IDE: SQLDeveloper on Windows 7

    I have two users, DBFS_USER, who is the shop owner DBFS and MYUSER that connects to the store to manipulate files using the API of PL/SQL DBFS.

    Creation scripts:
    -----------------
    Connect / as sysdba;

    Dbfs_ts CREATE TABLESPACE DATAFILE 'D:\oracle\oradata\orcl\dbfs01.dbf' SIZE 1 M AUTOEXTEND ON NEXT 1 M;

    -create users
    create dbfs_user user identified by dbfs_user quota default tablespace unlimited dbfs_ts on dbfs_ts;
    create myuser identified by myuser;

    -grant the role
    GRANT RESOURCES, CREATE VIEW, CREATE SESSION, DBFS_ROLE, CREATE TABLE TO dbfs_user.
    GRANT RESOURCES, CREATE VIEW, CREATE SESSION, DBFS_ROLE, CREATE TABLE TO myuser.

    -create a filesystem (such as DBFS_USER)
    connect dbfs_user/dbfs_user;

    exec dbms_dbfs_sfs.createFilesystem ('STAGING_AREA_FS');

    exec dbms_dbfs_content.registerStore ('STAGING_AREA_FS', 'posix', 'DBMS_DBFS_SFS');

    dbms_dbfs_content.mountStore exec ('STAGING_AREA_FS', 'staging_area');

    commit;

    -export store STAGING_AREA_FS (as DBFS_USER)

    exec dbms_dbfs_sfs.exportFilesystem ('STAGING_AREA_FS');

    -Check the names of table (like MYUSER)
    connect myuser/myuser;

    -He can't see (without brackets)
    Select * from table (dbms_dbfs_content.listMounts);

    -Note at the bottom of the table table_name
    Select * from table (dbms_dbfs_sfs.listTables);

    -Mount as MYUSER (example with SFS table_name $ _FST_32)
    dbms_dbfs_sfs.registerFilesystem exec ('MYUSER_FS', 'DBFS_USER', ' FS$ _FST_32');

    exec dbms_dbfs_content.registerStore ('MYUSER_FS', 'posix', 'DBMS_DBFS_SFS');

    dbms_dbfs_content.mountStore exec ('MYUSER_FS', 'staging_area');

    commit;

    -verification of Mount (like MYUSER)

    Select * from table (dbms_dbfs_content.listMounts);

    Select the path in dbfs_content;


    CREATE a STORED PROC (like MYUSER)
    ----------------------------

    CREATE OR REPLACE PACKAGE MYUSER_PKG

    CreateDirectory function
    (P_File_Path IN VARCHAR2,
    P_ErrMsg OUT VARCHAR2)
    return number;

    END MYUSER_PKG;

    /


    CREATE OR REPLACE PACKAGE BODY MYUSER_PKG

    CreateDirectory function
    (P_File_Path IN VARCHAR2,
    P_ErrMsg OUT VARCHAR2)
    Return number
    IS
    l_Return NUMBER;
    l_props DBMS_DBFS_CONTENT. PROPERTIES_T;
    BEGIN
    l_Return: = 0;

    () DBMS_DBFS_CONTENT.createDirectory
    path = > P_File_Path,
    Properties = > l_props);

    RETURN l_Return;
    EXCEPTION
    WHILE OTHERS THEN
    l_Return: = NVL (SQLCODE,-1);
    P_ErrMsg: = SQLERRM;
    RETURN l_Return;
    CreateDirectory END;

    END MYUSER_PKG;

    /

    When you compile the package, I get this error:
    Error (9,11): PLS-00201: identifier 'DBMS_DBFS_CONTENT' must be declared
    Error (9,11): PL/SQL: ignored element
    Error (13.3): PL/SQL: statement ignored
    Error (15,19): PLS-00320: the declaration of the type of the expression is incomplete or incorrect

    How can I solve the problem in the error message? I'm not an expert in DB. I used this reference documentation: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e18294/adlob_client.htm#CIHDEJAA

    Thanks in advance.

    CAPPA

    You must directly grant the privileges of DBFS_ROLE because roles are not enabled in stored PL/SQL:

    SQL> select* from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    SQL> show user
    USER is "SYS"
    SQL>
    SQL> create user myuser identified by myuser;
    
    User created.
    
    SQL> GRANT CREATE SESSION, RESOURCE, CREATE VIEW, DBFS_ROLE, CREATE TABLE TO myuser;
    
    Grant succeeded.
    
    SQL>
    SQL> begin
      2  for x in (select privilege, table_name
      3           from dba_tab_privs
      4           where grantee='DBFS_ROLE')
      5  loop
      6   execute immediate 'grant ' || x.privilege || ' on ' || x.table_name
      7   || ' to myuser ';
      8  end loop;
      9  end;
     10  /
    begin
    *
    ERROR at line 1:
    ORA-22812: cannot reference nested table column's storage table
    ORA-06512: at line 6
    
    SQL>
    SQL> connect myuser/myuser
    Connected.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE MYUSER_PKG IS
      2  Function CreateDirectory
      3  (P_File_Path IN VARCHAR2,
      4  P_ErrMsg OUT VARCHAR2)
      5  return Number;
      6  END MYUSER_PKG ;
      7  /
    
    Package created.
    
    SQL> show errors
    No errors.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY MYUSER_PKG  IS
      2  Function CreateDirectory
      3  (P_File_Path IN VARCHAR2,
      4  P_ErrMsg OUT VARCHAR2)
      5  return Number
      6  IS
      7  l_Return NUMBER;
      8  l_props DBMS_DBFS_CONTENT.PROPERTIES_T;
      9  BEGIN
     10  l_Return := 0;
     11  DBMS_DBFS_CONTENT.createDirectory (
     12  path => P_File_Path,
     13  properties => l_props);
     14  RETURN l_Return;
     15  EXCEPTION
     16  WHEN OTHERS THEN
     17  l_Return := NVL(SQLCODE, -1);
     18  P_ErrMsg := SQLERRM;
     19  RETURN l_Return;
     20  END CreateDirectory;
     21  END MYUSER_PKG ;
     22  /
    
    Package body created.
    
    SQL> show errors
    No errors.
    

    You should check why some GRANT statement fails if you have another problem with the other piece of code.

  • Upgrade to the Mobile number and telephone number of work using the API in HRMS

    Hello

    Could you please let me know how can I update the Mobile work telafone number number and Email address in the HRMS Oracle by using the API.

    I thank in advance...

    Martine Tremblay

    Hello
    Why to use hr_phone_api.create_or_update_phone to update the phone number, you can use below - API

    hr_phone_api.update_phone
    (p_phone_id-online lc_phone_id,
    p_date_from-online trunc (sysdate),
    p_date_to => NULL,
    p_phone_type-online "H1."
    p_phone_number-online '0119333944',
    p_object_version_number-online lc_obj_ver_no,
    p_validate-online fake,
    p_effective_date-online trunc (sysdate),
    p_party_id-online x_party_id,
    p_validity-online x_validity
    );

    PS - Please mark my post useful/correct if it was, that will be good for my profile. You must mark each post useful or correct individually.

    Thank you
    Gerard

  • I'm travelling abroad and do not want to use my phone or my text but don't want to use the camera... How should I configure myphone so I get no charge...

    I'm travelling abroad and do not want to incur charges from my iphone 6s for phone calls or text messages, but I don't want to use the camera.  How can I change the settings.

    Settings > airplane = Mode 'On '.

  • I want to use Outlook Web Access for Mac, I don't want to use the light version, I want the full version, but you can't push off the mark. I have firefox 3.6.10

    I want to use Outlook Web Access for Mac (snow leopard 10.6.8), I don't want to use the light version, I want the full version but I can't push off the mark on the light version. I have firefox 3.6.10

    (1) you must update at least Firefox 3.6.24 because there are questions of SECURITY of KNOWN MANY with the version you are using.

    (2) the light version is required on non - IE browsers, except if you are running Exchange Server 2010. With Exchange 2010 they added support for multiple browsers run in the version "no light".

Maybe you are looking for

  • Firefox closes at the beginning

    Firefox closes on the first attempt to start after the start. Seems to work fine after. Windows 8.1Customer of Comcast with constant Protection Suite and Norton Security Suite guard but all disabledProblem occurs after the start or restartPersisting

  • ICE (in case of emergency)

    Many organizations such as the Red Cross and the Police asked each person to include in its list of contacts of contacts ICE (In Case of Emergency) to be used in case of accidents and emergency situations. On the other hand, most of the people keep t

  • How will I know if my iPhone has been jail-broken?

    I saw a lot of messages pretending involved it is easy to say or know if your phone was jailbroken - but I don't know how - & recently paid someone who claimed to be able to judge it for me - but since nobody could not go back to iCloud, I have my do

  • Blocking attachment file type works do not email.

    Tried to set up the blocking of attachments with a .docm file type. Followed these old instructions to support.software.dell.com/kb/sw8351 tested with a file with a .docm file type, attached to the email and the email always happens with the .docm fi

  • Impossible to start a new folder, help

    I have Windows 7 and I can't start assistance 'new folder '.