×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Question Image capture (getSnapShot) on S40 6th edition & below

    Ok, im well experienced with j2me and have done alot of complex programming with it over the years.
    i have an app that uses the camera to take a snapshot (jsr-135)
    the app works on S40 6th edition FP1 and S60 handsets i got a failed QA in Ovi for it on S40 6th edition & below.
    i dont have an S40 6th edition or below device so i decided to check the s40 6th edition emulator which according to the documentation should be able to capture an image (the app also work on s40 6th edition FP1 emulator).
    the vc.getSnapShot(null) call fails with illegal state exception on the S40 6th edition emulator and please note my first line that i wrote (im 100% percent sure that my code is correct also note that it runs on FP1 emulator and device)
    BUT to play the devils advocate i decided to use an official sample from the wiki for capture an image with j2me
    http://www.developer.nokia.com/Commu...ots_in_Java_ME
    i checked this exact code on the s40 6th edition emulator (i changed the locator string to capture://image as wisely stated in the wiki as it should be from my knowledge as well) and it fails with the same exception as my app on the exact same line.....
    so i ask WTF????
    can someone with a s40 6th edition or below please help me by checking the code in the wiki if it works on their phone?

    Thanks to the helpers

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Image capture (getSnapShot) on S40 6th edition & below

    getSnapshot

    public byte[] getSnapshot(java.lang.String imageType)
    throws MediaException

    Gets a snapshot of the displayed content. Features and format of the captured image are specified by the imageType. All implementations support at least PNG format. Available formats can be queried from System.getProperty with video.snapshot.encodings as the key.
    Parameters:
    imageType - Format and resolution of the returned image. If null is given, it will default to using the PNG format.
    Returns:
    image as a byte array in required format.
    Throws:
    IllegalStateException - Thrown if initDisplayMode has not been called.
    MediaException - Thrown if the requested format is not supported.
    SecurityException - Thrown if the caller does not have the security permission to take the snapshot.

    Check that initDisplayMode is called and VideoControl is visible before getSnapShot is called.
    Try this codelet -

    javax.microedition.lcdui.Canvas canvas;
    :
    try {
    Player p = Manager.createPlayer("http://abc.mpg");
    p.realize();
    VideoControl vc;
    if ((vc = (VideoControl)p.getControl("VideoControl")) != null)
    vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, canvas));
    vc.setVisible(true);
    p.start();
    byte[] raw=vc.getSnapShot(null); // within try catch
    } catch (MediaException pe) {
    } catch (IOException ioe) {
    }
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: Image capture (getSnapShot) on S40 6th edition & below

    Amit ??? i dont need the documentation of getSnapshot im well informed of what causes it to throw exception and how it behaves etc, i've programmed in j2me since 2003.
    as for your code snippet i dont need to take a snapshot from a movie but from the camera if you have an S40 6th edition and below please help me by testing the code from the wiki on the handset.

    Thanks
    Shai

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Image capture (getSnapShot) on S40 6th edition & below

    I don't have any old S40 device with me, try some remote device testing labs.... check deviceAnywhere or perfecto mobile, they might provide your any s40 device for testing remotely even with its trail service.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: Image capture (getSnapShot) on S40 6th edition & below

    ye i know DAW and perfecto, im asking if anyone in the forum that do have these kind of handset can confirm this and if there is anything that can be done.

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: Image capture (getSnapShot) on S40 6th edition & below

    doesnt anyone have s40 6th or less phone to check this one?
    i mean its official example from the wiki and its not working on the emulator as it should....

  7. #7
    Regular Contributor
    Join Date
    Mar 2011
    Location
    Pune,Maharashtra,India
    Posts
    92

    Re: Image capture (getSnapShot) on S40 6th edition & below

    Quote Originally Posted by shaii View Post
    Ok, im well experienced with j2me and have done alot of complex programming with it over the years.
    i have an app that uses the camera to take a snapshot (jsr-135)
    the app works on S40 6th edition FP1 and S60 handsets i got a failed QA in Ovi for it on S40 6th edition & below.
    i dont have an S40 6th edition or below device so i decided to check the s40 6th edition emulator which according to the documentation should be able to capture an image (the app also work on s40 6th edition FP1 emulator).
    the vc.getSnapShot(null) call fails with illegal state exception on the S40 6th edition emulator and please note my first line that i wrote (im 100% percent sure that my code is correct also note that it runs on FP1 emulator and device)
    BUT to play the devils advocate i decided to use an official sample from the wiki for capture an image with j2me
    http://www.developer.nokia.com/Commu...ots_in_Java_ME
    i checked this exact code on the s40 6th edition emulator (i changed the locator string to capture://image as wisely stated in the wiki as it should be from my knowledge as well) and it fails with the same exception as my app on the exact same line.....
    so i ask WTF????
    can someone with a s40 6th edition or below please help me by checking the code in the wiki if it works on their phone?

    Thanks to the helpers

    I have S40 5th edition fp 1 device with me and I have succeeded to capture image from it using code from WiKi

  8. #8
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Image capture (getSnapShot) on S40 6th edition & below

    Hello shaii,

    the error which you get in the Series 40 6th Edition SDK emulator is due to the fact that camera capture via Java MIDlets (by using JSR-135 MMAPI and/or JSR-234 AMMS API) is not supported by the SDK emulator.

    The SDK documentation says as follows:

    Camera functionality works fine but screens overlap when camera application is launched.
    The above definition refers to using the camera on the phone (i.e. from Menu -> Media -> Camera).

    I tested the example application with the capture locator for Series 40 capture://image by using Nokia 3710 fold (a Series 40 6th Edition device) and that works as expected.

    Regarding the QA test issue, could you provide more details on the QA report i.e. what was the root cause for failing the pass test? Was there any specific devices defined which were used for testing (and which fail using the application)?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. MediaException: Only capture://image locator supports getSnapshot()
    By Steel_BRS in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2010-11-17, 05:21
  2. Video on S40 6th Edition Lite phones
    By thijsman86 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2010-09-17, 14:48
  3. S40 6th Edition display
    By schoenke in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2009-07-09, 20:50
  4. [moved] S40 6th Edition
    By naldopunk in forum Mobile Java General
    Replies: 1
    Last Post: 2008-12-03, 00:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×