Re: [android-developers] Re: Camera on HTC Hero: Calling camera.autoFocus(...) gives a IOException .. ?

2010-02-23 Thread Mark Murphy
Streets Of Boston wrote:
> The problem is that when i create this sample project, i cannot be
> sure that it will recreate the problem, since i can't reproduce it.\

Oh, uh, yeah, good point.

> I'll try to get a sample going (a simple camera app that uses
> autofocus) and hopefully this will recreate the problem.

It's worth a shot.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Camera on HTC Hero: Calling camera.autoFocus(...) gives a IOException .. ?

2010-02-22 Thread Streets Of Boston
I understand.

The problem is that when i create this sample project, i cannot be
sure that it will recreate the problem, since i can't reproduce it.

I'll try to get a sample going (a simple camera app that uses
autofocus) and hopefully this will recreate the problem.

Thanks!

On Feb 22, 7:15 pm, Mark Murphy  wrote:
> Streets Of Boston wrote:
> > Can i send you a debug version of my app to your e-mail address?
>
> Well, to be honest, I'd rather you created a little sample project that
> demonstrates the problem, so that:
>
> 1. You can post it tohttp://b.android.com(even though it may be a
> Hero-specific problem, it's probably worthwhile to at least get people
> thinking about it, and it's a good central spot for the issue at least
> temporarily)
>
> 2. I *and others* can test it (remember, I have a pair of strange Hero
> devices, so my tests may not be definitive; conversely, I can also test
> on a Tattoo that doesn't have auto-focus) and experiment with your
> IOException workaround
>
> 3. If we do reproduce the problem and determine it is indeed a Hero or
> HTC thing, that we can get the project to HTC for analysis
>
> I realize your goal is to just get your app working, but my goal is to
> try to document and squash problems like this for everyone. Or at least
> for the subset of everyone who reads this stuff.
>
> So, if you can help us document the problem better, I can help you
> determine if your fix will hold up.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _Beginning Android_ from Apress Now Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Camera on HTC Hero: Calling camera.autoFocus(...) gives a IOException .. ?

2010-02-22 Thread Mark Murphy
Streets Of Boston wrote:
> Can i send you a debug version of my app to your e-mail address?

Well, to be honest, I'd rather you created a little sample project that
demonstrates the problem, so that:

1. You can post it to http://b.android.com (even though it may be a
Hero-specific problem, it's probably worthwhile to at least get people
thinking about it, and it's a good central spot for the issue at least
temporarily)

2. I *and others* can test it (remember, I have a pair of strange Hero
devices, so my tests may not be definitive; conversely, I can also test
on a Tattoo that doesn't have auto-focus) and experiment with your
IOException workaround

3. If we do reproduce the problem and determine it is indeed a Hero or
HTC thing, that we can get the project to HTC for analysis

I realize your goal is to just get your app working, but my goal is to
try to document and squash problems like this for everyone. Or at least
for the subset of everyone who reads this stuff.

So, if you can help us document the problem better, I can help you
determine if your fix will hold up.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Beginning Android_ from Apress Now Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Camera on HTC Hero: Calling camera.autoFocus(...) gives a IOException .. ?

2010-02-22 Thread Streets Of Boston
Thank you for your reply, Mark!

My code checks for the types of focus available on the phone and calls
'autoFocus(...)' only when available and needed. Even so, the SDK
documentation says that for devices that don't have auto-focus, the
callback specified in the call to 'autoFocus(callback)' will be called
immediately as if autofocus has been obtained. Quote from the JavaDoc
on developer.android.com:

"If the camera does not support auto-focus, it is a no-op and
onAutoFocus(boolean, Camera) callback will be called immediately."

However, the link below says the HTC Hero for Sprint has autofocus:
http://www.htc.com/us/products/hero-sprint#tech-specs

Given all this, the IOException should not be thrown... But,
obviously, it is :=)
I patched the issue with catching the IOException and calling
'onAutoFocus(boolean,Camera)' in the catch-clause.

I tested my app thouroughly on the emulator, G1, N1 and a Moto Droid
and spent some time testing it on a Samsung Behold and a Motorola
CLIQ. I haven't had access to a Hero and I have not been able to
reproduce this error myself. Instead, I got one stack-trace e-mailed
to me automatically from a customer running an HTC Hero on Sprint
(users can agree to submit these error-reports/stack-traces
automatically when the app force-closes)

