Android P2P Video chat using SIPDROID - android

My plan is, to create a instant video chat App for Android. I've found Sipdroid wich gives me the opportunity to make video and voice calls using the SIP.
The user should just open the App and be able to instantly video chat with another stranger from the pool.
Now the question is: I only need to setup a SIP-Server and create a pool of SIP-Accounts or create them on demand. Then I'm able to use Sipdroid and modify it, so it fit's my needs.
Is this all? How about this STUN-Server thing? Am I missing something?
How many connections could take a avarage root-server? Actually it should be a lot, because the stream is transmitted using P2P.
Other suggestions to create a P2P anonymous video chat app? I've seen similar Apps. But they use FLEX. This is not what I want to do.

Seems like you are in the good direction. You will need to do the matching logic between 2 idle users and incorporate that feature into SipDroid. There may be some complexity in finding the idle users due to all kinds of corner cases you will get. It may be similar in features as implementing presence in an IMS system.
For STUN, it is synonym to NAT traversal. You may need to care about that but it depends of your network setup.
For the performance, it will vary upon server implementations and hardware you use. You will need to do your own benchmarks. I would guess you don't need to worry unless you have a few dozen concurrent users.

Related

Android multithreading logic behing a speed test

I'm currently designing a speed test app that obviously includes Ping, Download & Upload tests among others.
I already developed the logic behind the multithreaded tests so I can define create as many threads as I need for each test, being able to set multiple connections to avoid throttling for high speeds or unstable networks and having more precise results.
I'm not currently asking for code but I'm asking for the logic behind of the number of threads to use for each test for every network type and available bandwidth.
As a piece of additional information, my download test uses https connections and the upload test uses socket connections. Any required additional information, please let me know.
I've tried research about that but the only thing I could find is that Ookla Speedtest (browser version) uses 4 threads if the speed is at least 4Mbps and 2 threads on lower but browser multithreading limitations are different than the ones we have in Android apps. -> Link
I don't expect that someone gives me the exact logic behind this but it would be really useful if I could be pointed in the right direction. Any article, post, book, resource about the topic would be much appreciated.

remove WebRTC and add zeroMQ in an android app

How to I remove WebRTC and add ZeroMQ to my android app?
Should I reverse the steps I did to add the WebRTC and then add ZeroMQ functionality?
Or is there a different approach?
Hmmm, well WebRTC is a protocol built on top of RTP, which is intended for the non-guaranteed delivery of time critical data (video frames, audio, etc), with no guarantee of order of delivery either.
In contrast, ZMQ is a message oriented Actor Model framework with useful design patterns, guaranteed delivery (assuming the network stays up), and is very good for applications that need to ship messages around.
They are quite different. Am I right in assuming that you've started off using WebRTC (possibly due to familiarity) and have run into the limitation inherent in any protocol based on UDP (which is what RTP uses)?
If you're to use ZMQ, you have have to use it at both ends of every communication path on which you wish to use it. You cannot, for example, have ZMQ on the Android app talking to a WebRTC server. ZMQ speaks to ZMQ, and nothing else.
The good thing is that WebRTC (RTP) is similar. So if you're already using WebRTC, that might mean you control all the software. That means you can change it to use ZMQ. [The alternative, e.g. the other end of the WebRTC link was some server system that could not be change, would prevent you changing just your Android App over to ZMQ.]
As to replacing WebRTC with ZMQ, well that very much depends on what it is you're trying to send. Fundamentally ZMQ deals in messages. A message is an array of bytes. The bytes for a message are transmitted as a block from sender to receiver in a single send/receive operation. If that doesn't fit (e.g. you have a video stream with no obvious demarcation between logical chunks of video) then you may run into problems.
Often people use something like Google Protocol Buffers to define message classes which they then serialise to byte arrays, and it's these that are sent in a message. The receiving end passes the received byte array at the deserialiser, reconstituting the class as was.
Good luck

What type of service to use for video hosting in an android app?

