starting android development

Sérgio Agostinho sergio.r.agostinho at gmail.com
Fri Mar 20 01:54:46 PDT 2015


Hi Chuck,

This might also be useful. I remember I struggled for a while to properly
build Gstreamer with Android Studio. Place your Android.mk and
Application.mk inside src/main/jni
Add these snippets to your local.properties file

android{
>     //otherstuff
>     sourceSets.main {
>         jniLibs.srcDir 'src/main/libs'
>         jni.srcDirs = [];
>     }
>     tasks.withType(JavaCompile) {
>         compileTask -> compileTask.dependsOn ndkBuild
>     }
>     task('ndkBuild', type: Exec) {
>         // normal building tool
>         commandLine 'ndk-build', 'clean'
>         commandLine 'ndk-build', 'APP_PLATFORM=*<replace with target
> version e.g. android-19>*', '-C', file('src/main').absolutePath
>     }
> }


This ensures your ndk code will always be compiled before your java code,
and that the Gstreamer.java will be already in your src folder.

Cheers


2015-03-20 9:41 GMT+01:00 Sebastian Dröge <sebastian at centricular.com>:

> On Do, 2015-03-19 at 22:30 -0400, Chuck Crisler wrote:
> > I am trying to learn Java and Android development at the same time.
> > Fortunately, I know GStreamer fairly well. I have the Android Studio, the
> > SDK and the NDK installed on my Linux system and have downloaded the
> > GStreamer 1.4.5 ARM v7 binaries. I have also downloaded the GStreamer SDK
> > and have been looking at ~slomo/gst-sdk-tutorials. I am confused and
> can't
> > seem to 'put it all together'. I have read and built and executed (on my
> > Android phone) some of the pure Android samples, including JNI samples. I
> > feel that I could convert a GStreamer Android SDK based tutorial to the
> > Android Studio structure.
> >
> > Here are the questions that I immediately don't understand.
> > 1. Do I need both the 1.4.5 binaries and the GStreamer SDK?
>
> The GStreamer 1.4.5 binaries contain everything that the "GStreamer SDK"
> contains, just 3 years newer.
>
> > 2. Do I need to build anything to get started working with the GStreamer
> > tutorials?
>
> You just need to extract the binaries to some please and then set
> GSTREAMER_ROOT_ANDROID in the environment to that place. Then you can
> just build them like any other Android project.
>
> > 3. Tutorial #1 imports package org.freedesktop.gstreamer.GStreamer,
> which I
> > don't think that I have. How should I build it, or where is it?
>
> That's autogenerated by ndk-build.
>
> > 4. Which tutorials are more current, ~slomo or the GStreamer SDK?
>
> See above :)
>
> > 5. Is it possible to run something like the command line gst-launch
> > application on Android to test pipelines and installations?
>
> Yes but command line applications don't have access to the hardware
> codecs and other things, and you need a rooted device.
>
> See
>
> https://coaxion.net/blog/2014/10/gstreamer-remote-controlled-testing-application-for-android-ios-and-more/
> for some gst-launch style application for Android/iOS.
>
> Also see
> https://github.com/sdroege/gst-player
> for some (hopefully) cleaner code (than the tutorials) for how to do
> GStreamer Android development by properly splitting the backend (C) and
> the frontend (Java).
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150320/bae49ad5/attachment.html>


More information about the gstreamer-devel mailing list