You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Filip Maj <fi...@adobe.com> on 2012/10/23 20:40:59 UTC

Camera API error codes?

So, our camera API doesn't have error codes. Per the docs, it returns a
string [1]. Gnarly.

The strings are also all different across platforms. Android [2] and iOS
[3] (search for "error").

For extra-good times, BlackBerry-webworks-java [4] does not ever return an
error, except in the case where the file is deemed "too big" [5]. So, if
the camera app is closed, we don't return an error code back to the user
for this platform, which is different from iOS + Android.

BlackBerry-webworks-air registers JS-based callbacks using the BB HTML5
transport API [6]. Unfortunately I can't find documentation about what
kind of parameters are passed into the error callbacks (anyone from RIM
help me out?). Finally, if the camera is closed, no callback gets invoked
either [7], which is at odds with Android + iOS.

BlackBerry 10 implementation [8] no-ops the onCancel and onInvoke
callbacks as well, which again, is at odds.

---

Proposal: add error codes.

[1] 
http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraError
[2] 
https://github.com/apache/incubator-cordova-android/blob/master/framework/s
rc/org/apache/cordova/CameraLauncher.java#L352-L363
[3] 
https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Clas
ses/CDVCamera.m#L80
[4] 
https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
/framework/ext/src/org/apache/cordova/camera/Camera.java
[5] 
https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
/framework/ext/src/org/apache/cordova/camera/Camera.java#L225
[6] 
https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
/plugin/air/camera.js
[7] 
https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
/plugin/air/camera.js#L27
[8] 
https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/qnx
/plugin/qnx/camera.js


Re: Camera API error codes?

Posted by Brian LeRoux <b...@brian.io>.
API rework aim is to start after November.

On Wed, Oct 24, 2012 at 2:02 PM, Shazron <sh...@gmail.com> wrote:
> Do we know when the API rework is scheduled?
>
> On Wed, Oct 24, 2012 at 1:59 PM, Filip Maj <fi...@adobe.com> wrote:
>> Should we slate this for the API rework or get to it sooner?
>>
>> On 10/23/12 1:07 PM, "Tim Kim" <ti...@gmail.com> wrote:
>>
>>>+1
>>>
>>>On 23 October 2012 11:55, Shazron <sh...@gmail.com> wrote:
>>>
>>>> +1
>>>>
>>>> On Tue, Oct 23, 2012 at 11:51 AM, Simon MacDonald
>>>> <si...@gmail.com> wrote:
>>>> > +1 to adding error codes
>>>> > +1 to cancel being reported by the error callback
>>>> >
>>>> > You may want to check out what Capture uses for error codes.
>>>> >
>>>> >
>>>>
>>>>http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#C
>>>>aptureError
>>>> >
>>>> > Simon Mac Donald
>>>> > http://hi.im/simonmacdonald
>>>> >
>>>> >
>>>> > On Tue, Oct 23, 2012 at 2:40 PM, Filip Maj <fi...@adobe.com> wrote:
>>>> >
>>>> >> So, our camera API doesn't have error codes. Per the docs, it
>>>>returns a
>>>> >> string [1]. Gnarly.
>>>> >>
>>>> >> The strings are also all different across platforms. Android [2] and
>>>>iOS
>>>> >> [3] (search for "error").
>>>> >>
>>>> >> For extra-good times, BlackBerry-webworks-java [4] does not ever
>>>>return
>>>> an
>>>> >> error, except in the case where the file is deemed "too big" [5].
>>>>So, if
>>>> >> the camera app is closed, we don't return an error code back to the
>>>>user
>>>> >> for this platform, which is different from iOS + Android.
>>>> >>
>>>> >> BlackBerry-webworks-air registers JS-based callbacks using the BB
>>>>HTML5
>>>> >> transport API [6]. Unfortunately I can't find documentation about
>>>>what
>>>> >> kind of parameters are passed into the error callbacks (anyone from
>>>>RIM
>>>> >> help me out?). Finally, if the camera is closed, no callback gets
>>>> invoked
>>>> >> either [7], which is at odds with Android + iOS.
>>>> >>
>>>> >> BlackBerry 10 implementation [8] no-ops the onCancel and onInvoke
>>>> >> callbacks as well, which again, is at odds.
>>>> >>
>>>> >> ---
>>>> >>
>>>> >> Proposal: add error codes.
>>>> >>
>>>> >> [1]
>>>> >>
>>>>
>>>>http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraErr
>>>>or
>>>> >> [2]
>>>> >>
>>>>
>>>>https://github.com/apache/incubator-cordova-android/blob/master/framework
>>>>/s
>>>> >> rc/org/apache/cordova/CameraLauncher.java#L352-L363
>>>> >> [3]
>>>> >>
>>>>
>>>>https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Cl
>>>>as
>>>> >> ses/CDVCamera.m#L80
>>>> >> [4]
>>>> >>
>>>>
>>>>https://github.com/apache/incubator-cordova-blackberry-webworks/blob/mast
>>>>er
>>>> >> /framework/ext/src/org/apache/cordova/camera/Camera.java
>>>> >> [5]
>>>> >>
>>>>
>>>>https://github.com/apache/incubator-cordova-blackberry-webworks/blob/mast
>>>>er
>>>> >> /framework/ext/src/org/apache/cordova/camera/Camera.java#L225
>>>> >> [6]
>>>> >>
>>>>
>>>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/a
>>>>ir
>>>> >> /plugin/air/camera.js
>>>> >> [7]
>>>> >>
>>>>
>>>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/a
>>>>ir
>>>> >> /plugin/air/camera.js#L27
>>>> >> [8]
>>>> >>
>>>>
>>>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/q
>>>>nx
>>>> >> /plugin/qnx/camera.js
>>>> >>
>>>> >>
>>>>
>>>
>>>
>>>
>>>--
>>>Timothy Kim
>>

