dev7dev / V2ray-Android

A simple Java module with sample source for implementing V2ray/Xray on Android.
37 stars 12 forks source link

Observe broadcast reciever's connecting status #21

Closed farzinAndroid closed 1 month ago

farzinAndroid commented 1 month ago

Hi thanks for providing us with this module. i have a question how can i observe the connecting state of the service i know the v2ray service connects fast and we really cant see a connecting state but i was wondering if we can manually simulate a connecting state?

CodeWithTamim commented 1 month ago

Use a handler inside the V2rayCoreManager to do this.

dev7dev commented 1 month ago

Hi thanks for providing us with this module. i have a question how can i observe the connecting state of the service i know the v2ray service connects fast and we really cant see a connecting state but i was wondering if we can manually simulate a connecting state?

You can create a connection test process and set its state as connecting.

farzinAndroid commented 1 month ago

Isn't it possible to use a delay manually after we put the connection state to CONNECTING? i believe the reason that this is not showing is because v2ray connects vary fast to the server.

dev7dev commented 1 month ago

It is possible to put a connection test inside the V2rayCoreExecutor.java class. Or, as Tamim said, you can use a handler to change the state of the kernel to the connected state with a few moments of delay so that the user can finally see the connecting state.