I'm presently working on an Xamarin C# application that features a meter that displays the current volume of the app. I'm aware that the AudioManager class can be utilised to get and set the current volume readings, but what I want is a way to make my application aware that I have pressed one of the volume buttons that causes it to increase or decrease. How can I achieve this in C#?
Asked
Active
Viewed 18 times
0
-
I don't think there is a *cross-platform* way to do this, so you have to do this in your `.Android` project. As with many such platform-specific features, the best available answers are in `java`, not `c#`. The good news is that `Xamarin.Android` is 1:1 with the Java APIs. Look at the java answers. When you find one that looks promising, google for `xamarin android thisfunctionlookspromising`, where `thisfunctionlookspromising` is name of some Android java function that gets called in that answer. You will find the equivalent Xamarin.Android call. Which will look very similar. Not reopening Q. – ToolmakerSteve Apr 17 '22 at 00:07