Hello there,
i'm no native english speaker, so please bear with me :-)
I'm encountering strange behaviour of RecordControl.commit() on my device:
3720c
V 09.10
It's a S40 6th Edition i think.
I've read through a lot of threads including this one and this one, where the questions are basically the same, but the answers didn't help.
I also know that signing my midlet should do the trick. But i'm not willing to spend money for what i consider a workaround...
----
Short Version: Summary at the end.
----
Long Version:
This snippet (pretty much taken from S40 SDK) is making me trouble:
Multimedia recording and Connections are set to "Ask 1st time". When Midlet starts it asks if the camera may be used, which it should do. But then every single call to commit() triggers a confirmation "Application may send recorded data". When denied it throws a java.io.IOException "Unable to upload data". There is no way of disabling this.Code:ByteArrayOutputStream out = new ByteArrayOutputStream(); Player p = Manager.createPlayer("capture://video"); p.realize(); p.start(); RecordControl rc = (RecordControl)p.getControl("RecordControl"); while (true) { rc.setRecordStream(out); rc.startRecord(); Thread.sleep(500); rc.commit(); out.reset(); }
MMAPI documention mentions two seperate checks. What really bugs me though is that some changes avoid the confirmation:
1. Changing the locator to "capture://audio" - therefor recording audio only - does not trigger the confirmation.
2. So the intention might be to limit recording of visual data. But that's not true since the following snippet (again taken from S40 SDK) also won't trigger the confirmation:
This snippets also asks if cam may be used, but then keeps taking snapshots without any further nagging.Code:Player p = Manager.createPlayer("capture://image"); p.realize(); p.start(); //create video control: VideoControl videoControl = (VideoControl)p.getControl("VideoControl"); videoControl.initDisplayMode(GUIControl.USE_GUI_PRIMITIVE, null); while (true) { videoControl.getSnapshot(null); }
I do see that the recording mechanics are different, but i do not see any reason why the 1st snippet should trigger a confirmation that cannot be disabled (and totally negates what i'm planning to do), while the 2nd does no such things. Both snippets do the same: record visual data from the camera. So they should be subject to the same permissions, right?
To sum it up:
1. Recording permissions - esp. concerning RecordControl.commit() - are inconsistent IMHO. It lets me record audio and take snapshots with only the "Camera-Permission", but recording video requires Camera- and Upload-Permission. I can't see any sort of intention behind this behaviour. Also, denying the upload throws an IOException, but shouldnt it throw a SecurityException?
Am i getting it wrong and it works as intened? Or did i stumble across a glitch.
2. Upload-Permission cannot be set to "Ask 1st time", and thats a real killer. Is there a way to avoid the endless confirmations - besides signing the app?
Best regards, thanks for reading,
Julian

Reply With Quote

