Questions tagged [android-vibration]

The Android framework includes support for Vibration available on devices, allowing you to control the device's vibrations from your application. Questions regarding practical and advanced use of Vibrations must fall under this tag.

202 questions
0
votes
0 answers

SecurityException even after giving uses-permission tag for vibration

I am trying to make an Android app which starts vibration on button click. below is the code related to vibration, I have added uses-permission tag in Android manifest file, still the app terminates giving SecurityException public class MainActivity…
ojas mohril
  • 2,215
  • 1
  • 13
  • 11
0
votes
1 answer

Can use specific button to vibrate another one? How?

I've created an alarm for each event in the calendar. Now I'm thinking about a new method to stop the alarm by the user in a new way :) and that way is: The user has to hold down two fingers (thumb and index) for 5 seconds until the button that the…
hani kamal
  • 55
  • 1
  • 7
0
votes
0 answers

Vibration in android API 21

I want to vibrate the device when I get a error response from my server.I have tried all kinds of things to make it vibrate but it isn't working.This is my code if required, Animation shake = AnimationUtils.loadAnimation(context, R.anim.shake); …
AndroidMech
  • 1,676
  • 3
  • 20
  • 31
0
votes
2 answers

Android. How to make vibration when device vibration level setted to 0?

I've got a problem. I need to make a vibration after some user's action, so I've used the code: Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(300); But I've got a problem. When I test the app on the device, where…
0
votes
1 answer

Why does the device vibrate from an Activity, but not from within a Class (file)?

I want my app to vibrate the device using my app's custom vibration pattern. I can do this from MainActivity, or any Activity, but I don't know why it isn't working from within a Java class (SmsReceiver.java). I thought that if I use…
RǢF
  • 806
  • 5
  • 17
0
votes
0 answers

Android: wait for vibrator to finish

Let's say I have async tasks that when finished, lock the vibrator and send it a pattern. In a nutshell, that's the kind of code I'm dealing with: lock(vib); vib.vibrate(pattern); release(vib); return; The problem is, the vibration starts and just…
User1291
  • 7,664
  • 8
  • 51
  • 108
0
votes
1 answer

Cannot vibrate the device for 3 seconds

I want my application to vibrate for 3 seconds, but it doesn't work and I can't figure out why. When I click on the button, it does nothing. At first I tried to do it in the main activity but there was the same result. Main Activity protected void…
0
votes
0 answers

Android vibrate() function

I am developing an Android app, and I require to use the vibrating function of the phone. vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); if(vibrator != null){ Toast.makeText(Game.this, "it`s not null", Toast.LENGTH_SHORT).show(); …
kimv
  • 1,569
  • 4
  • 16
  • 26
0
votes
1 answer

Android. How to stop a method's vibrations from another method

I have a method that sends out pulses of vibrations. It uses Thread.sleep() in order to wait between each pulse. I want to input a STOP or RESET button to stop the buzzes from reaching the end of vibratorDAYONE(). I tried using v.cancel and return()…
Jayizzle
  • 532
  • 1
  • 6
  • 24
0
votes
1 answer

Android, Sleeping in between vibratior methods

I am trying to get my device to vibrate every two seconds with vibrations 16 times. I used Thread.sleep() to try and sleep the thread in between method calling. In the vibrate method, it should call pattern1 and pattern2 and those already have sleep…
Jayizzle
  • 532
  • 1
  • 6
  • 24
0
votes
2 answers

Not able to stop vibration

I am developing an android game in which for vibration I am using this code public void gameover() { prefs = activity.getSharedPreferences("AUTHENTICATION_FILE_NAME", Context.MODE_WORLD_WRITEABLE); String vibration =…
Noaman Akram
  • 3,680
  • 4
  • 20
  • 37
0
votes
1 answer

Check if the android device is vibrating now

Is it possible to detect vibration in android device via code. I'm building an app using accelerometer, so want to give different condtions when the device is vibrating. Thanks in advance :)
0
votes
1 answer

Vibrator In Android, Stopping when the app exits

I am basically developing an Applicatin which requires the App to Vibrate just before it closes down. Now when I call the vibrator.vibrate() function and then call the finish() function, the Vibration is stopped and the app is exited, before the…
0
votes
1 answer

Android: Can I vibrate an Xbox 360 controller?

I added this method to a simple Android program to see if the connected Xbox 360 controllers had access to vibration: private void getDeviceInfo(){ int[] ids = InputDevice.getDeviceIds(); appendText("#devs: "+ids.length); InputDevice…
hooby3dfx
  • 936
  • 1
  • 8
  • 18
0
votes
1 answer

How do I create a create and call a vibration class in android?

Hi I want to call a vibration class throughout my android activities. Can someone please point me in the right direction? This is my vib class so far: import android.content.Context; import android.os.Vibrator; public class Vibrate { Vibrator…