Re: Camera API error codes?

Posted by Shazron <sh...@gmail.com>.
Do we know when the API rework is scheduled?

On Wed, Oct 24, 2012 at 1:59 PM, Filip Maj <fi...@adobe.com> wrote:
> Should we slate this for the API rework or get to it sooner?
>
> On 10/23/12 1:07 PM, "Tim Kim" <ti...@gmail.com> wrote:
>
>>+1
>>
>>On 23 October 2012 11:55, Shazron <sh...@gmail.com> wrote:
>>
>>> +1
>>>
>>> On Tue, Oct 23, 2012 at 11:51 AM, Simon MacDonald
>>> <si...@gmail.com> wrote:
>>> > +1 to adding error codes
>>> > +1 to cancel being reported by the error callback
>>> >
>>> > You may want to check out what Capture uses for error codes.
>>> >
>>> >
>>>
>>>http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#C
>>>aptureError
>>> >
>>> > Simon Mac Donald
>>> > http://hi.im/simonmacdonald
>>> >
>>> >
>>> > On Tue, Oct 23, 2012 at 2:40 PM, Filip Maj <fi...@adobe.com> wrote:
>>> >
>>> >> So, our camera API doesn't have error codes. Per the docs, it
>>>returns a
>>> >> string [1]. Gnarly.
>>> >>
>>> >> The strings are also all different across platforms. Android [2] and
>>>iOS
>>> >> [3] (search for "error").
>>> >>
>>> >> For extra-good times, BlackBerry-webworks-java [4] does not ever
>>>return
>>> an
>>> >> error, except in the case where the file is deemed "too big" [5].
>>>So, if
>>> >> the camera app is closed, we don't return an error code back to the
>>>user
>>> >> for this platform, which is different from iOS + Android.
>>> >>
>>> >> BlackBerry-webworks-air registers JS-based callbacks using the BB
>>>HTML5
>>> >> transport API [6]. Unfortunately I can't find documentation about
>>>what
>>> >> kind of parameters are passed into the error callbacks (anyone from
>>>RIM
>>> >> help me out?). Finally, if the camera is closed, no callback gets
>>> invoked
>>> >> either [7], which is at odds with Android + iOS.
>>> >>
>>> >> BlackBerry 10 implementation [8] no-ops the onCancel and onInvoke
>>> >> callbacks as well, which again, is at odds.
>>> >>
>>> >> ---
>>> >>
>>> >> Proposal: add error codes.
>>> >>
>>> >> [1]
>>> >>
>>>
>>>http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraErr
>>>or
>>> >> [2]
>>> >>
>>>
>>>https://github.com/apache/incubator-cordova-android/blob/master/framework
>>>/s
>>> >> rc/org/apache/cordova/CameraLauncher.java#L352-L363
>>> >> [3]
>>> >>
>>>
>>>https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Cl
>>>as
>>> >> ses/CDVCamera.m#L80
>>> >> [4]
>>> >>
>>>
>>>https://github.com/apache/incubator-cordova-blackberry-webworks/blob/mast
>>>er
>>> >> /framework/ext/src/org/apache/cordova/camera/Camera.java
>>> >> [5]
>>> >>
>>>
>>>https://github.com/apache/incubator-cordova-blackberry-webworks/blob/mast
>>>er
>>> >> /framework/ext/src/org/apache/cordova/camera/Camera.java#L225
>>> >> [6]
>>> >>
>>>
>>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/a
>>>ir
>>> >> /plugin/air/camera.js
>>> >> [7]
>>> >>
>>>
>>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/a
>>>ir
>>> >> /plugin/air/camera.js#L27
>>> >> [8]
>>> >>
>>>
>>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/q
>>>nx
>>> >> /plugin/qnx/camera.js
>>> >>
>>> >>
>>>
>>
>>
>>
>>--
>>Timothy Kim
>

