• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

App Inventor - I need help

Kerbs

Lurker
Hello everyone, I'm not savvy with creating apps on any device so this is pretty new to me. I have looked at google app inventor, and I can do some of what I want, but not everything. What I have in my app so far is 5 different buttons(pictures), that when pressed, will produce a unique tone.

What I need to do is create a volume control on screen in a slider format, that will alter the volume of the tone being played, from 0-100%. I understand there are physical buttons on the device, but for my application I need to do this. Any help, or direction towards some tutorials would be much appreciated. I don't know if the app inventor is capable of doing that, and how complicated this would be to create in a different environment.

Thanks in advance,
Andrew :)
 
Unfortunately, AI does not natively support sliders, but a slider can be coded fairly easily using buttons (but the slider button cannot be dragged, you must click on the track itself). The size of the spacer button (which is emulating the track that the slider button rides on) determines the volume. Or, you can place an image sprite on a small canvas and allow the user to drag it. The position of the sprite on the canvas determines the volume.

The formula to change between user slider values and the app's native values are:​
user value = app value / (app max value - app min value) x (user max value - user min value)​
app value = user value / (user max value - user min value) x (app max value - app min value)​

Color Picker: https://groups.google.com/forum/#!topic/app-inventor-shared-utilities-repository/l5o8nDOI1u4

Android Style Sliders: https://groups.google.com/forum/#!topic/app-inventor-shared-utilities-repository/AFCb5RmTeWs

Scott Ferguson
scottfromscott@gmail.com
 
Back
Top Bottom