Bug 12736 - API level 17 is missing android.media.AudioManager.getProperty() and associated constants
Summary: API level 17 is missing android.media.AudioManager.getProperty() and associat...
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.7.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-06-18 11:54 UTC by Andrew Fernandes
Modified: 2013-06-18 13:57 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Andrew Fernandes 2013-06-18 11:54:03 UTC
With Xamarin Studio 4.0.9 and Xamarin.Android 4.7.9.

Using a fresh "Android ICS Application" template, with Target API set to 17 and Minimum API set to 15.

Android.Media.AudioManager is missing the API-17 method 'getPropery()' method.

Also missing are the API-17 'AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE' and 'AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER' properties, among others.

These are needed to query the low-latency audio parameters for API-17 and beyond, according to the NDK docs.
Comment 1 Jonathan Pryor 2013-06-18 13:10:40 UTC
Is it missing? It's there for me in 4.7.8-4, which is minimally different from 4.7.9:

> $ monop -r:/Library/Frameworks/Xamarin.Android.framework/Versions/4.7.8-4/lib/mandroid/platforms/android-17/Mono.Android.dll Android.Media.AudioManager | grep Property
> 	public virtual string GetProperty (string key);
> 	public const string PropertyOutputFramesPerBuffer = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
> 	public const string PropertyOutputSampleRate = "android.media.property.OUTPUT_SAMPLE_RATE";

Don't forget that Xamarin.Android ".NET-ifies" the API, so casing and naming won't be identical to Java.
Comment 2 Andrew Fernandes 2013-06-18 13:57:59 UTC
Yeah, I'm pretty careful with the naming thing; I switch regularly between C++, C#, and Java, and if it wasn't for Studio's autocomplete I'd probably be stark raving insane by now. :-)

Verified that the properties and methods ARE in 4.7.9-1.

Also found my problem. 

I had Settings > Build > General > Target Framework set to 4.0.3 (15).

This was mismatched with the Android manifest under Settings > Build > Android Application, which was set to Target API of 17 and Minimum API of 15.

Yes, I understand that one of them is for the Xamarin.Android binding, the other is for APK manifest generation. But that's still confusing (to me, at least)...   :-)

Sorry for wasting your time!