CAMERA: getSnapshot returns NULL (CURVE 8900)

Hello

I did and took positions... and the examples also set permissions so that I don't get exceptions...

I see a camera in my viewField... but when I call "getSnapshot", return of the values is null... I tried setting imageType to one of those supported and also tried with null as a parameter in getSnapshot...

My support for 8900Curve formats are:

Encoding = rgb565

Encoding = jpeg & width = 2048 & height = 1536 & quality Super fine =

Encoding = jpeg & width = 2048 & height = 1536 & quality = normal

Encoding = jpeg & width = 2048 & height = 1536 & quality = very good

Encoding = jpeg & width = 1024 & height = 768 & quality = normal

Encoding = jpeg & width = 1024 & height = 768 & quality = very good

Encoding = jpeg & width = 1024 & height = 768 & quality Super fine =

Encoding = jpeg & width = 480 & height = 360 & quality = normal

Encoding = jpeg & width = 480 & height = 360 & quality = very good

Encoding = jpeg & width = 480 & height = 360 & quality Super fine =

My code is below...

Reader = Manager.createPlayer ("capture://video");

Player.Realize ();

Player.Start ();

VC = player.getControl ("VideoControl") (alarm);

Viewfinder field (Field) = vc.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field"); this.add (viewfinder);

String imageType = "encoding = jpeg & width = 480 & height = 360 & quality = normal;

byte [] imageBytes = (imageType) vc.getSnapshot;

 

if (imageBytes! =null)

{

Image bitmap = Bitmap.createBitmapFromBytes (imageBytes, 0, imageBytes.length, 5);

...

...

}

Thank you.

Kris

Two issues I see when we compare your code with mine, who works on a Curve 8900.

(a) my player.start is that I added the field to the screen.

(b) my getSnapshot is done on a screen (actually a button click) event, while I am sure that the screen was displayed and the viewfinder is visible.

I also had real problems with this code on the curve.   You might find this Thread helpful reviews.

http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=27454

Tags: BlackBerry Developers

