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