cancel
Showing results for 
Search instead for 
Did you mean: 

How to manage the ports in android native app

midhun_vp
Active Contributor
0 Kudos

Hi ,

I developed an android native application using the generated code from SUP.

In the android app the registration happens using the port 5001 and synchronization happens using the port 2480.

I want to keep the ports dynamic. In that case the user has to enter port 5001 and 2480 from his device as input.

It will be make the app complex. How to handle this part?

Please give a solution.

Thanks

Midhun

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

One more idea what I can give you at this momment is construct a small tinny xml file name it as a config.xml in which add fields like <messagingPort>5001</messagingPort> <syncPort>2480</syncPort> <SUPServer>companySUPServer</SUPServer> etc

and host this xml file somewhere and load the xml file at run time or everytime you lunch the application, if there is a change in the node values it will automatically get updated in that way you can modify the ports at run time with out changing anything in the client side.

midhun_vp
Active Contributor
0 Kudos

How the data in xml is updated automatically?

Former Member
0 Kudos

Aaah, well that you have to update it manually , by the way you can always use sybase hosted relay server too

Former Member
0 Kudos

You can use a XML file inside the Res folder with all values on it. For example i use it to store host name, port number and other useful static variables...

rakshit_doshi
Active Contributor
0 Kudos

Hi Midhun,

We specify the ports during installation of SUP only. By Default it is 5001 and 2480. It even gives up an option to change the port if we want to use our own custom ports.

But i dont understand why in your application which is a native application do you want the user to enter the port number.

All this can be coded inside the program only.

The user shud only be allowed to enter the username and password.

Android applications dont require an Appdelegate type settings screen for registration.

Hope this helps,

Thanks,

midhun_vp
Active Contributor
0 Kudos

Rakshit,

I am developing an android application that can be used for any companies.

In that case there need not be the ports (5001,2480) same for all companies. They may be using different ports instead of 5001 and 2480.

So if I hard coded these values in the application code the app won't work or I have to change the code and give the app to specific companies.

Other than keeping two edit box for the ports how we can manage this situation.

Former Member
0 Kudos

Hi Midhun,

Basically we use 5001, 2480 ports for the development use, so that it is easier and faster during the development, whereas in a realtime production situations you need not hardcode anything in the client code, you can very much enable relay server outbound enabler, In this scenario one relay server can be configured with 'n'  number SUP (dev, QA, Stagging, production etc...)with out any change in the client side.

by default HTTP and HTTPS port is 80 and 443 respectively.

Hope that helps you

Regards,

Srinivas Divakarla

rakshit_doshi
Active Contributor
0 Kudos

There is a very rare case scenario where in the company changes the ports during installation process.

Check this link for the usage of various ports.

http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

And according to your description it is a hypothetical situation and a very poor solution to let user enter the port numbers.

End user never expects to remember all these values.

Thanks,

midhun_vp
Active Contributor
0 Kudos

I got your point Srinivas.

But if the relay server is absent the same issue will come right.

midhun_vp
Active Contributor
0 Kudos

Rakshit,

I reviewed the standard apps provided by SAP, all the apps have the input field port. So hard coding of the port in the application is not a good solution in a production environment.

Also user don't want to remember these values since the user has to provide the connection settings only for a single time.

Former Member
0 Kudos

According the best practice as well as for security reasons for Enterprise application relay server is must to have that's why relay server plays a much important role