I find the folder in android source code: frameworks\base\media\jni

I think thats the one you want. you can use the code as sample.

For example, the code below defined all the methods of class
MediaPlayer:
static JNINativeMethod gMethods[] = {
    {"setDataSource",       "(Ljava/lang/String;)V",            (void
*)android_media_MediaPlayer_setDataSource},
    {"setDataSource",       "(Ljava/io/FileDescriptor;JJ)V",    (void
*)android_media_MediaPlayer_setDataSourceFD},
    {"prepare",             "()V",                              (void
*)android_media_MediaPlayer_prepare},
    {"prepareAsync",        "()V",                              (void
*)android_media_MediaPlayer_prepareAsync},
    {"_start",              "()V",                              (void
*)android_media_MediaPlayer_start},
    {"_stop",               "()V",                              (void
*)android_media_MediaPlayer_stop},
    {"getVideoWidth",       "()I",                              (void
*)android_media_MediaPlayer_getVideoWidth},
    {"getVideoHeight",      "()I",                              (void
*)android_media_MediaPlayer_getVideoHeight},
    {"seekTo",              "(I)V",                             (void
*)android_media_MediaPlayer_seekTo},
    {"_pause",              "()V",                              (void
*)android_media_MediaPlayer_pause},
    {"isPlaying",           "()Z",                              (void
*)android_media_MediaPlayer_isPlaying},
    {"getCurrentPosition",  "()I",                              (void
*)android_media_MediaPlayer_getCurrentPosition},
    {"getDuration",         "()I",                              (void
*)android_media_MediaPlayer_getDuration},
    {"_release",            "()V",                              (void
*)android_media_MediaPlayer_release},
    {"_reset",              "()V",                              (void
*)android_media_MediaPlayer_reset},
    {"setAudioStreamType",  "(I)V",                             (void
*)android_media_MediaPlayer_setAudioStreamType},
    {"setLooping",          "(Z)V",                             (void
*)android_media_MediaPlayer_setLooping},
    {"isLooping",           "()Z",                              (void
*)android_media_MediaPlayer_isLooping},
    {"setVolume",           "(FF)V",                            (void
*)android_media_MediaPlayer_setVolume},
    {"getFrameAt",          "(I)Landroid/graphics/Bitmap;",     (void
*)android_media_MediaPlayer_getFrameAt},
    {"native_setup",        "(Ljava/lang/Object;)V",            (void
*)android_media_MediaPlayer_native_setup},
    {"native_finalize",     "()V",                              (void
*)android_media_MediaPlayer_native_finalize},
};


On 2月4日, 上午10时27分, "Jerry Yang" <[email protected]> wrote:
> Hi, all
>
> Does anyone have any information about using the external C written lib?
>
> I have a C lib(no user interface, can be compiled like dll or lib) that
> need to be used in the app, but I cannot find any document in android
> SDK about how to use the external lib.
>
> My idea is: I should cross-compile the lib with arm based detain GCC and
> use the interface to Android app. Any one has any document or example
> about this?
>
> Appreciate for your help!
>
> With best wishes
>
> Jerry Yang

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to