Similar Questions

  • BB10 camera image returns null bitmap

    I use the Invoke method to open the camera and take a picture, and then close the map given by jtegen.

    When I put the Image, I don't get an error, but the information is zero.

    The event data are back with a location of the image.

    What step am I missing?

    private function CardClosed( event:CardCloseEvent ) : void
    {
        trace( 'card closed ' + event.reason + ' ' + event.data );
        InvokeManager.invokeManager.removeEventListener( CardCloseEvent.CARD_CLOSED, CardClosed );
    
        if( event.reason == 'save' && event.data != '' )
        {
            trace("data : " + event.data);
            // example data value : '/accounts/1000/removable/sdcard/camera/IMG_00000131.jpg'
            imgCapture = new Image();
            imgCapture.setImage( "file://" + event.data );
    
            decodeBitmapData(imgCapture.bitmapData, stage.stageWidth, stage.stageHeight);
        }
    }
    

    I wanted to just note that I tried to put the image by using the following text:

    • "file://" + event.data
    • "file:/". "+ event.data
    • Event.Data

    Same result for all 3 channels.

    I thought about it.  Not everything works, but I'm capturing the image.

    I just need to add the loader to get the image and then place this content in the image.

    private function CardClosed( event:CardCloseEvent ) : void
    {
        trace( 'card closed ' + event.reason + ' ' + event.data );
        InvokeManager.invokeManager.removeEventListener( CardCloseEvent.CARD_CLOSED, CardClosed );
    
        if( event.reason == 'save' && event.data != '' )
        {
            trace("request length" + cameraRequest.data.length);
    
            imgCaptureLoader = new flash.display.Loader();
            imgCaptureLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageCapture);
            imgCaptureLoader.load(new URLRequest('file://' + event.data ));
        }
    }       
    
    private function onImageCapture( event:Event ):void {
        imgCapture = new Image();
        imgCapture.visible = false;
        try {
            imgCapture.setImage( imgCaptureLoader.content );
            decodeBitmapData(imgCapture.bitmapData, stage.stageWidth, stage.stageHeight);
        } catch (e:*) {
            trace(" load error: " + e);
        }
    }
    
  • Camerademo does not work on the curve 8900

    I tried to integrate a camera in an application that runs only on the bold 9000 and 8900 curves.  My code based on this sequel to the KB article works absolutely fine on the "BOLD".

    How - to take a snapshot using the built-in camera to a BlackBerry smartphone
    Article number: DB-00667
    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/How_To...

    However, it does not work on the Curve 8900.  Initially I had a problem with the viewfinder display only part of the image and then corrupt display, so I upgraded the operating system to v4.6.1.133 (the most recent available for Vodafone UK) and now the viewfinder does not at all appear.

    To make sure it wasn't just my request, I loaded camerademo, compiled with JDE 4.6.1 and signed, on the device.  Still, the field of the viewfinder is not displayed.  When I click on the 'Take Photo' button, I get a null pointer exception, because the bytes (_raw) on the screen of createImageScreen are null.

    camerademo works fine on the Simulator, but Interestingly on the Simulator, the maximum camera resolution is 1660 * 1200, where, as the real device is 2 K * 1. 5 k.

    So why camerademo does not work?  If I can fix it, I think I can fix my application.

    Edit to set "Write me" every person must answer.

    This problem is now solved with an upgrade to OS 4.6.1.199, 4.6.1.133 form.

    Even with this level, the screen of the camerademo CameraDemo, which contains the "viewfinder" needs to be changed so that no other fields are used - this includes the removal of the setTtitle.  With this fact, ButtonField is not added, so the fieldChanged() event is not raised, another way of taking the photo should be used.  In addition, I also changed the scale factor in the ImageScreen to 8 from 7, to make the thumbnail a bit smaller.

  • Smartphones blackBerry Curve 8900 battery life

    The life of the battery on my Curve 8900 seems to be getting worse. The phone is only 4 m. Need to recharge every day, but the use is minimal - used for texts and facebook + some downloaded items from the world of BB. I got disabling the wi - fi connection, but it seems to make no side. He started the busy day but is now only 12%!

    Someone at - it ideas?

    To avoid the dead quickly on any BlackBerry, most important practice that you can adopt is to ensure CLOSE applications when you are finished using them.

    If you simply press the Red "end call" key to return to the home screen application is actually open and running in the background. If you do this several times, you will have many apps open and therefore your memory will get used. Lack of memory is the main reason for your BlackBerry slows to a crawl or crashes. If you make a habit of actually use the menu button to close the applications that will at least slow this process memory-clogging. You may still do a battery pull or using the "Quickpull" app from time to time when things get slow.

    Similarly, check your applications running in the background. There are four or five applications that will always run fluently (Messages, Call Logs/phone, BlackBerry Messenger, home screen and the browser; there are other third-party applications such as BeeJive and alerts of BlackBerry that will work also in the bottom that you can not close if you want they work). Ensure that the browser is NOT on an active Web page (open the browser and select the Menu > close). Close all other applications that do not need to be running (the camera or a game you were playing or Google Maps).

    Here's some good advice from loading, please read and you will see that many of them will be applicable to you.
    http://www.BlackBerryFAQ.com/index.php/Maximum_Battery_Life
    And here: http://supportforums.blackberry.com/t5/BlackBerry-Community-Post/Power-Saving-Tips-for-your-BlackBer...

  • Deployment error when I deploy my application world Hello to device of BB curve 8900

    I am facing deployment error while I deply to device Iam using the version of the sdk webworks: BlackBerry WebWorks SDK 2.3.1.5

    IAM using the webworks said above, windows 8 64-bit system, when I deploy it in the Simulator for other versions I see global demand for Hello in the emulator to ripple, but when I try to look for 8900 device that is not listed in the webworks platform why is it so?

    My camera works with OS 4.6.1, then how to deploy my application world Hello to this device of curve 8900?
    If the JDE or jre must be downgraded on 4.6.1 how? I need to change my environment variable

    Someone in a pile on flow said like that. "

    You as a developer WebWorks don't treat BrowserField instance, but your app to launch and work, needs this new implementation of the BrowserField class that supports the required functionality.

    Software more former device does not support the feature that provides new BrowserField. And as a result, it is not possible to launch WebWorks applications on older devices OS-es to 5.0.
    "So do I need higher version OS to run my application helloworld on my device.

    SDK BlackBerry WebWorks 2.3.1.5 has a requirement of BlackBerry OS 5.0 because of the new BrowserField object (which has been introduced in BBOS 5.0 that you noted.) You will not be able to deploy a WebWorks to any device that runs a pre - 5.0 operating system.

  • Smartphones to blackBerry Curve 8900, vibrations ring

    Hello

    I'm using curve 8900 and I don't know what is wrong with it but I tried to put the profiles NORMAL to leave only the phone rings with tone and with no vibration but it still vibrates whenever the phone rings. Is it possible, this could be corrected?

    Hmm... last thought would be to create a new profile and adjust your sounds here. See if that fixes the problem. When I got my BB 8900, I did the wizard of switch device, and for some reason any the phone remember my sounds for each of the 5 accounts email I put in place on the phone. To get around that I created a new sound profile. It worked and I did just that. When I install the new software for the phone came out, this sound problem disappeared.

    Next option would be to re - install your BB software.

  • Autonomy of Smartphones for the Curve 8900 blackBerry

    I'm new to the Blackberry and a Curve 8900 bought last week. The Web site specifies that life baterry is:

    "Removable and rechargeable 1400 mAh battery that provides approximately 5.5 hours of talk time and 15 days of standby time. I'm reading this correctly?

    For me, I noticed that the first days the battery was fees is pretty good given the amount of use. I did a habit to charge every night despite the charge level. But these days I decreased my usage and noticed oil of battery changes significantly after 13 hours. So I plug it into the charger immediately. I ensure that all my applications are closed as I heard that it can be a killer if left open.

    I know that reading the other messages, battery life is an issue. But 15 days of standby time as announced. This assumes that you don't have a data Plan? Did someone went longer than a day and if I could have a problem with my camera.

    Thank you

    I'll check it out. Thanks for your help

  • ConnectionFactory.getConnection () returns null.

    ConnectionFactory connFact = new ConnectionFactory();
            ConnectionDescriptor connDesc = null;
            connDesc = connFact.getConnection(----here goes my url String----);
    

    Hi all

    In the code posted above, number In Line 3, reason for which the null value is returned by the statement "connFact.getConnection (- this is my String url-);"   and he is assigned to the variable 'connDesc '.  Although I was able to login successfully before 2 to 3 hours. but it is now return null...

    Could you please help me?

    Best regards,

    Hi Sir,

    After going through the link provided by you (and a few other sup on internet links), I was able to resolve the issue for now... I write the code for other users help here...

    Thank you for your support...

    Best regards.

    // make a list of transport types ordered according to preference (they will be tried in succession)
    int[] preferredTransportTypes = {TransportInfo.TRANSPORT_MDS, TransportInfo.TRANSPORT_WAP2};
    
    // Create ConnectionFactory
    ConnectionFactory factory = new ConnectionFactory();
    
    // Configure the factory
    factory.setPreferredTransportTypes( preferredTransportTypes );
    
    // use the factory to get a connection
    ConnectionDescriptor conDescriptor = factory.getConnection("http://www.blackberry.com");
    
    if ( conDescriptor != null ) {
    
       // connection suceeded
       int transportUsed = conDescriptor.getTransportDescriptor().getTransportType();
    
       // using the connection
       HttpConnection  httpCon = (HttpConnection) conDescriptor.getConnection();
       ...
    }
    
  • PersistentObject.getContents () returns null after app update

    Hello

    I'm trying to track down a bug with PersistentStore.
    Usually when I update the app I get the getContents() stored content.
    However, something in the code has changed from one version to the other and now getContents() returns null.

    I made sure the id has never changed for PersistentStore.getPersistentObject (id);
    I made sure that we use the same basic sdk (4.3.0)
    I made sure that there are the data stored in the stored hash table

    Currently, it's a hash table - no subclass (even though I know that I should change it to a subclass when it's fixed);

    I wonder if there are any suggestions on what might cause the getContents() return null - or which could result in the PersistentStore have cleared.

    What information is needed, please let me know and I'll paste.

    I found the problem after.

    Classes have begun to obscure differently. If the hash table was still readable, but because he could not read the content of the hash table, he would return null.

    It was unexpected, because if you have a custom class persisted and you try to read it, you will get the content, but you can't cast. But with the hash table, it does not return the content (uncastable) and it throws no exceptions...

    I hope this helps someone else who has a similar problem.

  • The body of the message to return null on os 4.5.0.18. When you use getBodyText()

    Hi all

    Today, when I debug my application on 4.5.0.18 device 8130.

    I implements FolderListener, when new messages coming,.

    I grap message object and want to analyze the body of the message to check if the message is what application you are looking for.

    Hoever, when I call Message.getBodyText (). It returns null.

    In fact, there a lot of message in the body of the message.

    is there any sweet experiencing this problem?

    What is work around?

    Thank you.

    getBodyText() will work on 4.5 If the body is 'plain text '. Otherwise, you will need to get the HTML content of the message and extract the text elements.

    See this article:

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800698/How_To _...

  • Hash table returns null

    It's the stumping me. I add a key and a value in a hash table, pass in the key and retrieve the value. Basic enough, but when I go to retrieve the value a second time (after the restart of the application), it returns null.

    If it isn't exactly the code that would be the basic scheme:

    class A
    {
         private static Hashtable table = new Hashtable();
    
         public static Object getObject(Class clazz)
         }
              return A.table.get(clazz);
         }
    
         public static void setObject(Class clazz, Object obj)
         }
              A.table.put(clazz, obj);
         }
    
         //Code stuff...
    }
    
    class B
    {
         public static void main(String[] args)
         {
              A.setObject(C.class, new C());
              Object obj = A.getObject(C.class); //This works
         }
    
         //Code stuff...
    }
    
    class C
    {
         //Code stuff...
    }
    

    What happens on the 9550 Simulator and is fixed after restarting the Simulator but work always and only the first time through. If the app is closed, then reopened, then it returns null, even if the hash table was always the same items.

    Ah. When you run the application a second time, he rebuilt serializers to persistent store. Unfortunately, your objects of the class are new instances, so that they cannot be used as persistent hash keys. I suggest you use class names as keys rather than objects of class themselves.

  • LocationProvider.getInstance always returns null

    I'm trying to run a slightly modified version of the application on a BlackBerry 7250 GPSDemo. As my device software is version 4.1, I use the BlackBerry JDE 4.1. No matter what are the parameters for the criteria, I pass in LocationProvider.GetInstance, I always return null. I can run google maps on this unit and get my location, so I'm assuming that the GPS is supported in this regard. Did anyone see any problem with code and/or information on the devices below?

    Wireless blackBerry 7250 (CDMA)

    v4.1.0.353 (Platfor 2.2.0.159)

    The kernel v3.8.3.7 encryption

    The microedition configuration: CLDC-1. 1

    Microedition profile: MIDP-2. 0

    Microedition JTWI Version: 1.0

    Microedition Media Version: 1.1

    Microedition PIM Version: 1.0

    Try
    {
    GpsReceiverCriteria criteria = new Criteria();
    gpsReceiverCriteria.setHorizontalAccuracy (Criteria.NO_REQUIREMENT);
    gpsReceiverCriteria.setVerticalAccuracy (Criteria.NO_REQUIREMENT);
    gpsReceiverCriteria.setCostAllowed (true);
    gpsReceiverCriteria.setPreferredPowerConsumption (Criteria.POWER_USAGE_LOW);
    gpsReceiverCriteria.setAddressInfoRequired (false);

    _locationProvider = LocationProvider.getInstance (gpsReceiverCriteria);
               
    If (_locationProvider is nothing)
    {
    Runnable ShowGpsLocationProviderNull1Dialog = new Runnable()
    {
    public void run()
    {
    Dialog.Alert ("Provider is null - HA: NR VA: NR CA:T PC:L");
    }
    };
    invokeLater (showGpsLocationProviderNull1Dialog);  Ask the event dispatcher thread to display the dialog box as soon as POSSIBLE
    }
       
    gpsReceiverCriteria.setHorizontalAccuracy (Criteria.NO_REQUIREMENT);
    gpsReceiverCriteria.setVerticalAccuracy (Criteria.NO_REQUIREMENT);
    gpsReceiverCriteria.setCostAllowed (false);
    gpsReceiverCriteria.setPreferredPowerConsumption (Criteria.POWER_USAGE_LOW);
    gpsReceiverCriteria.setAddressInfoRequired (false);

    _locationProvider = LocationProvider.getInstance (gpsReceiverCriteria);
               
    If (_locationProvider is nothing)
    {
    Runnable ShowGpsLocationProviderNull2Dialog = new Runnable()
    {
    public void run()
    {
    Dialog.Alert ("Provider is null - HA: NR VA: NR CA:F PC:L");
    }
    };
    invokeLater (showGpsLocationProviderNull2Dialog);  Ask the event dispatcher thread to display the dialog box as soon as POSSIBLE
    }

    _locationProvider = LocationProvider.getInstance (null);
               
    If (_locationProvider is nothing)
    {
    We would like to display a dialog box indicating that the GPS is not supported, but because that
    the event dispatcher thread has not been started yet, modal screens cannot be pushed on
    the battery in the display.  So delay the operation until the event dispatcher thread runs
    asking him to call the executable object following as soon as possible.
    Runnable showGpsUnsupportedDialog = new Runnable() {}
    public void run() {}
    Dialog.Alert ("No receiver GPS on this unit is available, exit...");
    System.Exit (1);
    }
    };
    invokeLater (showGpsUnsupportedDialog);  Ask the event dispatcher thread to display the dialog box as soon as POSSIBLE
    }
    on the other
    {
    only a single listener can be associated with a provider and point it comes to the same
    call, but with the value null, so, no need to cache the listener instance
    request an update every second
    _locationProvider.setLocationListener (new LocationListenerImpl(), _interval, 1, 1);
    retval = true;
    }
    } catch (LocationException) {}
    System.Err.println ("Failed to instantiate the object LocationProvider, exit...");
    System.Err.println (the);
    System.Exit (0);
    }

    Oops... sory. My dyslexia again out of in

    I think that the 7250 has no GPS function at all.

    Yet again, Google it didn't need because they have their own turn cells DB and web services to retrieve the "approximate" location

  • BlackBerry smartphone Curve 8900-can you use apps and internet without a SIM (ATT)

    I have a blackberry curve 8900 I bought for cheap thinking I could use it to just WiFi and apps... is true or was a mistake? If it is true, how do I do that?

    How can you check what OS I use... I'm new to blackberry

  • Smartphones blackBerry freeze / hang screen - Curve 8900

    Hi, I have a Curve 8900 which works fine since I bought it 3 years ago. Recently, the screeen began to crash and freeze and its driving me crazy! The usual routine to take out the battery when the unit is on solves the problem temporarily, but then after a short while the problem comes back... Please help... I have zero apps on the device. I have put some photos on the device recently but the memory card still shows 75% of free space! Thank you very much.

    The first thing I recommend is to check what I said in my first reply you above... Make sure you have a solid backup. Given what you describe, your situation may worsen, and data loss is without a doubt a high risk to you now.

    Assuming you're all good in this regard, then then I recommend a full WIPE on the device:

    • B14058 How to delete all data and applications in the smartphone BlackBerry using the security option wipe

    But before you do anything about restoring data or reinstallation of applications, make sure that the problem re-no appears not at 100%. If it is not the case, then you can restore/reinstall. But if so, then more drastic measures are needed, starting with a refill of BONE.

    At the top of each forum device, there should be some 'sticky' threads dealing with the level of the OS available for many models. If they understand your model, please use those as a reference as you go along. Otherwise, you will have to dig through the download portal official for packages of OS for your model:

    From a PC, you can install any compatible OS package (for example, for your BB model exact number) of a BB via this procedure:

    Note Although written to "recharge" and the storm, it can be used to upgrade, downgrade or recharge any BB device model - depends on the operating system package you download and install on your PC. If this OS package comes from one carrier other carrier for which your BB was built, then remove, on your PC, all copies of the SELLER. XML... There will be at least one and maybe 2, and they will be located in the same way or to (it changes based on your version of Windows) these files:

    • C:\Program Files (x 86) \Common Files\Research In Motion\AppLoader
    • C:\Users\(your Windows username) \AppData\Roaming\Research In Motion\BlackBerry\Loader XML

    Don't forget that you remove, since your PC, any other BB OS devices as packages with more than one installed on the PC can cause conflicts with this procedure.

    You can also study the use of BBSAK (bbsak.org) to perform the wipe what he is capable.

    You can also try this procedure might limit the specific causal element:

    1. Load your OS "bare bones"... If everything is optional, do not install it.
    2. If the behavior is immediately, then try another OS with step 1
    3. If the behavior does not immediately, then run for as long as necessary to make you to be sure that the behavior will not occur.
    4. Add one more thing - no matter how tempting, one.
    5. If the behavior does not immediately present, and then runs for long enough to be sure he won't have the same problem
    6. Repeat steps 4 and 5 until all things are responsible or the behavior presents

    When the behavior shows up, you know the culprit... the last thing you have loaded.

    If the behavior doesn't re-present, then you know that step 1 or 2 cured it.

    If the behavior has anything, then you have probably a problem of material level for which no amount of OS or software can heal.

    If you are on a MAC, you are limited to only your sanctioned carriers OS packages... but can still use any level they currently have to sanction. See this procedure:

    • KB19915 How to perform a clean reload of the smartphone BlackBerry using BlackBerry Desktop Software application software

    Good luck and let us know!

  • BlackBerry Smartphones lack of support for the Curve 8900 and storm in terms of theme generator

    Hard looking for workaround to export or even begin to create a theme with 480 x360, for what is now, I always come back on the ' wait for 4.7. But customers are now screaming.

    Second thing: change the media screen, as you may have noticed, the media screen never changes regardless how the theme looks like.

    I would like to wish you a happy new year, make me happy to and provide me with useful content, so that I'll be there in your place to support others.

    Are you talking about the toolkit of Plazmic?
    If so, you should post on their own forum.
    https://www.Plazmic.com/PlazmicForum/index.jspa

    other wise, I do not know... Curve 8900 and Bold shouldn't be so different?

    Anyway, things always take time with new devices. lack of device, not enough supply to Accessories, compatibility Media Sync available several days after that a device is released...

