简体   繁体   English

我应该为Android使用哪些端口?

[英]What ports should I use for Android?

I am currently creating an Android application. 我目前正在创建一个Android应用程序。 The application will be communicating with a server and also other Android devices running the same application. 该应用程序将与服务器以及运行同一应用程序的其他Android设备进行通信。 The server uses PHP with a MySQL database. 服务器将PHP与MySQL数据库一起使用。

Is there a convention for what ports to use in Android? 是否有关于在Android中使用哪些端口的约定?

Is it a good idea to hard code what ports to use or should they be different every time? 硬编码要使用的端口是个好主意,还是每次都应该不同?

There is no convention for using ports. 没有使用端口的约定。

You may hardcode your ports (and I really suggest doing that, because it makes it a whole lot easier to code and manage). 您可以对端口进行硬编码(我真的建议您这样做,因为这样做会使编码和管理变得更加容易)。

It is however considered good practice to not interfere with ports for existing applications, HTTP (port 80) for example. 但是,最好不要干扰现有应用程序的端口,例如HTTP(端口80)。 Just pick an unused or rarely used port from this list . 只需从此列表中选择一个未使用或很少使用的端口即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM