spmPlayer=new MediaPlayer(); status_t status; status = mPlayer->setDataSource("/system/media/bootanimation.mp3", NULL); mPlayer->setAudioStreamType(AUDIO_STREAM_BOOT); status = mPlayer->prepare(); /*to play sound*/ if (status == NO_ERROR) { status = mPlayer->start(); } if (mAndroidAnimation) { r = android(); } else { r = movie(); } /*to stop music*/ if (status == NO_ERROR) { mPlayer->stop(); mPlayer->disconnect(); } /*to destructor mediaplayer, use feature of StrongPointer*/ mPlayer = NULL;