... which means that my patch may not work (i couldn't test it). This
has been the only stack-trace sent to me with this particular problem.
If other customers have HTC Heros, then they haven't encountered the
problem (yet).

I don't use , because my app should work on phone
witouth auto-focus.

Can i send you a debug version of my app to your e-mail address?

Thank you very much for your reply and help, Mark.

-- Anton


On Feb 22, 11:34 am, Mark Murphy  wrote:
> Streets Of Boston wrote:
> > Bump...
> > ... I'm not sure where else to ask this question.
>
> At the same time, at least I don't know how to answer it. I have not
> seen this error, but, then again, I have not tried auto-focus on the
> Hero. To be honest, I wasn't aware it was running an Android version
> where auto-focus was available.
>
> Do you have the  element in your manifest to say you need
> auto-focus?
>
> If you can publish a project that demonstrates the error, upload it
> along with a description of the symptoms tohttp://b.android.com. If you
> think of it, post a link to the issue report here. I have a couple of
> Heros, though they're on kinda squirrelly ROM versions IIRC, so I'm not
> sure my tests will be definitive.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in US: 26-30 April 2010:http://onlc.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Camera on HTC Hero: Calling camera.autoFocus(...) gives a IOException .. ?

2010-02-22 Thread Mark Murphy
Streets Of Boston wrote:
> Bump...
> ... I'm not sure where else to ask this question.

At the same time, at least I don't know how to answer it. I have not
seen this error, but, then again, I have not tried auto-focus on the
Hero. To be honest, I wasn't aware it was running an Android version
where auto-focus was available.

Do you have the  element in your manifest to say you need
auto-focus?

If you can publish a project that demonstrates the error, upload it
along with a description of the symptoms to http://b.android.com. If you
think of it, post a link to the issue report here. I have a couple of
Heros, though they're on kinda squirrelly ROM versions IIRC, so I'm not
sure my tests will be definitive.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in US: 26-30 April 2010: http://onlc.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Camera on HTC Hero: Calling camera.autoFocus(...) gives a IOException .. ?

2010-02-22 Thread Streets Of Boston
Bump...
... I'm not sure where else to ask this question.

On Feb 19, 10:31 am, Streets Of Boston 
wrote:
> I found some posts about not have a preview-callback. But my camera
> does not have a preview-callback set at all. I'm wondering where this
> IOException is coming from. Is it specific to the Hero?
>
> On Feb 18, 7:23 am, Streets Of Boston  wrote:
>
>
>
> > This is the stack trace:
>
> > Android OS: 1.5
> > Model: HERO200
> > Make: heroc:sprint
>
> > Caused by: java.io.IOException: autoFocus failed
> >         at android.hardware.Camera.native_autoFocus(Native Method)
> >         at android.hardware.Camera.autoFocus(Camera.java:313)
> >         at com.streetsofboston.smugdroid.snapfx.camera.SmugCamera
> > $Preview.autoFocus(SmugCamera.java:1492)
>
> > This exception is not documented. The JavaDoc of Camea.autoFocus does
> > not mention this exception at all.
> > How can i prevent this from happening or can i just catch it and
> > continue to instruct the camera to take a picture.
>
> > Thanks!- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Camera on HTC Hero: Calling camera.autoFocus(...) gives a IOException .. ?

2010-02-19 Thread Streets Of Boston
I found some posts about not have a preview-callback. But my camera
does not have a preview-callback set at all. I'm wondering where this
IOException is coming from. Is it specific to the Hero?

On Feb 18, 7:23 am, Streets Of Boston  wrote:
> This is the stack trace:
>
> Android OS: 1.5
> Model: HERO200
> Make: heroc:sprint
>
> Caused by: java.io.IOException: autoFocus failed
>         at android.hardware.Camera.native_autoFocus(Native Method)
>         at android.hardware.Camera.autoFocus(Camera.java:313)
>         at com.streetsofboston.smugdroid.snapfx.camera.SmugCamera
> $Preview.autoFocus(SmugCamera.java:1492)
>
> This exception is not documented. The JavaDoc of Camea.autoFocus does
> not mention this exception at all.
> How can i prevent this from happening or can i just catch it and
> continue to instruct the camera to take a picture.
>
> Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en