Re: Camera API error codes?

Posted by Filip Maj <fi...@adobe.com>.
Should we slate this for the API rework or get to it sooner?

On 10/23/12 1:07 PM, "Tim Kim" <ti...@gmail.com> wrote:

>+1
>
>On 23 October 2012 11:55, Shazron <sh...@gmail.com> wrote:
>
>> +1
>>
>> On Tue, Oct 23, 2012 at 11:51 AM, Simon MacDonald
>> <si...@gmail.com> wrote:
>> > +1 to adding error codes
>> > +1 to cancel being reported by the error callback
>> >
>> > You may want to check out what Capture uses for error codes.
>> >
>> >
>> 
>>http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#C
>>aptureError
>> >
>> > Simon Mac Donald
>> > http://hi.im/simonmacdonald
>> >
>> >
>> > On Tue, Oct 23, 2012 at 2:40 PM, Filip Maj <fi...@adobe.com> wrote:
>> >
>> >> So, our camera API doesn't have error codes. Per the docs, it
>>returns a
>> >> string [1]. Gnarly.
>> >>
>> >> The strings are also all different across platforms. Android [2] and
>>iOS
>> >> [3] (search for "error").
>> >>
>> >> For extra-good times, BlackBerry-webworks-java [4] does not ever
>>return
>> an
>> >> error, except in the case where the file is deemed "too big" [5].
>>So, if
>> >> the camera app is closed, we don't return an error code back to the
>>user
>> >> for this platform, which is different from iOS + Android.
>> >>
>> >> BlackBerry-webworks-air registers JS-based callbacks using the BB
>>HTML5
>> >> transport API [6]. Unfortunately I can't find documentation about
>>what
>> >> kind of parameters are passed into the error callbacks (anyone from
>>RIM
>> >> help me out?). Finally, if the camera is closed, no callback gets
>> invoked
>> >> either [7], which is at odds with Android + iOS.
>> >>
>> >> BlackBerry 10 implementation [8] no-ops the onCancel and onInvoke
>> >> callbacks as well, which again, is at odds.
>> >>
>> >> ---
>> >>
>> >> Proposal: add error codes.
>> >>
>> >> [1]
>> >>
>> 
>>http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraErr
>>or
>> >> [2]
>> >>
>> 
>>https://github.com/apache/incubator-cordova-android/blob/master/framework
>>/s
>> >> rc/org/apache/cordova/CameraLauncher.java#L352-L363
>> >> [3]
>> >>
>> 
>>https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Cl
>>as
>> >> ses/CDVCamera.m#L80
>> >> [4]
>> >>
>> 
>>https://github.com/apache/incubator-cordova-blackberry-webworks/blob/mast
>>er
>> >> /framework/ext/src/org/apache/cordova/camera/Camera.java
>> >> [5]
>> >>
>> 
>>https://github.com/apache/incubator-cordova-blackberry-webworks/blob/mast
>>er
>> >> /framework/ext/src/org/apache/cordova/camera/Camera.java#L225
>> >> [6]
>> >>
>> 
>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/a
>>ir
>> >> /plugin/air/camera.js
>> >> [7]
>> >>
>> 
>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/a
>>ir
>> >> /plugin/air/camera.js#L27
>> >> [8]
>> >>
>> 
>>https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/q
>>nx
>> >> /plugin/qnx/camera.js
>> >>
>> >>
>>
>
>
>
>-- 
>Timothy Kim


