I need to make one to many android java

By saying two of them, are you referring to 2 androids or 1 server 1 android?

Sorry, I was out for a few days.

Seems that you made nice progress here, now we can try to debug the connection issue.

Can you check these?

  1. can you access https://192.168.1.6:4443/dashboard/ from the phone web browser?
  2. if step 1. works can you test the connection from that web page?

Then you’ll know if the phone connects to the Openvidu server successfully and move to the Android app. If it doesn’t then your host must be blocking that port.

By the way you don’t need to run that http server at all. The connection is supposed to be done on 4443 port.

Regards,
Mihail

1 Like

@mihailj
Thanks so much,i appreciate that you give me from your time,
#Do you mean that i don’t need the first command prompt in my first photo,
And docker is enough?
#is the https link in the android activity is suitable?
This is my new current situation image1
Note: the page in mobile browse still loading and this is the prompt response

`

@franziz franzi
I am referring to 1 androids and 1 server as start

The first command runs the insecure js tutorial which is an OpenVidu client example. You can check if you can access the OpenVidu server using it, but it’s not required for the mobile app.

Also can you try opening https://localhost:4443/dashboard from the same computer?

If it doesn’t work there’s a problem with the docker port mapping on Windows. I don’t have a Windows machine to test.

Maybe this helps:

ok can you double check my steps :
1-i open docker app
2-i open command prompet
3-prompet code:

docker run -p 4443 --rm -e OPENVIDU_SECRET=MY_SECRET -e DOMAIN_OR_PUBLIC_IP=192.168.1.6 openvidu/openvidu-server-kms:2.15.0

4-i go to opera web browser in my laptop and entered:
https://192.168.1.6:4443/dashboard/
is this right or:
https://127.0.0.1:4443/dashboard/
5-i tried to open port 4443 on my windows 10

Should i click sign in/create docker id now?,
or change configuration on my router,and wifi is ok or i should connect by cable?
i feel that there is step/s that i done wrong.

One thing that I’ve noticed is that the -p 4443 parameter is actually -p 4443:4443 in the official documentation.

The IP shouldn’t matter if you’re trying to connect from the same computer (localhost, 127.0.0.1 and 192.168.0.112 all work for me, see attachment), but for trying outside connections like from the mobile phone it should be 192.168.1.6 (the network IP).

1 Like

:+1::notes::musical_note::slight_smile:
Now it’s working :heart::heart::heart::heart:thanks
What is the next step to reach my target???

target

Great, did you manage to connect from the Android app to the server? Then you can get back to modifying the Android app to suit your needs.

One idea would be to use the existing OpenVidu user roles MODERATOR for the manager and PUBLISHER for the employees.

The user role is set in the token request REST API call (search for /api/tokens in the Android code).

Then you have to figure out how to get the user role when a remote participant joins the session and display or not the video according to your rules. I didn’t try this in the Android code so I can’t help…

An alternative to the OpenVidu user roles is to set a meta data field to the users (it’s probably easier to implement this), let’s say you want to add job = "manager" or job = "employee". This is done in the joinRoom function here: https://github.com/OpenVidu/openvidu-tutorials/blob/d771f5b80837a911f318a919194da0cbdfe744ff/openvidu-android/app/src/main/java/io/openvidu/openvidu_android/websocket/CustomWebSocket.java#L169

Make sure to encode properly the JSON as a string or it will crash.

Then you can check the job meta data field in this function: https://github.com/OpenVidu/openvidu-tutorials/blob/d771f5b80837a911f318a919194da0cbdfe744ff/openvidu-android/app/src/main/java/io/openvidu/openvidu_android/websocket/CustomWebSocket.java#L328

Good luck!

1 Like

@mihailj
yes, now i when i click join the video call starts and tried open dashboard successfully,
1-i have followed your steps and this is what i done:
A-i have added an getter and setter for Session.java class for String whoIsMe
and passed the manager or employee parametera.
B.in joinRoom() method i add

 joinRoomParams.put("whoIsMe", this.session.getWhoAmI());

public void joinRoom() {

Like this:

    Map<String, String> joinRoomParams = new HashMap<>();
    joinRoomParams.put(JsonConstants.METADATA, "{\"clientData\": \"" + this.session.getLocalParticipant().getParticipantName() + "\"}");
    joinRoomParams.put("secret", "");
    joinRoomParams.put("session", this.session.getId());
    joinRoomParams.put("whoIsMe", this.session.getWhoAmI());
    joinRoomParams.put("platform", "Android " + android.os.Build.VERSION.SDK_INT);
    joinRoomParams.put("token", this.session.getToken());
    this.ID_JOINROOM.set(this.sendJson(JsonConstants.JOINROOM_METHOD, joinRoomParams));
}

C.in RemoteParticipant newRemoteParticipantAux() Method i got the “whoIsMe” String

String clientWhoIs = json.getString(“clientData”);
if (clientData != null) {
whoIsMe = clientWhoIs;
}

:point_right: :point_right: But this method is never Called because i still don’t know how to connect out of local network :point_left: :point_left:
Like this:

private RemoteParticipant newRemoteParticipantAux(JSONObject participantJson) throws JSONException {
final String connectionId = participantJson.getString(JsonConstants.ID);
String participantName = “”;
if (participantJson.getString(JsonConstants.METADATA) != null) {
String jsonStringified = participantJson.getString(JsonConstants.METADATA);
try {
JSONObject json = new JSONObject(jsonStringified);
String clientData = json.getString(“clientData”);
if (clientData != null) {
participantName = clientData;
}
//
String clientWhoIs = json.getString(“whoIsMe”);
if (clientWhoIs != null) {
}
whoIsMe = clientWhoIs;
Log.e(“testResult”,whoIsMe);

            //
        } catch (JSONException e) {
            participantName = jsonStringified;
        }
    }
    final RemoteParticipant remoteParticipant = new RemoteParticipant(connectionId, participantName, this.session);
    this.activity.createRemoteParticipantVideo(remoteParticipant);
    this.session.createRemotePeerConnection(remoteParticipant.getConnectionId());
    return remoteParticipant;
}

2-What is the next Step and what about connecting to the server without the same network connection of the server like
if the manager or one of the employees work remotely how i can achieve that?

Hello!

  1. The whoIsMe parameter is set outside the METADATA, I don’t think that it’s passed back to the connected clients. It should be:
joinRoomParams.put(JsonConstants.METADATA, "{\"clientData\": \"" + this.session.getLocalParticipant().getParticipantName() + "\", \"whoIsMe\": \"" + this.session.getWhoAmI() + "\"}");

Seems that you are extracting it OK in the newRemoteParticipantAux function.

  1. You need to install OpenVidu on a server - I had success with AWS instances, MS Azure instances and VPS on DigitalOcean. They are all running Linux and had OpenVidu installed with the on premises method. https://docs.openvidu.io/en/2.15.0/deployment/deploying-on-premises/

I also have domains (or subdomains) pointing to the external IP of these servers. This allowed me to use the auto-generated LetsEncrypt certificates. Once you host OpenVidu on an external server you will need to use SSL with real certificates. The installation process and documentation were improved greatly by the OpenVidu team, you can run a server in minutes. If you want to keep it simple this is the way to go.

Once you have the OpenVidu server running on a domain/subdomain you can connect with any client from any network. There’s a demo app automatically installed on port 80 to verify if things are working correctly.

1 Like

Is there is any way to work with windows,or firebase servers or firebase host?
If not, after installing ubuntu what i need to do @mihailj ?

Please keep supporting me
Notice i used ubuntu for a year as user not developer, after installing ubuntu what i need to do ?
If it’ll be hard for me if i find an server developer and add him to my team what can i ask from him exactly ?

use docker And use docker image of openvidu-kms
Thanks