Thursday, May 20, 2010, 9:59:48 PM, you wrote:
> Thursday, May 20, 2010, 2:57:50 PM, you wrote: >> On May 19, 8:56 pm, Robert Fejer <[email protected]> wrote: >>> When I try to use MediaRecorder.setParameters(), Eclipse is >>> complaining, as there is no official setParameters() method in >>> MediaRecorder. >>> >>> Anybody knows how to get around this problem? >> For APIs like this that are simply unpublished, you can use >> reflection. It's the same technique you use to access object methods >> in later versions of the API while still maintaining compatibility >> with earlier versions, discussed here: >> http://developer.android.com/resources/articles/backward-compatibility.html >> Keep in mind that unpublished methods are not guaranteed to exist on >> all devices (as I understand it), so make sure your code doesn't rely >> on setParameters(). IOW, ensure that your code will degrade gracefully >> if it's running on a device where that method really doesn't exist. > Thanks for the suggestion! I already use reflection to access some > methods introduced in API 5, so it makes sense to use reflection for > unpublished methods, too. > Initial tests are promising, and I now need to test if the video > quality indeed improves in various real life situations. I can confirm now that video quality improves dramatically, and I've just released the new version of my app with these improvements. The newly available API 8 introduced setVideoEncodingBitRate() http://developer.android.com/reference/android/media/MediaRecorder.html#setVideoEncodingBitRate%28int%29 It is not exactly in the form as the previously unpublished method, but at least it is now available :) I still need to use reflection, as with any newly introduced methods. Robert -- DailyRoads - upload your journeys http://www.dailyroads.com/voyager -- You received this message because you are subscribed to the Google Groups "Android Discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/android-discuss?hl=en.
