Inconsistent timer and jerky animation

561 views
Skip to first unread message

Stuart Bahn

unread,
Mar 16, 2015, 9:17:41 AM3/16/15
to mitappinv...@googlegroups.com
HI guys,

I'm building a musical notation app which moves musical symbols across the screen along with a regular click sound. 

The problem I have is that the time of the clock is inconsistent and therefore the animation stutters sometimes and the time between clicks is not regular. I understand that this is due to the phone doing other tasks. 

My questions are:

1. Is there a way to make the clock fire more consistently?

2. Can I use the phone's system clock instead of the clock component to get more accurate intervals?

There is no need for a 60ms pause between frames to actually be exactly 60ms. If it works out at 72ms say then that's fin, just as long as it's consistent.

If there is anything else you can suggest that would improve things, I'd be very grateful to hear from you.

Thanks as always and best wishes,
Stuart

Stuart Bahn

unread,
Mar 16, 2015, 12:15:44 PM3/16/15
to mitappinv...@googlegroups.com
Update:

Setting my phone to Aeroplane mode seems to improve things significantly. This seems to suggest that blue tooth, wifi, etc were causing periodic activity in my phone.

Still not perfect but much better. Would still appreciate any further suggestions.

Best wishes,
Stuart

Abraham Getzler

unread,
Mar 16, 2015, 1:39:31 PM3/16/15
to mitappinv...@googlegroups.com
Here's an informed discussion of timing issues in App Inventor ...


ABG

Stuart Bahn

unread,
Mar 16, 2015, 3:25:26 PM3/16/15
to mitappinv...@googlegroups.com
Thank you Abraham. That's a helpful explanation.


Stuart Bahn

unread,
Mar 17, 2015, 7:41:47 AM3/17/15
to mitappinv...@googlegroups.com
Hi again everyone. 

I'm still experiencing problems with the inconsistent timing of my app.

As before, I understand this to be down to other processes the phone is involved in. Can anyone tell me if there is a way to disable these processes from running in the background on the user's Android device?

I appreciate this is probably not possible from within an App Inventor app, but is there a way for the user to do it manually?

Thank you as always.
Stuart

Taifun

unread,
Mar 17, 2015, 10:10:22 AM3/17/15
to mitappinv...@googlegroups.com
see also this thread https://groups.google.com/d/msg/mitappinventortest/z2SLQnv8dU4/-jhdoXMBxU4J

you can use the activity starter to open the settings for the user to switch the phone to airplane mode manually

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Abraham Getzler

unread,
Mar 17, 2015, 10:37:09 AM3/17/15
to mitappinv...@googlegroups.com
@Taifun - good thread.  I added it to my FAQ.
ABG

Stuart Bahn

unread,
Mar 18, 2015, 9:20:16 AM3/18/15
to mitappinv...@googlegroups.com
Hi Taifun,

that thread was very helpful indeed, thanks. Animation is much improved now.

Would you mind telling what settings I need for Activity Starter to open the screen to allow the user to activate airplane mode, as you suggest?

Taifun

unread,
Mar 18, 2015, 9:48:29 AM3/18/15
to mitappinv...@googlegroups.com

Stuart Bahn

unread,
Mar 18, 2015, 9:55:49 AM3/18/15
to mitappinv...@googlegroups.com
Fantastic! :-D Thank you Taifun.
Reply all
Reply to author
Forward
0 new messages