Maybe you are looking for

  • Whenever I try to get new messages from the server, the Thunderbird shows that I have 20, but bring the same message

    I have the yahoo account on my mobile phone with the same configuration.Both devices worked well until last week, when the Thunderbird was unable to receive new messages.It shows that I have 20 messages and after download, the last message I received

  • Cannot open requested popups

    Last week, I started having a problem at the opening of the requested popups. (As in, clicking a button to leave a comment on a blog or on pinterest "pin" button, when after clicking on them, a pop up window should open.) I downloaded the latest vers

  • PC HP Compaq 8000 Elite: Hard drive of PC HP Compaq 8000 Elite

    I want to spend the hard drive in my 8000 Elite.  It seems that all are 6 GB/s (SATA 3) these days.  Seagate said I'm looking at that will work if my computer is not 6 G/s if the controller supports the SATA speed autonegotiation. question 1: what is

  • stuck on a beep

    using a new iPad pro and have updated since a backup of my old iPad and find that the alert for new mail is stuck on the sound of duck and although I change it remains the same. GH

  • Bluetooth does not work on my MS P100

    Hey guys I recently bought a tosh Saturday. PR0 p100... and since ive got it the bluetooth didn't work... now I know theres bluetooth coz its in specifications and ive reinstakked the bluetooth stack and bluetooth monitor... I went rooting in the flo