Re: Camera API error codes?

Posted by Tim Kim <ti...@gmail.com>.
+1

On 23 October 2012 11:55, Shazron <sh...@gmail.com> wrote:

> +1
>
> On Tue, Oct 23, 2012 at 11:51 AM, Simon MacDonald
> <si...@gmail.com> wrote:
> > +1 to adding error codes
> > +1 to cancel being reported by the error callback
> >
> > You may want to check out what Capture uses for error codes.
> >
> >
> http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#CaptureError
> >
> > Simon Mac Donald
> > http://hi.im/simonmacdonald
> >
> >
> > On Tue, Oct 23, 2012 at 2:40 PM, Filip Maj <fi...@adobe.com> wrote:
> >
> >> So, our camera API doesn't have error codes. Per the docs, it returns a
> >> string [1]. Gnarly.
> >>
> >> The strings are also all different across platforms. Android [2] and iOS
> >> [3] (search for "error").
> >>
> >> For extra-good times, BlackBerry-webworks-java [4] does not ever return
> an
> >> error, except in the case where the file is deemed "too big" [5]. So, if
> >> the camera app is closed, we don't return an error code back to the user
> >> for this platform, which is different from iOS + Android.
> >>
> >> BlackBerry-webworks-air registers JS-based callbacks using the BB HTML5
> >> transport API [6]. Unfortunately I can't find documentation about what
> >> kind of parameters are passed into the error callbacks (anyone from RIM
> >> help me out?). Finally, if the camera is closed, no callback gets
> invoked
> >> either [7], which is at odds with Android + iOS.
> >>
> >> BlackBerry 10 implementation [8] no-ops the onCancel and onInvoke
> >> callbacks as well, which again, is at odds.
> >>
> >> ---
> >>
> >> Proposal: add error codes.
> >>
> >> [1]
> >>
> http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraError
> >> [2]
> >>
> https://github.com/apache/incubator-cordova-android/blob/master/framework/s
> >> rc/org/apache/cordova/CameraLauncher.java#L352-L363
> >> [3]
> >>
> https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Clas
> >> ses/CDVCamera.m#L80
> >> [4]
> >>
> https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
> >> /framework/ext/src/org/apache/cordova/camera/Camera.java
> >> [5]
> >>
> https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
> >> /framework/ext/src/org/apache/cordova/camera/Camera.java#L225
> >> [6]
> >>
> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
> >> /plugin/air/camera.js
> >> [7]
> >>
> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
> >> /plugin/air/camera.js#L27
> >> [8]
> >>
> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/qnx
> >> /plugin/qnx/camera.js
> >>
> >>
>



-- 
Timothy Kim

Re: Camera API error codes?

Posted by Shazron <sh...@gmail.com>.
+1

