How to retrieve and display the image on screen stored in pim...

Hello world

Can anyone tell how to recover the image store in pim and then display it on the screen

See the code below. I just copied it from PIM API doc

 import java.io.IOException;
 import javax.microedition.pim.Contact;
 import javax.microedition.pim.ContactList;
 import javax.microedition.pim.PIM;
 import javax.microedition.pim.PIMException;
 import javax.microedition.pim.PIMItem;
 import net.rim.device.api.io.Base64InputStream;
 import net.rim.device.api.io.Base64OutputStream;

 public class PhotoExample
 {

     private Contact _contact;

     public PhotoExample() throws PIMException
     {
         ContactList contactList = (ContactList) PIM.getInstance().openPIMList(
                 PIM.CONTACT_LIST, PIM.READ_WRITE );
         _contact = contactList.createContact();
     }

     public void setPhoto() throws IOException
     {
         byte[] photo = getSamplePhoto();
         byte[] photoEncoded = Base64OutputStream.encode( photo, 0,
                 photo.length, false, false );
         if( _contact.countValues( Contact.PHOTO ) > 0 ) {
             _contact.setBinary( Contact.PHOTO, 0, PIMItem.ATTR_NONE,
                     photoEncoded, 0, photo.length );
         } else {
             _contact.addBinary( Contact.PHOTO, PIMItem.ATTR_NONE, photoEncoded,
                     0, photo.length );
         }
     }

     public byte[] getPhoto() throws IOException
     {
         if( _contact.countValues( Contact.PHOTO ) > 0 ) {
             byte[] photoEncoded = _contact.getBinary( Contact.PHOTO, 0 );
             return Base64InputStream.decode( photoEncoded, 0,
                     photoEncoded.length );
         } else {
             return null;
         }
     }

     private static byte[] getSamplePhoto()
     {
         // return the raw bytes of the photo to use
     }

     public static void main( String[] args ) throws Throwable
     {
         PhotoExample example = new PhotoExample();
         example.setPhoto();
         example.getPhoto();
     }

 }

.

Tags: BlackBerry Developers

