views:

19

answers:

2

Hi, I am developing a J2me app which uses the camera to take a snapshot and then decodes it (using Zxing library). The target is Nokia phones.

I need to use the focus to have a clear image, if not, it is difficult to decode the image.

Since the series 40, the control "videocontrol" and "SnapShopControl" are available. I thought that for the "FocusControl" it was the same, but it isn't.

I discovered that it is almost inexistent not only for the series 40 (only some phones) but (more surprisingly) for the series 60 and symbian 3.

U can see that: http://wiki.forum.nokia.com/index.php/Java_ME_API_support_on_Nokia_devices

Theses mobile phones support JSR-234 but for audio and music, not for camera.

As you can imagine, this is very deceiving, Nokia is not doing their work well.

Did you find any solution? Perhaps another "made-by-hand" control? I am afraid I had to start programming in C++ because I haven't got much time.

A: 

Many phones just don't support focus by their HW. Some SE phones (e.g. G502) support FocusControl, but they don't allow to do anything because the HW does not support it.

I'm afraid to say that you can do probably nothing with thist problem in J2ME.

If the phones support focus control, but it is not availble in J2ME, there are probably two ways how to solve it:

  • Let user to use builtin camera and load it (preferably the last photo) from Camera album.
  • Try to use Camera focus from a S60 API.

Note that I'm not a S60 developer.

v6ak
A: 

The solution has been to use Api Bridge of Nokia. You can access the software is installed in the phone for the camera and if it is able to use the autofocus, you can use it, and it returns the image you take.

http://www.forum.nokia.com/info/sw.nokia.com/id/d697a64f-ddae-4937-8151-be157b542d26/ApiBridge.html

The implementation is easy (you install the sis for the apibridge in the device, you can package your app and this sis together).

You use the following code:

    APIBridge  bridge = APIBridge.getInstance();
    bridge.Initialize(midlet);
    NewFileService service = (NewFileService) bridge.createService("service.newfileservice");
    Hashtable filter = new Hashtable();
    filter.put("NewFileType", "Image");
  BridgeResult  res= service.TakePhoto(filter);
netadictos