开发者

Capture pictues in blackberry application using VideoControl only works on emulator and not device

This is only some of the code because other parts of it are spread out but on the simulator for blackberry curve this adds a VideoControl to the manager and shows up fine with another button that actually captures the picture. However, when I run this on an actual Blackberry curve (version 6 I think) it doesn't display this on the screen.

try 
     {
         _p = javax.microedition.media.Manager.createPlayer("captu开发者_StackOverflow社区re://video?encoding=jpeg&width=1024&height=768");
         _p.realize();
         _videoControl = (VideoControl) _p.getControl("VideoControl");

         if (_videoControl != null)
         {
             videoField = (Field) _videoControl.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
          //   _videoControl.setDisplayFullScreen(true);
             _videoControl.setVisible(true);
            // EnhancedFocusControl efc = (EnhancedFocusControl)p.getControl("net.rim.device.api.amms.control.camera.EnhancedFocusControl");
            // efc.startAutoFocus();
             _p.start();


             if(videoField != null)
             {
                 add(videoField);
             }
         } 
     }
     catch(Exception e)
     {
         Dialog.alert(e.toString());
     }


In my experience the way of image taking you use has appeared very unreliable (it worked fine only on a limited number of devices), so I stopped using it. Use native Camera app instead - it works fine on all devices.


A lot of the time when things work on the emulator but not device it's permissions related, have you checked ApplicationPermissionsManager?

Word of warning, from OS4.5 to 6 a lot of stuff has been deprecated so be sure you check you have the right permissions for the models you are working with. e.g. ApplicationPermissions.PERMISSION_SCREEN_CAPTURE was deprecated in 4.6 I think.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