This is a migrated thread and some comments may be shown as answers.

Phone Volume Control

3 Answers 106 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jenbagaraman
Top achievements
Rank 1
Jenbagaraman asked on 24 Sep 2014, 09:34 AM
Hi all,

            How do i control the phone volume in the appbuilder for Android phone. Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 25 Sep 2014, 03:37 PM
Hi Jenbagaraman,

The Cordova Media API provides a method that sets the volume of the audio file your app is playing. However, looking at your description I am not sure if this is what you are looking for.

If it isn't and you need to implement a logic that controls the device volume, then I'm afraid that in Cordova there is no straight-forward approach for the same. In Android the AudioManager class provides methods for getting and setting the volume which means that in order to implement such a functionality in a hybrid mobile app, you would need a plugin. I found this plugin which seems to take advantage of the AudioManager class API. However please have in mind that the plugin seems a bit outdated and it also cannot be imported in an AppBuilder app as it doesn't meet all requirements listed here. This means that you would have to create a custom plugin yourself or update that one to make it Plugman-compatible.

Generally speaking, in AppBuilder you can import custom plugins as long as they meet the requirements I mentioned before. If they do, you can follow these steps to import and utilize the plugin in an AppBuilder project.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Jenbagaraman
Top achievements
Rank 1
answered on 26 Sep 2014, 02:02 AM
Hi Tina,

              Thanks for your reply. I am trying to control the device volume. Anyway i will try to create the custom plugin. 
0
Luis
Top achievements
Rank 1
answered on 06 Apr 2017, 02:29 AM
amigo tambien ando en busqueda de como controlar el volumen de la app, debido a que soy muy nuevo en esto quisiera pedir una pequeña ayuda con esto!!
espero su prota respuesta, gracias!!
Tags
Apache Cordova
Asked by
Jenbagaraman
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Jenbagaraman
Top achievements
Rank 1
Luis
Top achievements
Rank 1
Share this question
or