Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC connection fails on Cellular Data

I am trying to create an android application with WebRTC using these projects:

AndroidRTC

Which uses this repository: io.prinstine.libjingle

This project is working well when two clients are connected to the net over wifi but it doesnt work when one of the clients is connected via cellular data.

I tried to find the source to see what is going on an I found this static class:

public static class Options {
    // Keep in sync with webrtc/base/network.h!
    static final int ADAPTER_TYPE_UNKNOWN = 0;
    static final int ADAPTER_TYPE_ETHERNET = 1 << 0;
    static final int ADAPTER_TYPE_WIFI = 1 << 1;
    static final int ADAPTER_TYPE_CELLULAR = 1 << 2;
    static final int ADAPTER_TYPE_VPN = 1 << 3;
    static final int ADAPTER_TYPE_LOOPBACK = 1 << 4;

    public int networkIgnoreMask;
  }

And I have found this line of code which refers to a native method that uses this class:

public void setOptions(Options options) {
    nativeSetOptions(nativeFactory, options);
  }

public native void nativeSetOptions(long nativeFactory, Options options);

The question is how can I enable connection over cellular data? or I would appreciate it if you would help me to find the source of the native methods used in this project to better understand the structure.

like image 413
Saeed Entezari Avatar asked Aug 12 '15 10:08

Saeed Entezari


1 Answers

from what you have said i think the library your using is connecting over wifi on default, so if you plan on using cellular data then i think you should make a test for that then use the setoptions method found within the library else the library or your app wil keep trying to make a connection over wifi.

like image 175
Smile Avatar answered Nov 14 '22 23:11

Smile