Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Development

Reply
New Contributor
Posts: 5
Registered: ‎02-07-2012
My Device: playbook simulator
My Carrier: free

Android To Blackberry - handle setRingerMode of AudioManager

Hello, 

 

My android app is using the function AudioManager.setRingerMode to set the phone/tablet to silent 

The app basicly set the tablet to silent everynight (with AlarmManager) to prevent being disturbing by email or any sound. Every morning the app enables sound.

It seems like this function is not working with the playbook simulator.

Can you take a look ? http://developer.android.com/reference/android/media/AudioManager.html#setRingerMode(int)

 

There is only 3 possibilities  RINGER_MODE_NORMALRINGER_MODE_SILENT, or RINGER_MODE_VIBRATE so it should not be too complicate to link to blackberry framework.

 

Kind regards

New Contributor
Posts: 5
Registered: ‎02-07-2012
My Device: playbook simulator
My Carrier: free

Re: Android To Blackberry - handle setRingerMode of AudioManager

Well, setRingerMode does not work at all.

Sad, my app just got denied because of that..

BlackBerry Development Advisor
Posts: 102
Registered: ‎11-21-2008
My Device: Z10
My Carrier: Bell

Re: Android To Blackberry - handle setRingerMode of AudioManager

Hello lplsoft,

 

Please reference the following document which outlines the Android API set which is unsupported. 

 

BlackBerry Runtime for Android apps - API Support

https://bdsc.webapps.blackberry.com/android/apisupport

 

The AudioManager.setRingerMode API is listed within the Unsupport Media APIs section.

James Dreher
BlackBerry Development Advisor
Highlighted
New Contributor
Posts: 5
Registered: ‎02-07-2012
My Device: playbook simulator
My Carrier: free

Re: Android To Blackberry - handle setRingerMode of AudioManager

[ Edited ]

Hello jdreher,

 

Thanks for your answer.
I am now using the function setStreamVolume of AudioManager which is not listed as incompatible.

Here is a sample of code:

AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
am.setStreamVolume(AudioManager.STREAM_MUSIC, 0, AudioManager.FLAG_SHOW_UI);

 If I test it in the simulator, the internal sound bar of android is showing inside my application (since I use "FLAG_SHOW_UI"). But if I go in the preference of the playbook simulator, "Master Sound" and "Audio Notification" does not change.
(I also tried it with STREAM_SYSTEM and STREAM_NOTIFICATION)


Is it a bug of the simulator? I don't have a playbook so I only can test it in the simulator.