# Using Sound in Android

**URL:** https://discourse.processing.org/t/using-sound-in-android/762
**Category:** Processing for Android
**Created:** [June 7, 2018, 1:55am UTC](https://discourse.processing.org/t/using-sound-in-android/762 "2018-06-07T01:55:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![CrispyCabot](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@CrispyCabot](https://discourse.processing.org/u/CrispyCabot)
#### Post date: [June 7, 2018, 1:55am UTC](https://discourse.processing.org/t/using-sound-in-android/762/1 "2018-06-07T01:55:58Z")

</div>

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:

```auto
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:

```auto
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)

```

---

<div class="post-metadata">

### Author: ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)
#### Post date: [June 7, 2018, 2:30am UTC](https://discourse.processing.org/t/using-sound-in-android/762/2 "2018-06-07T02:30:56Z")

</div>

> [@CrispyCabot](#):
>
> apwidgets

I don’t think it is receiving any maintenance. Can you see if there is any date related to when it was last modified? Did you get it from github or from other repo? Check the old forum for MediaPlayer sample codes.

Kf

---

<div class="post-metadata">

### Author: ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)
#### Post date: [June 7, 2018, 10:12am UTC](https://discourse.processing.org/t/using-sound-in-android/762/3 "2018-06-07T10:12:17Z")

</div>

apwidgets does not work anymore(since 2 or 3 years) with P5…

---

<div class="post-metadata">

### Author: ![CrispyCabot](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@CrispyCabot](https://discourse.processing.org/u/CrispyCabot)
#### Post date: [June 7, 2018, 1:45pm UTC](https://discourse.processing.org/t/using-sound-in-android/762/4 "2018-06-07T13:45:39Z")

</div>

@akenaton Is there any way I could so sound then? That’s the only thing I could find that appeared to work
