[android-developers] Re: Camera Application Not Working When I Test on My Phone

2010-09-27 Thread als
Sorry that it's really late and you might not need an answer anymore,
but I've just read this thread.
Maybe your problem is the preview format parameter. Format YUV_422_SP
is not valid in my Motorola Milestone and could be not valid in your
HTC neither. Just try with YUV_420_SP. Is it working now?

-- 
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: getPreviewSize() bad result on Froyo emulator

2010-08-27 Thread als
Yesterday I tried that buffered methods in a real device (HTC Desire)
and it didn't work either. Now I'm wondering if I use it the wrong
way. My code is this:

Parameters params = mCamera.getParameters();
mPixelFormat = PixelFormat.YCbCr_420_SP;
params.setPreviewFormat(mPixelFormat);
mCamera.setParameters(params);

Size previewSize = mCamera.getParameters().getPreviewSize();
int bytesPerPixel = ImageFormat.getBitsPerPixel(mPixelFormat);
int bufferSize = Math.round(bytesPerPixel/8.0f * previewSize.height *
previewSize.width);
byte[] buffer = new byte[bufferSize];
mCamera.addCallbackBuffer(buffer);

Is that code ok? Again, if I hardcode the buffer size (in the Desire
case 800*480*2) it works well. could anyone make that methods work?

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


[android-developers] Re: JDOM in Android 2.1 or earlier

2010-08-27 Thread als
Thanks for the answer. I agree JDOM is slower and uses lot more memory
than a SAX parser, but we already have the implementation in JDOM, and
we wanted to reuse it, at least for the moment. Reuse is allways
faster and in software development you never have enough time. If we
finish the project soon we'll think about develop another parser.

By the way, in the first link i wrote ( 
http://code.google.com/p/android-rome-feed-reader/
) they patched JDOM 1.1.1 and now it's working ok. 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


[android-developers] Re: JDOM in Android 2.1 or earlier

2010-08-26 Thread als
Nobody could do it?

I'm going to do some tests changing the input xml, adding aliases for
namespaces and so on. Maybe that exception appears only in some cases
and I can make it work.

-- 
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] JDOM in Android 2.1 or earlier

2010-08-20 Thread als
Hi all,

I was trying to use JDOM to parse a response from my REST web service,
when it threw a StringIndexOutOfBoundsException. I dug into the code
and I found that Exception is thrown in a substring method when the
JDOM is trying to recover something like a property name. I did a
little search in the Internet about it and I found it's a known bug:
http://code.google.com/p/android-rome-feed-reader/
http://www.jdom.org/pipermail/jdom-interest/2009-July/016346.html

So, has anybody been able to parse a document using JDOM in Android
2.1?

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


[android-developers] getPreviewSize() bad result on Froyo emulator

2010-08-18 Thread als
Hello all,

I was trying to use some of the new camera methods included in Froyo,
i.e. setPreviewCallbackWithBuffer()  addCallbackBuffer(). In the
documentation it's said you need first to create a buffer of
appropriated size and use the addCallbackBuffer() method. The buffer
size must be width * height * bits_per_pixel or otherwise you'll never
receive a preview frame. To know the image size, you can ask to the
camera about it's configuration. When I'm trying to configurate the
camera I use Camera.getParameters().getPreviewSize() the emulator says
the size is 320*240, but with that size it didn't work on emulator. I
used the old setPreviewCallback() and, in the onPreviewFrame(), I
asked the size again. That time the size was 480*320. Then I hard-
coded that values in the first code and everything worked.
Now I'm afraid not only the emulator would have that behaviour.
Unfortunately I don't have any real device with Froyo and I can't try
it. So, anyone have tried that methods in real devices? btw, are they
really increasing the poor performance and frame rate?

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


[android-developers] Hide camera preview on augmented reality app

2010-03-26 Thread als
Hi all,

I want to develop an augmented reality application, but I'm having
some trouble in the first steps. The first I want to do is to get a
frame with the onPreviewFrame callback, process it, and then draw it
in the screen. Here I want to hide the camera preview, I mean, I don't
want to draw it, but I can't manage to do it. I've been reading some
threads where it's said that simply don't doing
SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS you'll fix it. In the
emulator does work, but in the real device doesn't and the program
crash.

The second question is: Is there a way to overlay a GLSurfaceView on
top of the CameraPreview before the API level 5? I've tried some
methods like GLSurfaceView.bringToFront(), but none of them works. I
would like to do it for android 1.5. Anyway I don't have (yet) a
device with 2.0 or later, and I also don't know if the
setZOrderMediaOverlay method really works in real devices.

Many thanks for your time.

-- 
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.