I am following a book on "Rapid Android Development" with Processing 2.0.3 windows 7 64bit, having only api level 10 installed (android 2.3.3).
The example I am at, uses "motionPressure" which was dropped by 2.0b7 http://wiki.processing.org/w/Android#Mouse.2C_Motion.2C_Keys.2C_and_Input "The motionX, motionY, motionPressure, etc. variables have all been removed. This was sort of a kludge, and it'll be handled better by a later touch API. It should be easy to bring them back with a dozen lines of code in your sketch, if you were relying on them. Instead, just use mouseX/Y for now."
I found a fix here https://forums.pragprog.com/forums/209/topics/11348 but the code doesn't seem to work. When it reaches mouseDragged() "MotionEvent me = (MotionEvent) mouseEvent.getNative();" it stops at this line saying cannot find symbol.
How can I fix this in a simple way? I am just learning to code.
edit: I see motionPressure being used more and more throughout the book, so I am going to need a way of replicating that function that acts the same.
import android.view.MotionEvent;
float maxPressure;
float motionPressure;
void setup()
{
noStroke();
background(0);
}
void draw()
{
fill(motionPressure/maxPressure * 255);
ellipse(mouseX, mouseY, mouseX-pmouseX, mouseY-pmouseY);
println(motionPressure);
if(motionPressure > maxPressure)
maxPressure = motionPressure;
}
void mouseDragged() {
MotionEvent me = (MotionEvent) mouseEvent.getNative();
motionPressure = me.getPressure();
println (motionPressure); // can do stuff with this float now -- mine ranges .4 - 3.6 -- not 0 -1
}