Generation using the api of ContactService vcf file

Hi all

I wrote a code that retrieves all contacts using ContactService api. The code is as follows:-

foreach (const Contact &idContact, contactsList) {
        // Fetch the complete details for this contact ID
        const Contact contact = m_contactService->contactDetails(idContact.id());
        QByteArray contactArray = m_contactService->contactToVCard(contact);
    }

ContactsList list is retrieved using api ContactService.

I can't understand how that is more that I need to convert all the contacts from the contacts list a single vcf file and store it in the memory card.

Please guide.

Thank you & best regards

If you let the user choose the way perhaps you want to provide a parameter to the function to pass the path:

void AddressBook::storeContactsToMemoryCard(const QString& thePath)

With regard to your questions:

(1) I wrote QDir::currentPath for example, you provide the path, your user name was selected in a FilePicker.

(2), it is just an example, you must set a magic number (depending on what you want) for your file. In this way, outside the classroom:

const quint32 magic = 0xABCABCAA

(3) unless you use Qt for android I do not. Keep in mind that each version QDataStream can change the domestic channel, it stores data, is why you should have a way to identify which version of the data stream used to save the data. (this is the purpose of the version number in the file).

Take a look at this:

http://Qt-project.org/doc/Qt-4.8/QDataStream.HTML#Versioning

4)

   QFile myFile(WHERE_THE_FILE_WAS_SAVED);

    if(myFile.open(QIODevice::ReadOnly))
    {
      QDataStream ds(&myFile);
      //First a magic number to identify the file as your custom format (define it as a constant!)
          quint32 magic;
      ds >> magic;
      //MyMagicNumber is a constant defined outside the class
          if(magic != MyMagicNumber)
      {
        //File is incompatible, return whatever you want to check for error
            return;
          }
      //Second the version number of your custom file (define it as a constant!)
          quint32 fileVersion
      ds >> fileVersion;
      //depending on the version number of your file you should select the
      //apropiate datastream version
      switch(fileVersion)
      {
        case 100:
        case 200:
          ds.setVersion(QDataStream::Qt_4_0);
          break;
        case 777:
          ds.setVersion(QDataStream::Qt_4_6);
          break;
      }

       while(!ds.atEnd())
       {
              QByteArray tmpByteArray;
          ds >> tmpByteArray;
          //Fill your contactList
       }
      myFile.close();

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...

  • Create 10000 of TI resource Instance using the API of the IOM.

    Hello

    I need to develop a utility that will create 1000's of resources COMPUTER to IOM, the utility must read the resource data in a CSV file.

    Utility must use the Api of the IOM to develop this feature...

    Please provide feedback

    Kind regards


    Abreu

    Thanks Abhishek.

    I have a doubt linked to this resource setting that is there in the CSV file, how we can pass these parameters as aphAttributes in createITResourceInstance method.

    Kind regards

    Sri

  • 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

  • Issue while deploying code that uses the api of the IOM: OIMClient

    We strive to deploy a war file with some java code that is interfaced with the IOM by using the api OIMClient. Note that we have all necessary spring pots and it works great on Tomcat. Our production env is on weblogic and when deploy us the file. War on weblogic deploys it fine. But when we test some web pages, we get the following error:

    Root cause]] of ServletException.
    java.lang.NoClassDefFoundError: org/springframework/jndi/JndiTemplate
    to oracle.iam.platform.OIMClient. < init > (OIMClient.java:83)
    ......
    Truncated. check the log file full stacktrace
    >


    The class file is available in a container called Spring framework with the same package structure: org.springframework.jndi.jnditemplate. I wonder why he cannot find the definition for this class. I also tried to delete these jars to war file and adding them to the lib dir field. I always find myself with the same exception.

    Appreciate all the help I can get.

    Published by: 958829 on Sep 12, 2012 23:01

    try to add the jar of spring separately to help:->-> deployments weblogic console add jars

  • 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 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.

  • When I use the mail merge with excel file, after I press ok the progress bar indicates "NaN", mail project window crashes. My record is nice little CVS n

    When I use the mail merge with excel file, after I press ok of the progress bar indicates "NaN", mail project window crashes. My file is in the correct format and small size (4-column 4 raws). I use an English version of thunderbird after accidentally, I installed one in my tongue.

    I am attaching the screenshot

    I solved the problem
    has been st@pid excel

    I created a CSV file in openoffice calculator and everything went smoothly

  • Step by step single run through a sequence TestStand using the API

    Anyone know if it is possible to break a sequence of execution and then simple step during various stages of a sequence using the API TestStand?

    Pause and resume running no problem, but step by step once execution is broken turns out to be illusory.

    Largely received ideas

    Steve

    The object of performance communicates methods for this.

    Norbert

  • Hide icon Label step using the API Testand and LabVIEW

    Hello

    can someone tell me how it is possible to hide the icon of a step label using the API Testand and LabVIEW?

    In the Teststand sequence editor, under the Label Edit tab there is a checkbox called "Hide icon". Is there something similar in the API?

    Thank you

    Yes you can, you must set the stage "ni_blank.ico" IconName property

  • 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

  • Definition of privileges by using the API

    Hello

    I am a newbie of TestStand. Please bear with me if this question seems very basic.

    I am trying to build a c# wrapper around the user management module in TestStand. I created a new user interface that reads all the characteristics of a user as his groupname, privileges etc.

    How can I access the NI_UserCustomPrivileges using the API?
    I need to access privileges custom under the grouping custom privileges.

    I'd appreciate any help in this.

    Use the User.HasPrivilege method.  This method takes as a parameter a representative the particular privilege search string you are looking for.  For example, you can search the database name, i.e. 'RunSelectedTests' [User.HasPrivilege ("RunSelectedTests")] or you can search the full path, for example "Debug.RunSelectedTests".  In this way, you should be able to search privileges custom as "Custom.MyPrivilegeName."  Note that if you are only looking for the database name and there are several instances of the name of this database that exists, TestStand will only work on the first instance it finds.

  • Do CPO dynamic media transforming workflow using the API or any other means?

    Do CPO dynamic media transforming workflow using the API or any other means?

    Could we create or update workflows when running?

    There is no workflow WSDL. But I'm not sure of the custom here. Can you describe your use case or what you try to do this will have to change a process/workflow during execution?

  • Installation of 8.1 of Windows 8 by using the windows 8.1 image file located on USB

    I want to do the Windows Installation 8.1 do I need key to install the pre-installed Windows 8 windows using the windows 8.1 image file located on USB downloaded from microsoft.

    Hi Lovina,

    We are here to help.

    Installation of Windows 8.1 using the image file is on your key USB can be activated without the product key.

    You can also consider to upgrade your computer to the latest version of Windows, Windows 10. Check out this article for more of Windows features 10

    Please do not hesitate to contact us if you need assistance.

Maybe you are looking for