Android Question single jRDC2 Client app for multi server

Binary01

Active Member
Licensed User
Longtime User
Hello,

I've many jRDC2 Clients App for many jRDC2 Servers.

For fixed rdc link, each server ip address is coded in process global.

So I've to buils each client app for each server.

Now I want to use single client at Play store and App Store.
How can I change rdc link programmatically? (eg. encrypted setting file or any way ...)
 

Binary01

Active Member
Licensed User
Longtime User
Hello Erel,

eg. I have 10 VPS Servers that jRDC2 java app run as server.


Server 1 is ip 177.128.201.20 and port: 17100
I have to build client app that contains above server ip and port

B4X:
Sub Process_Globals
    Type DBResult (Tag As Object, Columns As Map, Rows As List)
    Type DBCommand (Name As String, Parameters() As Object)
    
    Public const rdcLink As String = "http://177.128.201.20:17100/rdc"
    Public const rdCheck As String = "http://177.128.201.20:17100/test"

Server 2 is ip 157.12.101.23 and port: 17200
I have to build client app that contains above server ip and port

B4X:
Sub Process_Globals
    Type DBResult (Tag As Object, Columns As Map, Rows As List)
    Type DBCommand (Name As String, Parameters() As Object)
    
    Public const rdcLink As String = "http://157.12.101.23:17200/rdc"
    Public const rdCheck As String = "http://157.12.101.23:17200/test"

... so on.

Now I've more than 10 servers and their own client apps.

Question is I want only client app that can change rdcLink and port to connect every server.
I think all my rdcLinks may add in single Client App's Process_Globals than choose desired server variable rdcLink in code module. But I don't want to add and fix all my vps address and port in it.

Thanks.
 
Upvote 0

RWK

Member
Licensed User
You should integrate the main Server into your App.

The Client then will on first start connect to this server an ask for some ID or somewhat....or maybe a login.

after successful login or checking for existing ID the Main server will tell the client the rdcLink to talk to, so the client can save this and talk to that server in further communication.

Greetings
Rainer
 
Upvote 0

Binary01

Active Member
Licensed User
Longtime User
Thanks for your quick reply.

Each client is integreated its server ip and port.
eg. Client 1 named gold is integreated 177.128.201.20 and port: 17100 to connect server 1.

eg. Client 2 named silver is integreated 157.12.101.23 and port: 17200 to connect server 2.

So there are many sets of server and clinets
( Sever 1+ Client 1 = 1 Set,
Server 2+ Client 2 = 1 Set
, so on..)

I've fixed client apps to its servers.

Now I don't want fixed client app (this contained fixed server ip and port).
I want only app that can dynamatically change to ip and port in run time to connect server.
My client app connect a single server at a time.
I want to add ip and port to connect server in my client app during runtime.
Now server ip and port are add client at process_globals. So I cannot change it runtime.
 
Last edited:
Upvote 0

Binary01

Active Member
Licensed User
Longtime User
You should integrate the main Server into your App.

The Client then will on first start connect to this server an ask for some ID or somewhat....or maybe a login.

after successful login or checking for existing ID the Main server will tell the client the rdcLink to talk to, so the client can save this and talk to that server in further communication.

Greetings
Rainer

Thanks RWK for your suggent.

But rdcLink can only be add Process_Globals of Main Activity.
It can not add in code or sub modules.
When rdcLink is add in code module, app give error.
 
Upvote 0

Binary01

Active Member
Licensed User
Longtime User
Thanks to all.

Now I solved my problem. I remove cont and ip address.

Process_Globals

B4X:
Public  rdcLink As String
Public  rdCheck As String

at Code module (ip and port can be loaded from db or setting file)
B4X:
Main.rdcLink= "http://xxx.xxx.xxx.xxx:xxxx/rdc"
Main.rdCheck = "http://xxx.xxx.xxx.xxx:xxxx/test"
 
Upvote 0
Top