processing / processing/p5.js

Mobile Acceleration examples not working.

Open
#5,486 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Mobile
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Example ex00_Acceleration_Ball_Bounce used to work in 2018 but doesn't now. I tried it on 2 phones today. (Android 6.0.1, Android 10). I made a small program just showing the AccelerationX,Y,Z values - always zero. I guess the code hasn't changed so the problem is security on the phone. I've tried giving Chrome all the permissions available - no better. ex03_Shake_Ball_Bounce the same.

This was a great feature, I've seen 20 10-year-olds all shake their phones with this and laugh. Shame it doesn't work now.

function setup() {
  createCanvas(displayWidth, displayHeight);
  fill(0);}

function draw() {
  background(255);
  textSize(36);
  textAlign(RIGHT);
  text(frameCount   , 250,  40);
  text(accelerationX, 250,  80);
  text(accelerationY, 250, 110);
  text(accelerationZ, 250, 140);}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running ex00_Acceleration_Ball_Bounce and ex03_Shake_Ball_Bounce on the reported Android devices and inspect how accelerationX, accelerationY, and accelerationZ are populated. Compare behavior with the small program shown in the issue; done means the acceleration values are no longer always zero and both examples respond to device motion.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.