Using the phone physical buttons

663 views
Skip to first unread message

Alexis Morales

unread,
Oct 14, 2014, 10:46:22 PM10/14/14
to mitappinv...@googlegroups.com
Hi, let me tell you a little bit about my app. I want to make a counter and I want the user to press the increase volume button in its phone and when he does that I need the app  to add +1 to the app counter.

Here is an image of the app.

In other words, I want to take advantage of the physical buttons of the user phone. The user would need to press the physical volume buttons of its phone, so the counter can increase in value. For each push of the up volumen button, the counter should as +1.

I don't know if this is possible by using the App Inventor. If possible, what object, method or thing do I need to use from the App Inventor tool?

I will really appreciate your help guys!

Greetings!
Screen Shot 2014-10-14 at 9.40.23 PM.png

SteveJG

unread,
Oct 15, 2014, 7:52:04 AM10/15/14
to mitappinv...@googlegroups.com
The only 'button' you have access to with AI2 is the 'back button, and that is not actually a physical button.  Screen1.BackPressed gives you access to that.

I am not sure, but I do not think you can do what you want to do with physical buttons even with Eclipse or Android Studio.   I am not aware of any way of re-purposing the physical buttons on an Android device.      If it is possible, it will be described here:  http://developer.android.com/index.html


regards,
Steve

Gareth Haylings

unread,
Oct 15, 2014, 9:22:12 AM10/15/14
to mitappinv...@googlegroups.com
Hi 

As Steve said only backpress is supported in AI2. However creating and Android app with Eclipse you can access all hardware buttons. Here is a link to the Android SDK about the information http://developer.android.com/reference/android/view/KeyEvent.html

Alexis Morales

unread,
Oct 15, 2014, 4:02:09 PM10/15/14
to mitappinv...@googlegroups.com
Thanks for your help man! I will consider it!

Alexis Morales

unread,
Oct 15, 2014, 4:02:37 PM10/15/14
to mitappinv...@googlegroups.com
Thanks Steve! Definitely solved my doubt!
Reply all
Reply to author
Forward
0 new messages