Vibrate your phone

edited May 2016 in Android Mode

How to vibrare my phone with vibration moter for mobilephones in android processing?

Answers

  • Answer ✓

    @ unnamed===

        import android.app.Activity;
        import android.content.Context;
        import android.os.Vibrator;
    
    
        Activity act;
    
        public void setup(){
          fullScreen();
          background(255,0,0);
          textSize(24);
          act = this.getActivity();
        }
    
    
        public void draw(){
          background(255,0,0);
          text("je sais vibrer", 400,500);
        }
    
        public void mouseReleased(){
           Vibrator vibrer = (Vibrator)   act.getSystemService(Context.VIBRATOR_SERVICE);
                    vibrer.vibrate(100);
        }
    
  • @akenaton It says "Unforunately, viberate_test has stopped" in Galaxy s4, Galaxy s7, Galaxy folder...

    Does that code works in your phone?

  • @akenaton :) problem Solved!

    I checked all the Sketch permissions and It works! I think the VIBRATE permission made it work. Thank you so much!

  • edited February 2017

    @akenaton

    It worked 5 sec ago but it made error..

    What's wrong?

    캡처_2016_05_29_20_36_52_251

  • @unnamed === put the whole code (with cut && copy, not screen shots)

  • edited February 2017

    @akenaton No I don't have to because I solved it. I just went back to previous version. Thank you.

Sign In or Register to comment.