Similar Questions

  • How to copy and paste the image parameters to image with ACR 9.1.1

    How to copy and paste the image parameters to image with ACR 9.1.1

    Hi nicholast15140269

    • You can save the current settings of the image or can save them outside in the form of XMP file. Then use as a preset.

    Concerning

    ~ Assani

  • How to cut and paste the image of the body of the received email

    I'm trying to cut and paste an image included in the bottom of an email and insert it into a Word document so that you can size and print. I can highlight, cut it with Ctrl C, paste it into the document Word with Ctrl V, but the image doesn't show, although the picture frame appears when I click on the place where the photo was pasted. Framework, but empty, no image. Any thoughts?

    Thanks to everyone for their help.

    The problem has been resolved - to try and finally understand everything.

    If you encounter this problem, it is perhaps because, unless you know the file format of the inserted picture, programs can not figure it out for you. Place your cursor on the image, right click and save the image under a .jpeg instead of simply copying. Then work with the file .jpeg in any photo management program you use normally - or even insert it in Word.

  • Can you please tell me how I arrange and move the images in a folder like in XP, when I drag and drop a picture, it comes down to its original position

    Organize and rearrange the images in a folder named as in XP. You could organize by date, size, etc. and do drag and drop all in a folder, it is not possible in Windows 7

    Hi Halohodge,

    Welcome to the Microsoft Answers site!

    You can't manually rearrange files/images by dragging them in the folder in Windows 7. This change is design in Windows 7.

    If you have concerns or comments with respect to the question or any other Microsoft application, please see the links below and send the same:

    Microsoft Connect
    http://connect.Microsoft.com/

    Comments for Windows 7

    If you are referring to the reorganize by date, size, etc. then you can always do than simply right click and selecting the option of sort by in the drop-down list when it appears in the photo or file folder.

    Concerning
    Varun j: Microsoft Support
    Visit our Microsoft answers feedback Forum
    http://social.answers.Microsoft.com/forums/en-us/answersfeedback/threads/ and tell us what you think

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to retrieve the image BLOB from database and display the image in rtf file using the Oracle XML Desktop 5.6.2 publication server?

    Hi all

    Here I have the image BLOB in the database files,

    I want to show the image to PDF using file to rtf using Oracle Xml Desktop Publisher,

    Hi all

    I found the solution for reading Image BLOB of data base & display in Pdf format.

    (1) read the image from DB.2) and then copy the picture using IO. UtilsCopy method to copy the picture

    (3) then encode with base64 converter then you will get the tag XML with Base64 as string then placed in your XML Code & preview the output, you will find the image

    Photo = (BlobDomain) currentRow.getAttribute ("Image");

    ByteArrayOutputStream OutputStream = new ByteArrayOutputStream();

                        Byte [] imageByte;
                          Byte [] b = null;
                        try {}
                        
                            IOUtils.copy (photo.getInputStream (), outputStream);
                            BS = outputStream.toByteArray ();
                            outputStream.flush ();
                            System.out.println("==="+BS.) Length);
                            Encoded byte [] is Base64.encodeBase64 (bs).;
                            encodedString = new String (encoded);
  • How to capture and display the end of line character in the report

    Hi guys,.

    I have a report that we are poster campaign ID, campaign name, and Description of the campaign.
    The result is coming like this

    Description of campaign campaign campaign ID name
    1 ABC 1 Plan June 13. 2 market July 1. 3. end July 30.
    Plan XYZ 2 1 13 June. 2 market July 1. 3. end July 30.

    But we want the data to be displayed in the following format.

    Description of campaign campaign campaign ID name
    1 ABC 1 Plan June 13.
    2 market July 1.
    3. end July 30.
    Plan XYZ 2 1 13 June.
    2 market July 1.
    3. end July 30.
    That the user has the possibility to enter several lines for the description in front end Application & want us to show the same way Description. How can I capture this end of the character in ETL? If he is already captured, then how to show in the report.
    I use Siebel as before end application and for the ETL using Informatica.

    Any help will be much appreciated.

    Thank you
    Rupesh

    OBIEE presentation Service is an HTML element based on software then it does not show the end file character CHR (10) or Chr (13).
    You must replace this with the HTML tag charcaters
    .

    I'm not sure of the name of the function, but you must make a formula like this

    replace(mytable.mycolumn, chr(10), '
    ')

    See you soon
    Nico

  • How to read and display the .ai file in CS4 SDK?

    Hi all

    I drew an own and saved the socument as file traingle.ai.

    Now, I want to read/open the traingle.ai file in the plugin.

    [Lets say, I want to read this file based on GoFilter ()]

    Is there an API to read file .ai in CS4 SDK? and display as well?

    If you mean autonomous (outside Illustrator) the answer is no. The SDK is reserved for the plugins loaded into Illustrator. If you want to open a file from Illustrator that is perfectly doable if. I think that AIDocumentList:: open() that will handle.

  • How can reedit and rename the image

    Dear friends,

    Hi all, I need to be reprinted full of images - missing - (i.e. "K_MNYCEPT221161_C01PT_002T.ai") (i.e. "K_MNLESE850231_C01PT_002T.ai"). I have listed my coding below, tell a good friends suggestion.

    Application version: indesign Cs6

    var    
      mLinks = app.activeDocument.links.everyItem().getElements(),    
      cLink, cFile;    
     alert(mLinks.length)  
        
    while ( cLink = mLinks.pop() )   
      alert(cLink.length)  
    {    
      if (cLink.status == LinkStatus.NORMAL) continue;    
      cFile = File(cLink.name.replace("K_MNYCEPT221161_","K_MNLESE850231_") );   
      if ( !cFile.exists ) continue;    
      cLink.relink(cFile);    
      }  
    
    

    Thanks in advance,

    This script works on MacOS 10.11.2 & CS6

    I add the log console in the code, give me the result...

    var mLinks = app.activeDocument.links.everyItem().getElements(), cLink, cFile;
    alert(mLinks.length)
    
    while ( cLink = mLinks.pop() ){
      $.writeln('Link path : ' + cLink.filePath)
      if (cLink.status == LinkStatus.NORMAL) { continue; }
      cFile = File(cLink.filePath.replace("page","pages") );
      $.writeln('New Link path : ' + cFile.fsName)
      $.writeln('New file exist : ' + cFile.exists)
      if ( !cFile.exists ){ continue; }
      cLink.relink(cFile);
    }
    
  • Retrieve and display the news of 3 tables

    Struggle with it for a few days now. Set up a calendar with football fixtures. For some reason team names do not appear in the table and it is really killing me. I thought I knew something about sql and php, do not.

    So, to create this page, I use 3 tables, season, teams and schedule and others containing these columns. The first table, the season, has only 1/line recording, being the season which is in place, in this case 2010-2011:

    • Season
      • ID (primary key - I)
      • course
    • Teams
      • ID (primary key - I)
      • season
      • leagueid
      • teamid (single value)
      • Prospect
    • Calendar
      • ID (primary key - I)
      • season
      • leagueid
      • hometeamid
      • awayteamid

    So, what should look like the query is based on that 1 plug of the season in the table, you must select all the games in the Schedule table, by selecting all the columns, as shown above. Now that's the easy part, the hard part, replace the hometeamid AND awayteamid by name of the teams table. The teamid you see in the table teams is also used in the calendar table. Below some basic entry in the tables in question, to get a better feel of it:

    Season
    12010-2011

    Teams
    IDSeasonID of the LeagueThe ID teamName of the team
    12010-2011U121245 - u12aaTeam XYZ
    22010-2011u8a9521 - u8aTeam ABC
    32010-2011U121245 - u12aHPH team

    Calendar
    IDSeasonID of the LeagueID hometeamID Awayteam
    12010-2011U121245 - u12aa5874 - u12a
    22010-2011U129521 - u12ab7436 - u12ab
    • Season

      • ID (primary key - I)
      • course

    It's OK

    • Teams

      • ID (primary key - I)
      • seasonid
      • leagueid
      • teamid (single value - primary key)
      • Prospect

    Make the changes above moving the primary key as the first field

    • Calendar

      • ID (primary key - I)
      • seasonid
      • leagueid
      • hometeamid
      • awayteamid

    Make the change as suggested

    You also need a table for the League to get the leagueid.

    Once you have done this post the SQL so that I can create the tables and walk you through the queries for output

  • Retrieve and display a result set using the dynamic sql?

    Hi all

    How would display a result set in Oracle using the dynamic SQL? Reason being, the table where I'd retrieve and display the result set is a GLOBAL TEMP TABLE created in a stored procedure. If I try to use the loop as usual, the compiler complains that the table does not exist. This makes sense because the compiler does not recognize the table because it is created dynamically. Here is an example:

    create or replace PROCEDURE maketemptab IS
    sql_stmt VARCHAR2 (500);
    OutputString VARCHAR2 (50);

    BEGIN
    -create temporary table
    sql_stmt: = ' CREATE of TABLE TEMPORARY GLOBAL globtemptab (id NUMBER, col1 VARCHAR2 (50))';
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... created table ');

    -Insert a row into the temporary table
    sql_stmt: = "INSERT INTO globtemptab values (1, 'some data of a test')';"
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Insert a row into the temporary table
    sql_stmt: = ' INSERT INTO globtemptab values (2, "some more test data");
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Select the row on temporary table
    sql_stmt: = 'SELECT col1 FROM globtemptab WHERE id = 1';
    EXECUTE IMMEDIATE sql_stmt INTO outputstring;
    dbms_output.put_line ('... selected line: ' | outputstring);

    -drop temporary table
    sql_stmt: = 'DROP TABLE globtemptab;
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... moved table ');

    -display the result set
    for tabdata loop (select col1 from globtemptab)
    dbms_output.put_line ('... test of recovered data are' | tabdata.col1)
    end loop;
    end;


    In short, how to rewrite the SQL below the comment "to display the result set" using the dynamic sql?

    Thank you
    Amedeo.

    Hello

    Try this:

    CREATE OR REPLACE PROCEDURE maketemptab IS
       sql_stmt     VARCHAR2(500);
       outputstring VARCHAR2(50);
       v_cursor     SYS_REFCURSOR;
       v_col1       VARCHAR2(30);
    BEGIN
       -- create temp table
       sql_stmt := 'CREATE GLOBAL TEMPORARY TABLE globtemptab(id NUMBER, col1 VARCHAR2(50))';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table created');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (1, ''some test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (2, ''some more test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- select row from temp table
       sql_stmt := 'SELECT col1 FROM globtemptab WHERE id=1';
       EXECUTE IMMEDIATE sql_stmt
          INTO outputstring;
       dbms_output.put_line('...row selected: ' || outputstring);
    
       OPEN v_cursor FOR 'SELECT col1 FROM globtemptab';
    
       LOOP
          FETCH v_cursor
             INTO v_col1;
          EXIT WHEN v_cursor%NOTFOUND;
          dbms_output.put_line('...test data retrieved is' || v_col1);
       END LOOP;
       CLOSE v_cursor;
    
       -- drop temp table
       sql_stmt := 'DROP TABLE globtemptab';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table dropped');
    END;
    /
    

    Kind regards

  • How to make src of the image of the place holder something xml file

    Hello
    im doing xslt on xml file and I want to store the path to the image on an element of the xml file and display the image on the page how?
    I can write about the CBC textbox like any expression xml xml string how?

    > im doing xslt on xml file and I want to keep the image on an element path
    > XML file and display the image on the page how?
    > can I write on the CBC textbox like any expression xml xml string how?

    I'm a little confused, but if you transform XML via XSLT, then
    You must create the link of the image via the XSLT file:

    Assuming that you store in an XML file name of the image node
    "imageFileName":

    -Darrel

  • How to configure CPU Meter so that it displays the image instead of the text version.

    How to configure CPU Meter so that it displays the image instead of the text version.

    Hi John,.

    Welcome to the Microsoft community.

    The CPU Meter gadget shows the status of the two main resources, you can follow on your computer - the use of your CPU and memory.

    To install the CPU Meter gadget in Windows 7, just right click anywhere on your desktop and click on Gadgets. Search the CPU Meter gadget and drag it to your desktop.

    See the Microsoft Article below and check if this is useful:

    http://Windows.Microsoft.com/en-us/Windows7/customize-desktop-gadgets

    Let us know if you encounter problems under windows in the future. We will be happy to help you.

  • Image: poster of local disk, download server and display the server file system

    Hello

    I use jdev 11.1.2.4.0...

    The requirement is that users want to upload images to their local drive for the drive on the server and they would like display of server disk images later.

    We do not want to save the images in the database. I'm not sure what should be the solution; However, I intend to...

    1 create a table to keep information from images - image_id, image_location (server drive), image_filename

    2. create a page where users can enter image information and specific file on a local disk name (I think I'll use inputFile component) and provide the Preview button to display an image on the screen before saving. To record data is to save the information in the database and copy an image file on the disk on server (the location for image files is predefined.)

    3. create another page where users can browse the database information and display an image for a selected record getting from the server.

    I need suggestions on...

    1. how to display an image on the page of the local drive?

    2. how to copy a file on a local disk to a server?

    3. how to display an image on the page of the drive on the server?

    Thank you.

    NAT

    See:

    http://tompeez.WordPress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-ADF-part-1/

    http://tompeez.WordPress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-ADF-part-2/

    http://tompeez.WordPress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-ADF-part-3/

    When Timo records the images in the database, you save it in the file system (examples on how to do this Java are available much if you just Google for it). Similar to Timo you then use the tag image to display pictures. The difference is that you can directly add the URL of the database table.

    The advantage of using a database to host images, it's that you're not although dependent on files server structures

    Frank

  • How to display the image in the answes table based data.

    I need to display the image based on the values retrieved from the base.

    For example, if the value of a column is 1, then I need to be to display an image within a table. Help, please. Thank you.

    Published by: 853213 on April 18, 2011 21:50

    Hello

    Use the conditional formatting...

    The column properties->->, click Add a Condition for conditional formatting-> filter on the column value is equal to 1-> change Format (click on the image and choose the image)

    If you want to add custom images
    Reference: http://obiee101.blogspot.com/2009/07/obiee-adding-custom-image-in.html

    See you soon,.
    Aravind

  • How to display the image in the center of the imageview window?

    How to display the image in the center of the imageview window, if the image is smaller than the window...

    Page {
        Container {
            layout: DockLayout{}
            verticalAlignment: VerticalAlignment.Fill
            horizontalAlignment: HorizontalAlignment.Fill
            ImageView {
                imageSource: "asset:///images/image.png"
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
            }
        }
    }
    

Maybe you are looking for

  • Problems installing Tiger

    I have a big problem when I try to install Tiger on my G3 iBook. Whenever I try to boot from the DVD, I get a (with text, not only the message of restart) kernel panic with the error "no driver found for Powerbook 4.1". I know that this drive works,

  • CTR-500 pulse problem

    I use a couple CTR-500 on a configuration compact fieldpoint to measure the pulses coming from 2 meters of energy (BTU), 3 gas diaphragm meters, 2 liquid flow meters and 2 active energy electric meters.  I seem to have a problem with my account pulse

  • HP 15-g011nr: replacement of ram

    How can I replace the ram on this laptop? Y at - it a video on this laptop in particular?

  • EPub files, opening a

    I downloaded a file .epub and need a program to open it.  Please point me in the right direction. Thank you, Judi

  • cf286a: Scan to Email without a computer

    I need to configure a scan to e-mail setup in a very remote to be exploited by unschooled people. Hand written forms must be sent. Fax equipment does not have the limitations of the cell, but I have high speed internet and WiFi.  A computer cannot be