Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Demo App #39

Open
anikravesh opened this issue Jan 16, 2015 · 11 comments
Open

Android Demo App #39

anikravesh opened this issue Jan 16, 2015 · 11 comments
Assignees

Comments

@anikravesh
Copy link

I am trying to use Android Native app. Some questions:

  1. I have built openwebrtc for android. I am wondering how I can include that in to the demo app? Where is the generated .so files? Is that an Android library that I should include?
  2. Is the server address hard coded in the app? can I change the address of server?
@Rugvip
Copy link
Contributor

Rugvip commented Jan 16, 2015

  1. To use the native OpenWebRTC API on Android, you just need to add openwebrtc.jar from openwebrtc/out/arm-linux-androideabi/jar/ to your project libraries. The needed .so files are included in the jar and loaded when Owr.init() is run.

If you're using gradle, you need to make sure you add this to your config:

ndk {
    abiFilter "armeabi"
}

The native example application is configured so that you should be able to import and build the project straight away, as long as openwebrtc and openwebrtc-examples are in the same folder.

  1. Are you referring to Android native call #31? in that case you just need to press the wrench icon in the top right and you can enter a different server address. If you're referring to this example there's no server to configure, it's just a simple self-view app.

@anikravesh
Copy link
Author

Thanks,
I've added the openwebrtc.jar from openwebrtc/out/arm-linux-androideabi/jar/ into my build path and I don't have any libs or armeabi folder in my Eclipse project.

Here is the error I get when I try to run the test Native app:

E/AndroidRuntime( 4237): FATAL EXCEPTION: main
E/AndroidRuntime( 4237): Process: com.example.openwebrtctest, PID: 4237
E/AndroidRuntime( 4237): java.lang.NoClassDefFoundError: com.ericsson.research.owr.Owr
E/AndroidRuntime( 4237): at com.example.openwebrtctest.MainActivity.(MainActivity.java:55)
E/AndroidRuntime( 4237): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 4237): at java.lang.Class.newInstance(Class.java:1208)
E/AndroidRuntime( 4237): at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
E/AndroidRuntime( 4237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2299)
E/AndroidRuntime( 4237): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)
E/AndroidRuntime( 4237): at android.app.ActivityThread.access$900(ActivityThread.java:170)
E/AndroidRuntime( 4237): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304)
E/AndroidRuntime( 4237): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 4237): at android.os.Looper.loop(Looper.java:146)
E/AndroidRuntime( 4237): at android.app.ActivityThread.main(ActivityThread.java:5635)
E/AndroidRuntime( 4237): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4237): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 4237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
E/AndroidRuntime( 4237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
E/AndroidRuntime( 4237): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 840): Force finishing activity com.example.openwebrtctest/.MainActivity

@Rugvip
Copy link
Contributor

Rugvip commented Jan 17, 2015

Could you try the same in Android Studio? The build hasn't been verified with Eclipse, since Android Studio is the official IDE.

@samasama-studios
Copy link

Hello team,

First of all thanks a lot for all the hard work and time spent on this project.

Would it be possible to provide an already built openwebrtc.jar within https://github.com/EricssonResearch/openwebrtc-examples/tree/master/android/Native/app/libs? Then is upto the developer to build the entire openwebrtc framework and/or just build the standalone app.

Thanks a lot in advance,

José

@stefanalund
Copy link
Contributor

Hi José,

We plan to have better handling of releases and are looking in to providing builds, but for now you will need to build the project yourself.

@samasama-studios
Copy link

@stefanalund thanks for the reply, looking forward for those updates then. Please keep me posted!

@leonhust
Copy link

leonhust commented Feb 5, 2015

Hello all,

I've managed to build openwebrtc framework for andoird via cerbero with great support from stefan. Thanks stefan!

Now I'm trying to test NativeCall app in this example project. I copied openwebrtc.jar to NativeCall and built out an apk successfuly(with Android Studio 1.0). The problem is I can not run the apk. I got following error:

02-05 02:36:03.175 1222-1222/com.ericsson.research.owr.examples.nativecall E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.ericsson.research.owr.examples.nativecall, PID: 1222
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.ericsson.research.owr.examples.nativecall-2/base.apk"],nativeLibraryDirectories=[/data/app/com.ericsson.research.owr.examples.nativecall-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libopenwebrtc.so.3601,libgstvideo-1.0.so.0,libgstapp-1.0.so.0,libgstreamer-1.0.s.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at com.ericsson.research.owr.Owr.(Owr.java:5)
at com.ericsson.research.owr.Owr.init(Native Method)
at com.ericsson.research.owr.examples.nativecall.NativeCallExampleActivity.(NativeCallExampleActivity.java:65)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1572)
at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

From the error message, it seems that four native so libs are not found. I tried two methods:

  1. Add four libs to project
  2. copy the libs manually to /data/app/com.ericsson.research.owr.examples.nativecall-2/lib/arm on target device with the correct permission set.
    Here is the result after copy:

ls -l /data/app/com.ericsson.research.owr.examples.nativecall-2/lib/arm

-rwxr-xr-x system system 172184 2015-02-05 00:50 libgstapp-1.0.so.0
-rwxr-xr-x system system 3429896 2015-02-05 00:51 libgstreamer-1.0.s.so
-rwxr-xr-x system system 1406424 2015-02-05 00:50 libgstvideo-1.0.so.0
-rwxr-xr-x system system 14193132 1979-12-31 09:03 libopenwebrtc.so
-rwxr-xr-x system system 14193132 2015-02-05 00:50 libopenwebrtc.so.3601
-rwxr-xr-x system system 347140 1979-12-31 09:03 libopenwebrtc_jni.so

But none of the solution works, I still got the same error message.

Besides, I observed that there are two libs already included in openwebrtc.jar(libopenwebrtc.so and libopenwebrtc_jni.so).

I wonder whether this is the framework building issue(say, all the necessary libs should be in openwebrtc.jar), or it's the wrong way for me to use native libs.

Thanks in advance.
Looking forward to getting your help.

@stefanalund stefanalund assigned stefanalund and Rugvip and unassigned stefanalund Feb 5, 2015
@Rugvip
Copy link
Contributor

Rugvip commented Feb 5, 2015

@leonhust Unfortunately the cerbero build for Android is broken atm, afaik @nirbheek is looking into it, but you'll have to use the build scripts for now.

I've opened an issue about it to make it more visible: EricssonResearch/openwebrtc#161

@leonhust
Copy link

leonhust commented Feb 5, 2015

Thanks for you information. I've tried build script before and it does not work for me at that time and I filed EricssonResearch/openwebrtc#158.
I'll retry with stefan's suggestion.

@leonhust
Copy link

leonhust commented Feb 6, 2015

the build script still not work for me:(

@leonhust
Copy link

leonhust commented Feb 6, 2015

Share anyone share openwebrtc.jar to me so I can start android app developing?
I've struggled for framework building for over one week:(
Thanks very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants