On Sun, Jul 22, 2012 at 12:06:30AM -0700, Dianne Hackborn wrote: > Do you have a specific use case where you think they are the right way to > go?
I use them for determining the maximum preview size for the camera preview. Whether that's the right way to go or not, I can't say, but it works nicely, and it's very simple. Just loop through the output of camera.getSupportedPreviewSizes() and pick the last one where the supported width and height are both lower than the display's width and height. The Developer's Guide (at http://developer.android.com/guide/topics/media/camera.html) only says something like "set preview size [etc] here." ... nothing about not using display.width() and display.height() to find the upper limits, and nothing about a different way to do so, either. The book, Pro Android Media, does the same for determining the upper limits for the preview size, and then, as I did, loops through the supported preview sizes to find the max value. It seems to work fine, at least, for the devices I've tested it on. In camera.parameters, there's a getPreferredPreviewSizeForVideo. but that's the ideal size for supporting video recording. I haven't read anything that says that you should just assume that the display size is one of the supported preview sizes, nor would I make such an assumption (though it does at least *appear* to be true). So everything seems to point back to using display.width() and display.height() along with camera.getSupportedPreviewSizes() and a "for" loop to determine the maximum preview size for a given device. So, correct me if I'm wrong, but that would seem to be at least one valid use. And in this case, it seems to be not only the right way, but THE way. Later, --jim -- THE SCORE: ME: 2 CANCER: 0 73 DE N5IAL (/4) MiSTie #49997 < Running Mac OS X Lion > spooky1...@gmail.com ICBM/Hurr.: 30.44406N 86.59909W "The iPad is a status symbol for yuppies. The Android is for people who actually want something that works." Android Apps Listing at http://www.jstrack.org/barcodes.html -- 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