I *think* this is caused by the Droid/Milestone not liking the default previewFrameRate that Android sets. Try setting that to one of the values specified by getSupportedPreviewFrameRates().
-- Tom Gibara email: m...@tomgibara.com web: http://www.tomgibara.com blog: http://blog.tomgibara.com twitter: tomgibara On 22 June 2010 01:43, Peter Sankauskas <pas...@gmail.com> wrote: > I have the exact same issue - did you ever solve it? > > Peter > > > On May 25, 1:39 am, mscwd01 <mscw...@gmail.com> wrote: > > Surely I cant be the only one to encounter problems with this? > > > > On May 24, 6:19 pm, mscwd01 <mscw...@gmail.com> wrote: > > > > > > > > > > > > > Hey, > > > > > This is my code I use to display a preview from thecameraon a > > > SurfaceView: > > > > > public void surfaceChanged(SurfaceHolder holder, int format, int w, > > > int h) { > > > > > Camera.Parameters parameters = mCamera.getParameters(); > > > List<Size> cameraSizes = > > > CameraReflect.getSupportedPreviewSizes(parameters); > > > if(cameraSizes != null && cameraSizes.size() > 0) { > > > > parameters.setPreviewSize(Math.max(cameraSizes.get(0).width, > > > cameraSizes.get(0).height), Math.min(cameraSizes.get(0).width, > > > cameraSizes.get(0).height)); > > > } > > > else { > > > parameters.setPreviewSize(Math.max(w, h), Math.min(w, > h)); > > > } > > > mCamera.setParameters(parameters); > > > mCamera.startPreview(); > > > > > } > > > > > It's pretty basic stuff; it uses reflection to determine if the > > > version of Android the user is running supports the > > > getSupportedPreviewSizes() method. If it does it obtains the width and > > > height and sets these as the preview size. If the version of Android > > > is older it will just set it as the width and height returned by the > > > SurfaceView. > > > > > However, it seems the Motorola Droid/Milestone doesn't like this code > > > and will instead show a blank screen instead of thecamerapreview. > > > > > Could someone kindly tell me where i'm going wrong? > > > > > 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<android-developers%2bunsubscr...@googlegroups.com> > > > For more options, visit this group athttp:// > groups.google.com/group/android-developers?hl=en > > > > -- > > 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<android-developers%2bunsubscr...@googlegroups.com> > > For more options, visit this group athttp:// > groups.google.com/group/android-developers?hl=en > > -- > 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<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- 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