Android Question jRDC2 home server switching between wifi to internet (home ip)

yfleury

Active Member
Licensed User
Longtime User
Hi! All
I have a jrdc2 server at home. On my wifi, I use this this code to connect my app to jrdc2 server.
B4X:
Private const rdcLink As String = "http://192.168.0.6:17178/rdc"

Is it a way to switch automatically from my wifi ip to internet ip (my home) when I am outside.

I open port on my router and I can reach my jrdc2 server when I change ip address manually
 

OliverA

Expert
Licensed User
Longtime User
Always use the outside IP address even if you are on your WiFi?
 
Upvote 0

inakigarm

Well-Known Member
Licensed User
Longtime User
You can test your Android device LocalIP with
B4X:
ServerSocket.GetMyIp
If you get that this localIP is a private IP, switch to rdclink private IP; otherwise, use públic rdclink
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
Always use the outside IP address even if you are on your WiFi?
When I am at home, I can't access my home server by internet when I use wifi.

You can test your Android device LocalIP with
B4X:
ServerSocket.GetMyIp
If you get that this localIP is a private IP, switch to rdclink private IP; otherwise, use públic rdclink
I will try that

Thank all
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
On wifi I have this in log
B4X:
leserveur.GetMyIP 192.168.1.147
leserveur.GetMyWifiIP 192.168.1.147

On mobile internet I have this in log
B4X:
leserveur.GetMyIP fe80::347b:caff:febb:203e%dummy0
leserveur.GetMyWifiIP 127.0.0.1

fe80::347b:caff:febb:203e is it an ipv6?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top