I’m trying to use apwidgets and I don’t understand why what I’m doing isn’t working.
I downloaded apwidgets_r44_for_Java1.5.zip and extracted it, and moved the apwidgets folder into the libraries folder for processing.
The gist of my code is this:
import apwidgets.*;
APMediaPlayer player;
void setup() {
player = new APMediaPlayer(this);
player.setMediaFile("file.mp3");
player.start();
}
public void onDestroy() {
super.onDestroy();
if (player!=null) {
player.release();
}
}
There are no errors in processing itself, but when I run it, I get this error:
FATAL EXCEPTION: Animation Thread
Process: xyz.crispycabot.hold_the_touch, PID: 18688
java.lang.NoSuchMethodError: No virtual method getAssets()Landroid/content/res/AssetManager; in class Lprocessing/core/PApplet; or its super classes (declaration of 'processing.core.PApplet' appears in /data/app/xyz.crispycabot.hold_the_touch-oLOKRaPnDnSce8vCYHCoEA==/base.apk)
at apwidgets.APMediaPlayer.setMediaFile(APMediaPlayer.java:81)
at xyz.crispycabot.hold_the_touch.Hold_The_Touch.setup(Hold_The_Touch.java:92)
at processing.core.PApplet.handleDraw(Unknown Source:75)
at processing.core.PSurfaceNone.callDraw(Unknown Source:19)
at processing.core.PSurfaceNone$AnimationThread.run(Unknown Source:55)