BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Developer Forum (http://www.blackberryforums.com/forumdisplay.php?f=15)
-   -   Access Camera (http://www.blackberryforums.com/showthread.php?t=115273)

goulamass 01-30-2008 08:00 AM

Access Camera
 
Hi everyone,

I'm a French student doing a placement.

I work on a BB 8310.

I have to make some applications.

For one of them I hava to launch the camera , take a picture and make other process before the end.

I know how to launch the camera with :

Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());

But the camera stay on the screen and allow to take as many pictures as I want. And when I press escape I have the other process processing.

I know that I have to lose control after the invoke.

"Note: Calling Invoke.invokeApplication(int, ApplicationArguments) results in a process context switch. When
the BlackBerry application is started, your application loses control. When the started application session ends, context
might not return to your application."

My question is how can I take the hand after the first picture and how can I recover this picture.

Thanks

jfisher 01-30-2008 08:26 AM

i think this answers your question:

Disclaimer

there are already lots of threads about this - use the search function

goulamass 01-30-2008 08:32 AM

Sorry I didn't see that is the same forum.

jfisher 01-30-2008 08:49 AM

it's not but they're pretty much the only two for dev help. answering your query would only reiterate what's already been covered before.

and hello!

goulamass 01-30-2008 08:59 AM

I know.

But as I want answers , I try to have a maximun of contacts.

If I obtains an answers or if I do it by myself , should I post it on the both forums or only on one of them??

simon.hain 01-30-2008 11:42 AM

it would be polite to post a solution to an open question in the other forum as there is no follow-up on crossposting.

goulamass 01-31-2008 07:44 AM

I have no answer on the other forum.

Anyone here have an idea???

goulamass 01-31-2008 09:50 AM

In fact I will let users to take a picture and press return after.

But now I try to access the last picture taken and I search a lot and I don't find how I can access the multimedia repertory.

I find this :

RIM Device Java Library

But even if I learn a lot of intersting things I don't find method to access multimedia.

I just want a clue.

Thanks

goulamass 01-31-2008 10:01 AM

Perhaps I find a solution.

What do you think about using "Class FileSystemJournalEntry" and take the path to recover the picture???

I will try this.

If anyone have an another idea or just think that I'm wrong , tell me.

If I will be right and if it'll work I will tell you.

goulamass 01-31-2008 12:03 PM

All right.

goulamass 01-31-2008 12:05 PM

Sorry for the spam with just all right.

I click on the wrong button.

So I do what I want.

I have to correct my code and I will post you some parts to allow you to understand what I did and why it's work.

BBDude75 02-15-2008 11:57 AM

Invoke
 
Were you able to resolve the issue?
Getting the control back to your application after invoking the camera application.

goulamass 02-18-2008 03:05 AM

Not yet as I answered your pm.

First I have to work on a web service for an another application.

As soon I finish I will work again on it.

If you find before me thanks to tell us the solution

jhaehnle 02-18-2008 05:08 AM

Hi,

im working on the same stuff....
Probelm for me is to close the cam app after taking a picture...
Tried to use EventInjector Class but resulted in null pointer exception.
Device is enterprise activated....

Are there any other clues to solve the camera app closing problem?

Best regards,
Jochen

goulamass 02-21-2008 03:52 AM

I don't find yet the solution that we want.

I will try a lot of things today.

I tell you if I find

goulamass 02-22-2008 08:35 AM

Does someone find a solution???

goulamass 03-03-2008 10:23 AM

All rights.

I find a solution.

If you have any question ask me.

In fact I just add it :

// Try to kill camera app here by injecting esc.
EventInjector.KeyEvent inject =new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_ DOWN,Characters.ESCAPE,0,50);
inject.post();
inject.post();

netomarin 06-27-2008 02:53 PM

Hi all,

After reading this post, I've created a midlet with this Invoke to use camera
And, when the user press the softkey Camera I execute the follow code:

Code:

if ( c.equals(cmdCamera)) {
    //invoking camera
    Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());
    // Try to kill camera app here by injecting esc.
    EventInjector.KeyEvent inject = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN,Characters.ESCAPE,0,50);
    inject.post();
    inject.post();
}

But, when I tried on emulador I got a Runtime Error. Does anyone have any idea?

Thanks
Neto Marin

goulamass 06-30-2008 03:33 AM

Hum it's not the way to do this.

You have to setup a fileJournalEntry.

I think that this will help you:

Code:

if ( c.equals(cmdCamera)) {
    //invoking camera
    Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());

for ( long i = USN ; i >=0 ; i--)
{
    FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);

    if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED || entry.getEvent() == FileSystemJournalEntry.FILE_CHANGED || entry.getEvent() == FileSystemJournalEntry.FILE_RENAMED)
    {
        addr = entry.getPath();

        if (addr.indexOf(".jpg") != -1)
      {
          // Try to kill camera app here by injecting esc.
          EventInjector.KeyEvent inject = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN,Characters.ESCAPE, , 50);
        inject.post();
        inject.post();
    }
  }

  if (entry == null)
  {
    // we didn't find an entry.
    break;
  }
}



All times are GMT -5. The time now is 01:10 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.