user
user

Reputation: 6797

J2ME Access To 3G Camera

I have a SE W660 and I would like to take a snapshot from the 3G camera (which is on the front, and not on the back).

Is there any way to do that?

Upvotes: 1

Views: 732

Answers (2)

Orr Matarasso
Orr Matarasso

Reputation: 781

It goes something like this:

Player player = Manager.createPlayer("capture://video");
player.realize();
VideoControl vc = (VideoControl) player .getControl("VideoControl");
player.start();
byte[] imageData = vc.getSnapshot(null);
Image snapshot = Image.createImage(imageData, 0, imageData.length);

some more info here

Upvotes: 1

funkybro
funkybro

Reputation: 8671

I don't have access to that device right now. But JSR135 lets you find out all the possible capture options by calling Manager.getSupportedContentTypes("capture"). This will return a string array of capture types. You can then try each one in turn (using Manager.createPlayer("capture://" + <capture string>)) and see if one of them corresponds to the front camera.

If it helps, on Nokia S60 the strings "capture://devcam0" and "capture://devcam1" provide access to the main and secondary cameras respectively.

Hope this helps.

Upvotes: 2

Related Questions