Johan,
Once again thank you for your prompt response - I'm starting to get really impressed with this community and how it enhances B4A.
I was able to install and run the project you supplied above without any problems.
I now have a clear understanding of how to incorporate small bits of Java - although the Java itself is still essentially double-Dutch (does that translate?).
I did manage to modify your project (including the Java) to return the ringer state (0=mute, 1=vibrate, 2=sound) - I love to tinker!
This led me to re-explore the Phone library and the user level sound mode settings:
o I had been using the Phone library's SetMute method to change the mute state of the VOLUME_MUSIC voice channel to ON before using it.
o It turns out that the Phone library also has GetRingerMode and SetRingerMode methods with associated ringer state constants of RINGER_SILENT, RINGER_VIBRATE and RINGER_NORMAL which appear to render our Java exercises redundant (although still a very valuable learning experience).
o These methods and constants seem to pretty much exactly match the user level sound mode settings I have on my device (Samsung Galaxy S5) via [Settings] > [Sounds and notifications] > [Sound mode] > [Sound/Vibrate/Mute].
o In these user level sound mode settings it would appear that the [Media] channel equates to the B4A VOLUME_MUSIC channel.
o Here is where it starts to get a bit confusing:
(1) If I manually set the sound mode to [Mute] it does not impact the [Media]/VOLUME_MUSIC channel - it is still audible.
(2) Would this be common to all Android devices? If so does it mean I don't need to worry about using Phone.SetMute to ensure the VOLUME_MUSIC channel is not muted before using it?
(3) Or should I play safe and use Phone.GetRinger/SetRinger to manage the sound mode mute state before using the VOLUME_MUSIC channel?
(4) It would appear that Phone.SetMute is doing things the user can not manually do - what is its value?
Any comments would be appreciated and thanks again...