I am currently working on an android application for a start-up business.
Part of my android app provides viewing and download of video files similar to a podcast app, having both by-network viewing as well local storage capabilities for offline viewing.
However, I need to acquire a service/server that provides the hosting and public sharing capabilities that this process requires.
The usage type is pretty simple. I need to host the videos (of which there are not a considerably large amount) somehow, and somehow access them through direct link in my app.
What kinds of business solution would best serve this type of arrangement?
I've looked into Amazon S3, Microsoft Azure, Rackspace and B2 and these seem like the ideal solutions, but I'm not clear as to whether these are commonly used for such purposes. In addition, Backend as a Service platforms like Kinvey and Parse exist, as well as Vzaar, a video hosting business solution.
With so many different systems and unclear use cases it's hard to tell what would be most cost-effective.
What type of system is common practice to use for this type of arrangement?
Do I need a BaaS, a PaaS, or a CDN? Or would something like Amazon S3 work for this arrangement? Or would it be better of trying to find a way to host these videos through the company Wix website?
I'm not necessarily looking for a "use this" type answer, but more I need the right direction to compare and contrast services.
Note: This isn't a strictly programming question, rather an implementation one. I wasn't sure where on SO to place this, given that many similar questions exist concerning implementation and use of these types of services on the main SO.
Hosting and serving videos is quite a specialist domain - the files are large typically, and most decent video streaming servers will include mechanisms to adjust to quality level depending on the bandwidth available to the client.
The technique used to do this is called adaptive bit rate streaming - essentially multiple different quality levels copies of the video are created and broken into, for example, 10 second chunks. The client requests the video one chunk at a time and can switch between quality levels, and hence size, depending on the current network conditions. Hopefully, this give some feel for the complexity levels.
Because of this, you are often best using a dedicated streaming server - you can either set one up yourself or use a hosted service.
Examples, free and commercial, of streaming servers you can host yourself:
https://www.wowza.com
https://gstreamer.freedesktop.org
And examples of hosted video servers (there are many more...):
https://vimeo.com/
http://wistia.com/
First of all let's be clear: I work at vzaar, so I have both personal experience and bias. Make of that what you will.
Above all else I'd encourage trying the various SaaS options out - almost all of them have a free trial and there should be people on hand to answer any questions then and there.
In the application you're describing, we'd effectively fill the role of both a storage and CDN provider, giving you file hosting space and CDN backed global delivery without the need to set up and manage those aspects yourself.
Another function that's often not considered is video encoding. If your videos are already small, efficient, widely compatible files then that's great. If not, a SaaS platform will generally encode them for you. In the long run this can save huge amounts on both storage and bandwidth costs as well as ensuring the best possible device compatibility.
Most vzaar users are using our built in player embedded into their web page via an iFrame. This works fine in many cases, but for apps like you're describing we mostly see people use the video asset links we provide: simple URLs for the video file as well as thumbnails and the like. Backed by a REST API this provides quite a bit of flexibility.
All in all, a SaaS platform is a pretty common approach for the type of thing you're talking about and I'd strongly recommend giving those that interest you a spin. Of course, if you have any questions about vzaar specifically we're more than happy to answer them over at https://vzaar.com/contact/.

Importing Artificial Neural Networks in Android App

This might sound a bit of a stupid question, but I'm doing a project where I'm using an ANN to diagnose Sepsis in patients using various vital signs as inputs. The aim is to then develop an Android app that allows a user to put in the inputs and will return a risk score (% likelihood of sepsis, etc)
I'm constructing my ANN using Matlab (using their pattern recognition network wizard), and I'm using MIT App Inventor 2 to build the App itself.
Where I'm struggling, is understanding how one would actually put the ANN into the app. Can anyone explain how this works to me, or even just point me in some vague direction?
There is a matlab-compatible programming language called Octave, and it works on Android as well. You might want to take a look at it, it's called addi.
Matlab/Octave is great for scientific prototyping. Once you enter the realm of mobile applications, the best option is to re-write the libraries in Java. It could be painful but with a proper design you will be able to scale your app without depending in Matlab/Octave hacks.
If this absolutely positively has to be present on Android, on the phone itself, the straightforward way to do this is to write the software in Java and then write the Android GUI around it.
But does the software absolutely need to be on the phone? Maybe. But if not, why not make the Android part a client that communicates with a more powerful and flexible remote server? The server can implement in whatever language it likes.

How to handle bidirectional data transfer between networked devices and a server?

I had a hard time framing that question. I hope it gets the gist of my idea across.
So just to state a few points before you decide to answer. this is a project I am doing for school and it is my own idea and proposal.I am NOT looking for code. I want to hear ideas to architect a system. This thread is more of a discussion than a simple answer. So any and all input is welcome. I will be developing this application over three months and I am using the internet to brainstorm.
So the system consists of several mobile devices and a controller device. the controller sends questions that each mobile device receives. they answer it; the controller gets to see statistics in real-time on their phone or desktop. the mobile devices can join the controller's session to be able to interact.
In Java EE, I can store the controller device data in the ServletContext and the mobile device sessions can add themselves to the controller device's data_space in the ServletContext. This way the controller knows who is logged in and it can retrieve the responses of the other mobiled devices. The problem here is the issue with multi-threading as the ServletContext is not threadsafe and Sessions are all multiple threads. There is also the issue where I think this is a not a good design choice. In fact, I feel this is the most straightforward but wrong design choice to make. I would like to hear possible ideas to architect a system to deal with this kind of communication.
Also, would this problem be best solved by using the database? Would such a database centered approach affect the speed of the application? also, am I right in thinking that the database will have no problem dealing with multiple threads since it is a serial pipeline. Database in question MySQL. I am thinking of creating a unique VIEW that will be alive for the lifetime of the controller's session. the mobile devices can get the controller's unique VIEW by checking with the ServletContext and then adding themselves to the View and manipulating data in there. Is this a decent approach to the problem?
thanks for looking. :)
Good discussion.
I think that the best solution is to use a database. You should use the MVC Model View Controller pattern. In this case mobile devices will be clients which comunicates with a controller (Java EE servlet) through an http connection.
The servlet will handle the database. If a database is hosted in the same server that a Java EE application is deployed, your speed will be very good.
I don't really understand what you are you thinking on doing with the VIEW, if you explain me better we could continue the discussion with that point.

Categories

Resources