I am developing an application based on codenameone. Now I try to play sounds in the background. Unfortunatly I didn't found a code sample for that.
The only thing I have I the following, which didn't work:
InputStream uri = getClass().getResourceAsStream("startsound.mp3");
try {
findMediaPlayer().setDataSource(uri,"audio/mpeg",null);
} catch (IOException ex) {
}
findMediaPlayer().run();
Does anyone have a sample code for that problem?