How to add compiled SDL lib to existing Android project

Hi all! I need help :frowning: .
I am trying to develop video player for Android using ffmpeg. And basically all tutorials describe how to play decoded video with the help of SDL. Now I am reading video frames and show them on SurfaceView. But I need to play sound stream, so I also decided to use SDL.
And I want to ask: how can I add link to lib2SDL.so which is compiled with ndk-build to my existing project? It is hard for me to use basic android-project from archive (because of my own project architecture). Are there any ways of how can I add compiled lib2SDL to my existing project (step-by-step if it is not difficult)?
[Rolling Eyes]
Thanks!!!

Hi.

You have 2 options to do this.

  1. No use precompiled libraries. Add to your Android.mk an invocation to
    the SDL makefile and add linking flags

Invoke SDL script. It is not exported as a module, so we have

to set manually LOCAL_C_INCLUDES, LOCAL_STATIC_LIBRARIES and LOCAL_CFLAGS

  1. If you have already prebuilt, you can try to use

LOCAL_WHOLE_STATIC_LIBRARIES := SDL2

OpenCV use the method 1, so if you want a working example, download it and
try to use it.

Hope this helps!

2014/1/14 bukka.wh <bukka.wh at gmail.com>> Hi all! I need help [image: Sad] .

I am trying to develop video player for Android using ffmpeg. And
basically all tutorials describe how to play decoded video with the help of
SDL. Now I am reading video frames and show them on SurfaceView. But I need
to play sound stream, so I also decided to use SDL.
And I want to ask: how can I add link to lib2SDL.so which is compiled with
ndk-build to my existing project? It is hard for me to use basic
android-project from archive (because of my own project architecture). Are
there any ways of how can I add compiled lib2SDL to my existing project
(step-by-step if it is not difficult)?
[image: Rolling Eyes]
Thanks!!!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thank You very much, piperoman. I’ve used the first method and now everything works!