We help IT Professionals succeed at work.
Get Started

Sound in j2me + midlet life cycle

khamouda asked
Last Modified: 2008-03-17

Dear all

For Nokia UI API , the Sound class , accepts only byte array, so if i've  a mywavFile.wav I should stream it using :

DataInputStream dis = new DataInputStream( mid.getClass().getResourceAsStream(mywavFile.wav ) );
int bytesRead = dis.read( data );
byte[] soundData = new byte[ bytesRead ];
System.arraycopy( data,0, soundData,0, soundData.length );
Sound snd = new Sound( soundData, Sound.FORMAT_WAV );

?? or what ??

Another Question please

For the TimerTask class, if i schedule an alarm say after two hours, and then close the application, will it be called ?, what if I build a method to be invoked by this alarm bill , will it run ?, even after the application closed ?

What if I don't destroyApp(), or notifyDestroyed() ?

thanks for the clarification

Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE