Monday, January 20, 2014

Goal: Cross platform (Android / iOS) WebRTC app using MVVMCross

I am attempting to port 2 Java apps that are part of the WebRTC code to Mono/C#. 
The code is available on GitHub, it is still a fairly early version but it builds (there are some problems during run-time).

Project goals
  1. make an opensource viable implementation of WebRTC for use in Mono / Xamarin / .NET on Android and iOS
  2. make an implementation of a WebRTC UIView/Activity that can be re-used across Android and iOS with as little as possible modifications
  3. be able to share as much code as possible between the different platforms by utilizing PCL (portable class libraries) and MVVMCross
  4. all possible UI logic moved to a shared portable class library using MVVMCross ViewModels
  5. move the WebRTC signaling behind to an interface located in a portable class library with an reference implementation, allowing people to reuse signaling code across platforms, while still implementing their own.
  6. in time write a new similar native interface as the JNI for Java but without JNI and directly targeting being invoked using P/Invoke / Mono / .NET allowing C#/Mono to directly interact with the C/C++ WebRTC library (see related question at Mono-JNI-Performance)
At least one of these goals are outside my comfort zone (#6), and all of them are currently pending, I believe #1 is well in progress.

Currently I am still in the progress of getting the actual WebRTC meeting working. I believe I have a problem in the converted signaling code, which I am trying to track down.

GitHub repositories
appspotdemo-mono (this is the repository that I am focusing my immediate attention on - but I have been short on time lately)

Background for the webrtc-app-mono repository:
When I built the native .so ( it also build a full android apk that you can install and test. That was the app I already tried on my devices which worked the same way as That that was the code I was actually looking for, and as embarrassing it is to admit it - the repo was me porting the "wrong" Java app code. When I found out and figured out how to work with JNI (mainly through using the Java Binding Library) I went looking in the official WebRTC code again to find the app that I tested in the Java version. This is the repo at So basically having 2 repositories are proof of me not being familiar with the official WebRTC code base and not really knowing what code is which.

Any help or suggestions are welcome, please feel free to fork, create issues or communicate here and I will do my best to answer.

Post a Comment