Skip to first unread message

Jacques Dumarest

unread,
Jan 24, 2018, 4:16:15 PM1/24/18
to MIT App Inventor Forum
 I am using Orientationsensor as well as Pedometer sensor. When I use them separtely, they work fine, but if I use them simultaneously, application crashes. As soon as I start the Pedometer, application crashes.

 Is there a specific sequence to use? I tried to Disable Orientationsensor before starting Pedometer, then re-enable it, but this does not help!

 Thanks for your help

 Jacques

SteveJG

unread,
Jan 24, 2018, 5:59:09 PM1/24/18
to mitappinv...@googlegroups.com
There might be some useful information in one of these articles:  https://www.google.com/search?q=app+inventor+pedometer+tutorial&oq=app+inventor+pedometer+tutorial&aqs=chrome..69i57.9075j0j4&sourceid=chrome&ie=UTF-8  

The Pedometer component is a variation of the Accelerometer.  If you read this Forum and Search for Pedometer, the threads indicate users seem to have mixed results using the Pedometer component which seems dependent on their device hardware.  There might be some information in those threads.  Also see https://groups.google.com/forum/#!searchin/mitappinventortest/orientation$20sensor$20$20pedometer%7Csort:date/mitappinventortest/lGB41v2z-Vw/oxKZP7FABQAJ

Let us know if this advice in the links helps.

Regards,
Steve

Jacques Dumarest

unread,
Jan 26, 2018, 9:16:51 AM1/26/18
to MIT App Inventor Forum
The problem I am facing is exactly what is described in: https://groups.google.com/forum/#!searchin/mitappinventortest/orientation$20sensor$20$20pedometer%7Csort:date/mitappinventortest/lGB41v2z-Vw/oxKZP7FABQAJ 

 Looks like using both at the same time is not possible. Is it a limitation of AppInventor, or same problem if using standard dvpt environment: Android Studio and Java?

 Thanks

 Jacques

SteveJG

unread,
Jan 26, 2018, 9:42:52 AM1/26/18
to MIT App Inventor Forum
Yes, it looks like it is impossible to use both controls simultaneously.    It might be possible to turn one off and the other on to only allow one of them to work at a time.

The controls are App Inventor controls and it appears when both are activated, they interfere so the solution might be to use one at a time.  Ask yourself why your app has to have both components working at exactly the same time and then code around it realizing App Inventor is a programming environment for educational purposes and does not have all the capabilities of a Java based Android compiler.

If you use Android Studio etc.; you would use it's library of functions to achieve something similar.  Visit the Android Studio site. Could AS provide simultaneous functions? Maybe.  How you would do something similar would be done in a very different way, if at all.   VIsit one of the professional coding sites like   stackoverflow and perhaps ask your question there.

Abraham Getzler

unread,
Jan 26, 2018, 11:12:08 AM1/26/18
to MIT App Inventor Forum
Reply all
Reply to author
Forward
0 new messages