You appear to be confusing the C++ and Java languages. Or at least, you say you have a sample.cpp file, and use pointers in your code, however some of the APIs you are calling don't exist in the native Android code (in particular, all of the set***Listener() calls). What are you trying to do exactly?
On Jan 26, 10:26 pm, srini amul <[email protected]> wrote: > Hi all, > I have a sample.cpp file which has playAudio() function in it. PlayAudio() is > used to play a audio file. > --------------------------------------------------------------------------------------------------------- > Please check the below code: > ***************************** > > void playAudio (char* url) > { > MediaPlayer *mp = new MediaPlayer(); > if (NULL != mp) > { > String filePath (url, 0, strlen(url)); > mp->setDataSource(filePath); > mp->prepare(); > mp->setAudioStreamType(AudioManager.STREAM_MUSIC); > mp->setOnBufferingUpdateListener(this); > mp->setOnCompletionListener(this); > mp->setOnErrorListener(this); > mp->setOnPreparedListener(this); > } } > > void onBufferingUpdate (MediaPlayer mp, int percent) > { > > > } > > void onCompletion(MediaPlayer mp) > {} > > boolean onError(MediaPlayer mp, int what, int extra) > {} > > void onPrepared(MediaPlayer mp) > { > mp->start();} > > --------------------------------------------------------------------------------------------------------- > Question: > ********* > a) Can i call new MediaPlayer() in sample.cpp file ? > b) How can i import android.media.mediaPlayer package class in sample.cpp > file? > c) How can i handle a onBufferingUpdate() & onCompletion() & onError() & > onPrepared() message from media player library ? > > -------------------------------------------------------------------------------------------------------------- > > Thanks & Regards, > P.Sriniamul > > Add more friends to your messenger and enjoy! Go > tohttp://messenger.yahoo.com/invite/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---
