App Inventor Extensions: Settings | Pura Vida Apps

App Inventor Extensions


Settings Extension

See the App Inventor Extensions document about how to use an App Inventor Extension.

For questions about this extension or bug reports please start a new thread in the App Inventor Extensions forum. Thank you.

For feature requests please contact me by email. To be a sponsor of a new method already is possible starting from only 10 USD! With your contribution you will help the complete App Inventor community. Thank you.

Sept 2nd, 2016: Version 1: brightness properties

Jan 17th, 2017: Version 2: volume properties added

Mar 7th, 2017: Version 3: ringtone methods added

Mar 26th, 2017: Version 3b: bugfix set ringtome for ALARM or NOTIFICATION

Apr 14, 2017: Version 3c: bugfix brightness

Apr 15, 2017: Version 4: new property brightness mode added

Description

Settings extension.
Curently you can get/set the brightness get/set the alarm/ring/music volume and get/set/play a ringtone, but probably more functionality will follow one day...
Required permissions: android.permission.READ_EXTERNAL_STORAGE, android.permission.WRITE_SETTINGS

Properties


Get the brightness (a value between 0 and 255).

Thank you Tsiantakis Apps for being the sponsor of the brightness properties!


Set the brightness (a value between 0 and 255).

Thank you Tsiantakis Apps for being the sponsor of the brightness properties!

Note: to set the brightness is only possible in brightness mode MANUAL. You can't set the brightness manually and have adaptive brightness at the same time!

Note: you will have to build the app before being able to set the brightness, because the companion app does not offer the permission android.permission.WRITE_SETTINGS.


Get the brightness mode (MANUAL or AUTO).

Thank you Conor for being the sponsor of the brightness mode properties!


Set the brightness mode (MANUAL or AUTO).

Thank you Conor for being the sponsor of the brightness mode properties!

Note: you will have to build the app before being able to set the brightness mode, because the companion app does not offer the permission android.permission.WRITE_SETTINGS.


Returns whether User Interface shoud be shown while setting the volume.


Specifies whether User Interface shoud be shown while setting the volume.


Get alarm volume in percent.
Thank you Merciful for being the sponsor of this property!


Set alarm volume in percent.
Thank you Merciful for being the sponsor of this property!


Get music volume in percent.
Thank you Merciful for being the sponsor of this property!


Set music volume in percent.
Thank you Merciful for being the sponsor of this property!


Get ring volume in percent.
Thank you Merciful for being the sponsor of this property!


Set ring volume in percent.
Thank you Merciful for being the sponsor of this property!

Methods


Get current ringtone. Type can be RINGTONE, NOTIFICATION or ALARM.
Thank you James and chabooya for being the sponsors of this method.


Set sound file as ringtone, notification and/or alarm sound. Title is a custom name for the sound. Type can be RINGTONE, NOTIFICATION or ALARM. The sound file must be stored on sdcard and in mp3 format. For files from the assets, copy them first to the sdcard using the file extension. Prefix the fileName with / (i.e. relative path) to look for the file on the SD card. For instance /myFile.pm3 will look for the file /mnt/sdcard/myFile.mp3. If fileName starts with file:/// you can specify a complete path to the file.

Note: you will have to build the app before being able to set the ringtone, because the companion app does not offer the permission android.permission.WRITE_SETTINGS

Thank you James and chabooya for being the sponsors of this method.


Play ringtone. Type can be RINGTONE, NOTIFICATION or ALARM.
Thank you James and chabooya for being the sponsors of this method.


Stop currently playing ringtone.
Thank you James and chabooya for being the sponsors of this method.

Example App: Brightness/Volume Test


Example App: Ringtone Test

Test

Tested successfully on Nexus 5X running Android 7.

Do you need help with your App Inventor project?

I can help you: for one hour I charge 25 USD.
Please contact me at info [at] puravidaapps [dot] com for details!
For questions about App Inventor, please use the App Inventor forum. Thank you.

Terms and Conditions

Download


Developing and maintaining snippets, tutorials and extensions for App Inventor takes a lot of time.
I hope it saved some of your time. If yes, then you might consider to donate a small amount!

Donation amount:

or donate some mBTC to Bitcoin Address:
1Jd8kXLHu2Vkuhi15TWHiQm4uE9AGPYxi8
Bitcoin

Thank you! Taifun
 

Download Settings extension (aix file)

Download Brightness Test (aia file)
Download Ringtone Test (aia file)
Note: you will have to build the app before being able to set the brightness, brightness mode or the ringtone, because the companion app does not offer the permission android.permission.WRITE_SETTINGS

Back to top of page ...

Creative Commons License
This work by Pura Vida Apps is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.


Home | Snippets | Tutorials | Extensions | News | Forums | Links | Search | Contact