Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Question Asha platform 1.0 : JAVA ME Getsnapshot Failed to check user permission

    Hello,

    I`m porting s40 JAVA ME apps to asha platform, i got this problem when invoking getSnapshot to take picture,
    the getSnapshot method throw security exception 'Failed to check user permission',
    this exception is throwed before the platform asking user permission.
    So the result my app cannot capture the picture although i choose allow to get snapshot.

    When i try to change the security domain in emulator to "operator" or "manufacturer", the app work perfectly.
    Is there new behavior in the new asha platform for getSnapshot method ?

    here is my code:

    private void takeSnapshot()
    {
    if (player != null)
    {
    try
    {
    byte[] pngImage = videoControl.getSnapshot(null);
    player.stop();
    midlet.cameraCanvasCaptured(pngImage);
    }
    catch (MediaException me)
    {
    midlet.displayCanvasOpening();
    System.out.println("MediaException: "+me.getMessage());
    }
    catch (SecurityException se)
    {
    System.out.println("SecurityException:" + se.getMessage());
    }
    }
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: Asha platform 1.0 : JAVA ME Getsnapshot Failed to check user permission

    Seems to be working fine for me on an app that i use to get snapshot... (i chekced and i was on unverified third party and i received the user permission screen and the snapshot was taken fine)

    Did you added javax.microedition.media.control.VideoControl.getSnapshot in your jad permission?

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Re: Asha platform 1.0 : JAVA ME Getsnapshot Failed to check user permission

    Yes i do, i add couple of permission below, my app take a picture, modify, then save to file.

    MIDlet-Permissions: javax.microedition.io.Connector.file.write,javax.microedition.io.Connector.file.read,javax.microedition.media.control.VideoControl.getSnapshot

    Do you try it in emulator or real device ?
    This code working great on JAVA SDK 2.0 but i got problem on ASHA SDK 1.0
    Last edited by profilku; 2013-06-01 at 12:18.

  4. #4
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Re: Asha platform 1.0 : JAVA ME Getsnapshot Failed to check user permission

    it looks like this problem occured on all protected class that need permission, i also experience problem when reading file, writing file. If i set manually in installed app setting, choose always allow on multimedia group, read & update personal information. The app is works well... is this an emulator bugs or sdk bugs ? whats version u use to test ?

  5. #5
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Re: Asha platform 1.0 : JAVA ME Getsnapshot Failed to check user permission

    Solved !! I just run the method that need permission as thread

    private void takeSnapshot()
    {
    new Thread(new Runnable() {
    public void run() {
    if (player != null)
    {
    try
    {
    byte[] pngImage = videoControl.getSnapshot(null);
    player.stop();
    midlet.cameraCanvasCaptured(pngImage);
    }
    catch (MediaException me)
    {
    midlet.displayCanvasOpening();
    System.out.println("MediaException: "+me.getMessage());
    }

    catch (SecurityException se)
    {
    System.out.println("Permission: "+midlet.checkPermission("javax.microedition.media.control.VideoControl.getSnapshot"));
    }

    }
    }
    }).start();
    }

  6. #6
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    79

    Re: Asha platform 1.0 : JAVA ME Getsnapshot Failed to check user permission

    Hello all,

    This is a known issue with beta SDK and the current platform version. It remains to be seen if this change will be permanent or not. Current documentation about issue is here:

    http://www.developer.nokia.com/Resou...-commands.html

    Best
    Michael

  7. #7
    Super Contributor
    Join Date
    Mar 2003
    Posts
    4,110

    Re: Asha platform 1.0 : JAVA ME Getsnapshot Failed to check user permission

    Quote Originally Posted by profilku View Post
    I just run the method that need permission as thread.
    And here is my bug report about this behaviour. The current behaviour will break a lot of MIDlets.

Similar Threads

  1. Asha Platform devices are now available in Publishing tool
    By Kalle Nevala in forum Publishing to Nokia Store
    Replies: 4
    Last Post: 2013-06-05, 12:57
  2. Why it says not compatible for Asha Platform?
    By nemoryoliver in forum Nokia Asha Web Apps
    Replies: 4
    Last Post: 2013-05-13, 18:10
  3. Issues capturing audio on Nokia Asha 311 (Developer Platform 2.0)
    By bayop in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2012-09-10, 20:19
  4. Check permission Problem
    By ansh.chauhan in forum Mobile Java General
    Replies: 0
    Last Post: 2010-07-08, 14:18

Posting Permissions

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