How can WebRTC reconnect to the same peer after internet disconnect? - java

I am working on a peer-to-peer Video call system based on WebRTC in android. my problem is I have no ideas how to reconnect video call when internet disconnect or switch from a network to other network (example switch from Wi-Fi to mobile)?

You will need to do an ICE Restart. You do this by calling restartIce and then generating a new offer for web.
See this answer for a specific android answer.

Related

PC to Android communication over USB cable

I need to make communication between PC software (written in java) and android app over usb cable. The PC software will send some data (Strings) to Android app witch will accept those strings and do some action depending on the message received.
What is the best way to do this?
I am looking all over the internet and can't find any solution to this. If someone has example of this communication i would be very grateful.
I already done this communication over sockets, put i need to cover situation if there is no router or internet connection.
Thank you
Check following article. I guess similar question to your on SO.
If you want to communicate between Android USB device and some USB host you need to use the accessory mode (https://developer.android.com/guide/topics/connectivity/usb/). But this mode requires special driver support on the USB host side (which is your PC).

Android 9: Ethernet and Wifi simulataneously

I have a scenario where I want to use wifi to connect to the internet (comfortably via androids settings) and ethernet for accessing local network which is not connected to the internet.
Thus I want to have both ethernet and wifi up simultaneously and use the routing table to send all the local requests to the ethernet and the default to wifi.
I found out android disables wifi when ethernet is enabled...
There has been a fix for an old android version on https://android.googlesource.com/platform/frameworks/base/+/refs/heads/pie-release/services/core/java/com/android/server/ConnectivityService.java
Problem: In Android 9 the file looks different and I cannot find the lines mentioned...
I am using a Khadas Vim3 and their android build.
Can you please help me, which lines need to be changed?
This is the file:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android10-c2f2-release/services/core/java/com/android/server/ConnectivityService.java
Thanks in advance

Internet is off initially, Is there any On Internet Connected Event which can be subscribed?

Looking forward to sync up data when app is connected to internet, through either WIFI or Mobile data.
Suppose internet was off initially, when internet is connected:
Is there any OnInternetConnected Event in android which we can
subscribe to?
What is equivalent to handle similar scenario?
EDIT:
The proposed links suggests checking internet access. If we follow
other answer we need to keep polling the device for internet
connectivity,
Looking for an event handler to hook into, rather than polling.

connecting two mobile phones over different network and then real time video streaming

I'm developing an application in which i want to connect two android phones over different networks and then want to stream user's video to one another with their own video e-g a user can see their own video and also the video of the friend who is connected with him over network.I want to do this thing without a server..Is it possible ??
I think this is possible see nanohttpd and you will have to connect both device using your app in same network and stream to a port listen to port

Android WiFi sending and receiving information

Sorry for kind of a dummy question, but I'm wondering how to work with WiFi connection via android. My application needs to transfer some data (both receiving and sending) with PC or with other android device using WiFi. How should I organize the process? I mean, how should I establish connection, then should I open a socket for data transfering, etc. Is there any way to do it without internet connection, smth like bluetooth, except wifi.p2p (which is only available for android 4.0)? Would be grateful for as detailed manual as possible.
Every network connection even if only in the local network or localhost reqieres the INTERNET permission.
Bluetooth and NFC might be an option, but I have no experiance with that.

Categories

Resources