On Tue, Oct 23, 2012 at 11:51 AM, Simon MacDonald
<si...@gmail.com> wrote:
> +1 to adding error codes
> +1 to cancel being reported by the error callback
>
> You may want to check out what Capture uses for error codes.
>
> http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#CaptureError
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Tue, Oct 23, 2012 at 2:40 PM, Filip Maj <fi...@adobe.com> wrote:
>
>> So, our camera API doesn't have error codes. Per the docs, it returns a
>> string [1]. Gnarly.
>>
>> The strings are also all different across platforms. Android [2] and iOS
>> [3] (search for "error").
>>
>> For extra-good times, BlackBerry-webworks-java [4] does not ever return an
>> error, except in the case where the file is deemed "too big" [5]. So, if
>> the camera app is closed, we don't return an error code back to the user
>> for this platform, which is different from iOS + Android.
>>
>> BlackBerry-webworks-air registers JS-based callbacks using the BB HTML5
>> transport API [6]. Unfortunately I can't find documentation about what
>> kind of parameters are passed into the error callbacks (anyone from RIM
>> help me out?). Finally, if the camera is closed, no callback gets invoked
>> either [7], which is at odds with Android + iOS.
>>
>> BlackBerry 10 implementation [8] no-ops the onCancel and onInvoke
>> callbacks as well, which again, is at odds.
>>
>> ---
>>
>> Proposal: add error codes.
>>
>> [1]
>> http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraError
>> [2]
>> https://github.com/apache/incubator-cordova-android/blob/master/framework/s
>> rc/org/apache/cordova/CameraLauncher.java#L352-L363
>> [3]
>> https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Clas
>> ses/CDVCamera.m#L80
>> [4]
>> https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
>> /framework/ext/src/org/apache/cordova/camera/Camera.java
>> [5]
>> https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
>> /framework/ext/src/org/apache/cordova/camera/Camera.java#L225
>> [6]
>> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
>> /plugin/air/camera.js
>> [7]
>> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
>> /plugin/air/camera.js#L27
>> [8]
>> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/qnx
>> /plugin/qnx/camera.js
>>
>>

Re: Camera API error codes?

Posted by Simon MacDonald <si...@gmail.com>.
+1 to adding error codes
+1 to cancel being reported by the error callback

You may want to check out what Capture uses for error codes.

http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#CaptureError

Simon Mac Donald
http://hi.im/simonmacdonald


On Tue, Oct 23, 2012 at 2:40 PM, Filip Maj <fi...@adobe.com> wrote:

> So, our camera API doesn't have error codes. Per the docs, it returns a
> string [1]. Gnarly.
>
> The strings are also all different across platforms. Android [2] and iOS
> [3] (search for "error").
>
> For extra-good times, BlackBerry-webworks-java [4] does not ever return an
> error, except in the case where the file is deemed "too big" [5]. So, if
> the camera app is closed, we don't return an error code back to the user
> for this platform, which is different from iOS + Android.
>
> BlackBerry-webworks-air registers JS-based callbacks using the BB HTML5
> transport API [6]. Unfortunately I can't find documentation about what
> kind of parameters are passed into the error callbacks (anyone from RIM
> help me out?). Finally, if the camera is closed, no callback gets invoked
> either [7], which is at odds with Android + iOS.
>
> BlackBerry 10 implementation [8] no-ops the onCancel and onInvoke
> callbacks as well, which again, is at odds.
>
> ---
>
> Proposal: add error codes.
>
> [1]
> http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraError
> [2]
> https://github.com/apache/incubator-cordova-android/blob/master/framework/s
> rc/org/apache/cordova/CameraLauncher.java#L352-L363
> [3]
> https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Clas
> ses/CDVCamera.m#L80
> [4]
> https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
> /framework/ext/src/org/apache/cordova/camera/Camera.java
> [5]
> https://github.com/apache/incubator-cordova-blackberry-webworks/blob/master
> /framework/ext/src/org/apache/cordova/camera/Camera.java#L225
> [6]
> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
> /plugin/air/camera.js
> [7]
> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/air
> /plugin/air/camera.js#L27
> [8]
> https://github.com/apache/incubator-cordova-js/blob/master/lib/webworks/qnx
> /plugin/qnx/camera.js
>
>