We're trying to build an internal system which will provide us with simple chat/video features using WebRTC. We have successfully deployed Peer.js client and server which works great over the browser.
However, we can't seem to find a fairly simple Android/iOS client/SDK to make it compatible with our PeerJS server.
We've tried looking into AppRTC and got the Android client running with their server, however we can't understand how to connect it to our PeerJS server since that Android client (and server implementation) seems really complicated (we're not JAVA experts).
I've also looked into EasyRTC, however it seems that they've pulled back their native SDKs, but the technology stack looks really close to ours.
My question is, has anyone got and Android/iOS Client working with WebRTC running on a NodeJS server? What are the possible workarounds to get this up and running natively on Android?
We're looking for a fairly simple Android SDK (links to libraries/sample projects) which could work with a PeerJS server.
Edit: We could build a signaling server (on NodeJS) ourselves, but how can we build the Android/iOS clients from then on?
I'm offering a bounty of 200 rep to whoever can answer our questions.
I don't know PeerJS but it seems like using websockets. If that's the case you have to implement WebSocket client functionality in you native clients (and various PeerJS internal connection/signaling protocol).
For native to native signaling, it's really simple because we only have to exchange SDP and ICE candidate messages between clients (via WebSocket or any other messaging mechanisms).
To connect to PeerJS server, obviously, we need PeerJS client implemented in Java or C(ObjC).
I'll be surprised if such implementation or SDK exists.
I don't know current state of AppRTC source, but in its old version, it hosted a WebView to run a kind of HTML+JavaScript signaling client.
That is, you can host a WebView and reuse your PeerJS client in Android/iOS apps.
You can have look at Crosswalk project. By follow Tutorial: porting Android app from Web App for WebRTC using PeerJS library. I have done it and it worked perfectly.
There are another option which is using http://phonegap.com/ to port from web app to Android/iOS but I could not make it work event just with "getUserMedia" API.
Hope this help
I found a example in here https://github.com/pchab/AndroidRTC1
On the server they used nodejs + socket.io + AngurlarJs.
On the client they used libjingle_peerconnection + socket.io Client.
Related
I am creating an app in Android which will also be made in iOS after it's ready.
I have successfully implemented a Tomcat serverlet in Eclipse between the device and the server.
Now both these platforms use Java. This isn't the case with iOS, which I am aware that you can't program with Java, but what about the serverlet? Can I even use Tomcat?
Some guidance will be much appreciated!
Yes, you can use ApacheTomcat.
Tomcat is only the part of technology to host your Servlet.
This has nothing to do with the mobile apps that you are planning to build, since these are completely different components.
As I see it, your whole project will require to be implemented with three different technical components:
Your backend: This is your Java Servlet. It needs to run in a Servlet Container, which is indeed your Apache Tomcat setup
An Android app: Written in Java, talking to your backend via HTTP
An iOS app: Written in Swift/Objective-C, talking to your backend via HTTP
I'm developing a webRTC project, the goal is to have 8 random people on the same channel, sharing video and audio, while having the possibility of being on different platforms (iOS, Android, PC, etc).
So far, so good, I finished developing the browser client and the server (using Socket.io and Node.js), and it is working fine.
The problem is I used a webRTC abstraction to code the browser instead of the apprtc libraries, and the library I used doesn't support native apps.
My question is, should I try to code a new library for mobile based on the abstraction library I used (around 6k lines of code), try to find a way to connect peers running on the browser abstraction library and the peers using an android/iOS abstraction library, or should I re-write all client side code with apprtc samples?
The goal here is to have everything working as fast as possible and have the possibility to optimize later on.
A few notes on my project:
->The interface will be really simple, all the user has to do is click a button, I will then check for video and send him to a queue in the server (through socket.io).
->The server will then find 7 other people to connect the peer to.
->All peers receive information from the server (either a channel or other peer's client information) and set up a video and audio conference.
I've successfully build the AppRTC for android and I'm able to make videocalls providing the address of the demo app ( https://apprtc.appspot.com/?r=XXXXXXXX )
My question is, how can I make this app work with a custom WebRTC server OR with another WebRTC app ( e.g. https://talky.io/)
I'm a little bit confused about how to achieve this.
I've also followed the tutorials HERE and I'm able to make calls between desktop browser but I have no idea how to connect from the android app.
P.S.
If someone is interested I've built the app following the following links:
WebRTC : ninja build not working (see the comments)
http://simonguest.com/2013/08/06/building-a-webrtc-client-for-android/
You can achieve webrtc with your own server.
Several steps to follow:
1.Build your own HTTP server to provide the html service(i.e. the main page of your webRTC project instead of apprtc main page). In this step I use node.js and node-static(https://github.com/cloudhead/node-static).
2.Build your own signalling server. PeerJS is a good choice. Read the doc files. Also, code you HTML file to support peerjs.
Here is an example of peerjs implementation. It helped me a lot
https://developer.mozilla.org/en-US/demos/detail/peerjs
Goodluck!
Actually you can deploy web version of https://apprtc.appspot.com/ to your own server.
It's written on GAE (Google App Engine) - http://webrtc.googlecode.com/svn/trunk/samples/js/apprtc/
This has been moved to branches folder http://webrtc.googlecode.com/svn/branches/3.53/samples/js/apprtc/
Just register GAE account https://appengine.google.com/ and deploy this web app to it.
Next - you can connect WebRTC Android sample to you own GAE server - https://code.google.com/p/webrtc/source/browse/trunk/talk/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java
Find line
roomInput.setText("https://apprtc.appspot.com/?r=");
and replace apprtc server name
I am trying to build an Android (v.4.0.3) app with Phonegap (Cordova 1.7.0), Node.js (v0.6.18) and Socket.io (v0.9) on the other side. I need to do this for my school project, but I hit a wall due to my limited knowledge. I even thought that socket.io can’t be used within Phonegap (Android). Would it be possible to get some directions, link or other kind of help so that I would be able to establish connection. Connection is the main problem. The documentation is not helping me enough.
I would really appreciate some tips on how to establish a connection. I installed node inspector, but nothing. Server.js is running on an Amazon EC2 micro instance on port 8080.
I read somewhere that Android doesn't support websockets.
But isn't it true that Phonegap actually grabs the whole HTML page and packages it up to run as a native application within a UIWebView or WebView?
So in that case it is the webkit. And this one supports websockets if I am not mistaken.
Regards,
Tomaz
There's a Phonegap plugin for websockets.
This question was asked almost 3 years ago though. If you need to use node.js and cordova/phonegap together on Android or iOS see jxcore-cordova
I am making an Android application in PhoneGap. What I'm trying to do is let the application talk to my Node.js server through WebSockets. My Node.js server uses Socket.IO which automatically falls back to polling when I open the application up, in contrary to the desktop Chrome application which happily opens up a WebSocket and communicates through it just fine.
I've read this blogpost about integrating the actual WebSocket API with Phonegap. The problem there is that I'm not overriding 'onConnect, onMessage' functions manually, instead Socket.IO does all that for me.
Is there some way to integrate WebSockets into my Android Phonegap application?
Short answer: Cordova WebView doesn't support WebSockets and socket.io doesn't connect to standards-based WebSocket clients.
For your client, it still appears that if you want real websockets, you need to use a Cordova plugin that is specific to an Android build or an iOS build. Try this search, which includes anismiles repo for an Android plugin, the same blogger referenced by the OP.
So with that in mind, socket.io will not work for your server. Unfortunately, socket.io server does not support connecting to clients with an Html5 standards-based websocket connection, you have to use their client library. As you've seen, you can't use their client library in Cordova...well you can, it'll just fallback to polling.
So now your websocket client is a standards-based Cordova plugin, you need a server that supports a standards-based websocket connection. You should take a look at SockJs, Worlize, Miksago, or Einaros. There are others. I'm currently using Worlize.
Another thing to keep in mind is that there is a short list of cloud hosts currently supporting true websocket connections. I recommend DotCloud or Nodejitsu.
If this answers your question please click the check mark :)
Updating the answers, this plugin works with socket.io and it's much easier to use (PhoneGap 3.x only).
https://github.com/mkuklis/phonegap-websocket
This repository will be integrated in phonegap very soon (at least it sounds like that in the readme)
It also also provides the steps for making web sockets work in phonegap / android.
Take a look: https://github.com/anismiles/websocket-android-phonegap
Here is another websockets Android client, that I am currently evaluating.
http://jwebsocket.org/mobile/android/android_part1.htm
I'm afraid I have no idea if it will be useful to a phonegap project, not being familiar with it.
Phonegap would need to allow you to incorporate an external java library into your project and you would need to build an interface for it in java.