Reputation: 321
I'm coding around with the app inventor2 project "No Text While Driving". I need to add some more functionality, as the app to determine if the smartphone is on the move, e.g. in a rolling car and thus lock the screen or prevent from being able to answer incoming sms.
In theory, I know I should have a block to check current location to previous location of the smartphone in the amount of time. Or is it possible to check movement only by accelerometer?
I have tried the following blocks without much success:
Can someone kind enough direct me to the wright use of blocks through an example? Thank you all in advance for your answers.
[Update1]
I have tried to follow Taifun's advice by adding the LocationSensor1 reading to a global variable and compare it with the CurrentAddress. The following code blocks should do the trick, but it didn't. Is it possible to check movement with accelerometer reading instead, and how?
Upvotes: 0
Views: 278
Reputation: 3729
You will need to store the result, wait a few seconds, check the sensor data again and compare to stored value. Then replace the stored value with the new one. Repeat.
Upvotes: 0