Groups keyboard shortcuts have been updated
Dismiss
See shortcuts
Skip to first unread message

Jaqueline

unread,
Mar 5, 2018, 4:45:33 AM3/5/18
to MIT App Inventor Forum
Hello,

I want to set the vibration speed according to who is using the app.
For example if the user is Laura so it will be 150 by default, else if it is Sam so it should be 300 by default.
I thought about using Login username and password but wondered that maybe if will not be running in the background as it does without Login or maybe it will log out automatically? Or no that  won't happen? 
Need some guide.

Thank you in advance

Chris Ward

unread,
Mar 5, 2018, 7:00:38 AM3/5/18
to MIT App Inventor Forum
Hello Jaqueline

I could be wrong but I think that idea is a non-starter because your App will not  know the App Login credentials beforehand? Therefore, not knowing the exact Usernames, the App cannot know which vibration duration (not speed) to apply - unless you are in prior control of all User Logins before you release the app to all of your Users.

Sounds like a lot of effort with potential gotchas along the way - but you do not tell us why you need to programatically set the vibration for each User? If we know what you need to do, we might be able to offer better help.

Jaqueline

unread,
Mar 5, 2018, 8:25:05 AM3/5/18
to MIT App Inventor Forum
Hello Chris,

I am working on an application that converts to morse.  Each user has his speed to read the morse code.  That's why when a user that knows well the morse code and can go fast while reading is not supposed to wait 1 by 1 code each 1 second to read that text he can go faster and read the text in 30 second while the new user will read it in 1 minute.
That is I want that each user can set his speed in reading and once set using slider it should be applied permanently not only for 1 text.

Thank you in advance

TimAI2

unread,
Mar 5, 2018, 8:40:52 AM3/5/18
to MIT App Inventor Forum
Will multiple people be using a single device?

If not the user can set their speed in a tinydb tag, and this can be recalled on each start of the app.

If multiple users, the same applies, but users will have to identify themselves first, easiest way for this is via an in-app login system, but I guess problems will arise if they are switching user accounts on the device so that "texts" are sent by "them"

Jaqueline

unread,
Mar 5, 2018, 8:48:04 AM3/5/18
to MIT App Inventor Forum
Hello Tim,

No probably each user will be using his own device.

"If not the user can set their speed in a tinydb tag, and this can be recalled on each start of the app" How I will know who is the user?
Let us suppose that I downloaded the app on 4 devices.  Each user has checked the speed using slider and let us say that the 1st one found that thumbPosition 100 is the best for him so he want to use it always.  I don't want that if he minimize the app the value self changes to 50 for example.

Thank you in advance

TimAI2

unread,
Mar 5, 2018, 9:24:52 AM3/5/18
to MIT App Inventor Forum
If single use on device, you don't need to know anything. The user sets the speed in a tinydb which is recalled on start up, and the speed will stay set until/unless it is changed by the user

Chris Ward

unread,
Mar 5, 2018, 5:11:01 PM3/5/18
to MIT App Inventor Forum
Hi Jaqueline

Looks like you are all setup now but I do have a suggestion - use sound instead of vibrate, much kinder to the battery.

Jaqueline

unread,
Mar 6, 2018, 2:03:07 AM3/6/18
to mitappinv...@googlegroups.com
Hello Tim,

That is working well.

Thank you :)

Jaqueline

unread,
Mar 6, 2018, 2:04:02 AM3/6/18
to MIT App Inventor Forum
Hello Chris,

Ok I am going to use sound instead of vibration @Chris.

Thank you
Message has been deleted

Ghica

unread,
Mar 6, 2018, 11:46:26 AM3/6/18
to MIT App Inventor Forum
Nice suggestion, to use sound instead. We talked about it before. How are you going to do it? The duration of the sound should be variable, related to the set speed. With vibration it is easy to adjust the number of milliseconds to vibrate and similarly the waiting time between . and - and characters and words.
Everything is possible, but I really doubt if starting and stopping sounds really often is going to save you much battery power.

One approach I could think of is to allow only a limited set of speeds, like slow, normal and fast and have . and - sounds for each at exactly the required length.
Cheers, Ghica.

Chris Ward

unread,
Mar 6, 2018, 1:44:04 PM3/6/18
to MIT App Inventor Forum
It is true that the vibrate motor uses more energy, it's a pretty crude component. It's also suggested that some phones age more quickly if vibrate is a default. Of course there are conspiracy theories about that, but given the recent track record of a certain fruit vendor, who knows? :)
Reply all
Reply to author
Forward
0 new messages