vibration

Vibrator permission force close

主宰稳场 提交于 2019-12-12 03:43:23
问题 I have this line of code calling 2 seconds from the vibrator_service ; Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(2000); and this in my manifest <permission android:name="android.permission.VIBRATE" ></permission> But I am still getting a force close java.lang.security.exception: Requires Vibrate Permission . Have I declared the permission wrong?? 回答1: You need to add a uses-permission tag in the manifest file (as a child of the manifest element, same as the

Varying vibration intensity: how does the VIBE app do it?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:39:23
问题 I understand that, given how vibration is achieved, the only way to vary the intensity would be a way to control the RPM of the motor. I can see the Vibrator Class does not allow for this, and yet, the VIBE app (see this video) appears to be achieving just that. On the video, at about 0:35, the "create your own vibe" is briefly shown. I tested it and, by god, it appears to be varying the intensity. Could it be that they are using the NDK for direct motor control? 回答1: ViBe uses the Immersion

Creating a vibration in a non-activity class?

只谈情不闲聊 提交于 2019-12-11 11:15:55
问题 I am trying create a vibration for my game(Android), basically I want a vibration to start when a collision happens, but I can't create it because the class in which my level is running is not an activity class and I don't know ho to proceed, what should I do ? Thanks. 回答1: But your class that wants to create it should be called from an activity right? Then there is no problem to proceed like a vibration done in Activity Class: public function vibrate(Context context){ // Get instance of

Getting native vibration to work on iOS through AS3

馋奶兔 提交于 2019-12-11 09:39:50
问题 I've been looking at the documentation and it's a bit confusing as to how I even import the extension for the vibration plugin. http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/vibration.html The instructions says I need to mess about with Xcode, but I thought the point of Adobe AIR was that you don't need to mess about with Xcode; it's really convoluted. How exactly do I import the class and files so that I can use the provided code in AS3? 回答1: read a this article:

Vibrate for a long time?

流过昼夜 提交于 2019-12-10 19:34:45
问题 I want to make an app where while the user is pushing down a button the phone vibrates until the user releases the button. Ive searched around and I haven't found a way to make it a long vibrate, except for a very old tutorial from 2009 which seems to be outdated. 回答1: It's not allowed by Apple to use the vibration as you want to: Vibration. It is not permitted to use continuous vibration in your apps – short bursts as warnings is all that is allowed . Don’t bother trying to set up a timer to

Can you increase vibrator strength on android devices?

夙愿已清 提交于 2019-12-10 13:27:38
问题 Is it possible to increase the strength of the alarm vibration? 回答1: apparently not, under android.os.Vibrator, you can set the pattern as well as the duration vibrate(long[] pattern, int repeat) vibrate(long milliseconds) my guess is that different patterns can be used to "simulate" a stronger vibrate. (on,off,on,off) rather than (on, off, off, off, on). also a disharmonious pattern may be more effective than a pattern with a fixed rhythm. 回答2: The Vibrator Class does not allow for this, you

Where is the Vibration API hiding in Chrome 23?

萝らか妹 提交于 2019-12-10 12:57:28
问题 According to a post on Peter Beverloo's blog, "The webkit prefix has been dropped from the Vibration API implementation as it reached Candidate Recommendation." In Firefox, the Vibration API can be found at navigator.vibrate (per the spec), not so in Chrome 23 - with or without the webkit prefix. I've tried enabling experimental javascript in chrome://flags but to no effect. Despite playing around in devtools and plenty of searching on the net, I'm still unable to locate this API. Where is it

check phone settings for haptic feedback

此生再无相见时 提交于 2019-12-08 22:11:48
问题 Is there a way to check if the user has haptic feedback enabled or disabled in their android phone settings? While I think haptic feedback would be useful to my app, I also understand that some people (myself included) generally prefer to have haptic feedback turned off. The closest thing I can find is http://developer.android.com/reference/android/provider/Settings.System.html#HAPTIC_FEEDBACK_ENABLED but I'm not sure if it's what I'm looking for or how to test against it. thank you in

iPhone: programmatically check if vibration is enabled

匆匆过客 提交于 2019-12-08 10:37:51
问题 Is it possible to programmatically check if the system option of iPhone Settings -> Sounds -> Vibrate on Ring is enabled? In my app, I would like to display an alert to the user if that option is disabled. 回答1: You cannot. Because apple is not providing the API to access the iPhone settings app. 回答2: may be you could give it a try and make sure you're running the app in iDevice because simulator don't have silent or ring mode :) New Edits -(BOOL)silenced { #if TARGET_IPHONE_SIMULATOR //

Can I determine / how, if a device has vibration or not?

て烟熏妆下的殇ゞ 提交于 2019-12-07 06:01:14
问题 I have some settings that enable/disable vibration for certain actions, but I find it pointless to display them if the device doesn't have the ability to vibrate. Is there a way to check if the person is using an iPod touch and if it has vibration? 回答1: This code should do it - be aware it 'assumes' the iPhone is the only device with Vibration capability. Which it is for the moment... - (NSString *)machine { static NSString *machine = nil; // we keep name around (its like 10 bytes....)