Failed to connect to WebRTC on cellular data

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

AndroidRTC

What this repository uses: io.prinstine.libjingle

This project works well when two clients are connected to the network via Wi-Fi, but it does not work when one of the clients is connected via cellular data.

I tried to find a source to find out what was going on. 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 found this line of code that 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 do I enable cellular connectivity? or I would appreciate it if you could help me find the source of my own methods used in this project to better understand the structure.

+6
source share
1 answer

from what you said, I think the library you use is connected via Wi-Fi by default, so if you plan to use cellular data, then I think you should do a test for this and then use the setoptions method found in the library, the library or your wil application continues to try to establish a connection via Wi-Fi.

0
source

All Articles