Android Studio sets network proxy

Android Studio sets network proxy

During the development process, sometimes we need to perform operations such as data transmission over the network or downloading dependent libraries. To meet specific needs, we can set up an HTTP proxy in Android Studio. This article will introduce how to configure and use HTTP proxy in Android Studio.

Proceed as follows:

  1. Open Android Studio and go to the "File" menu.
  2. Select the "Settings" option in the menu, then find the "Appearance & Behavior" column, and select the "HTTP Proxy" option under "System Settings".

Now, we can see the HTTP proxy settings page.

  1. On the "HTTP Proxy" page, first select "Manual proxy configuration" and then fill in your proxy server address and port number. The proxy server address and port number are usually provided by the network administrator.

For example, if your proxy server address is proxy.example.comand port number is 8080, fill in the following:

Proxy hostname: proxy.example.com
Proxy port: 8080

  1. If the proxy server requires authentication, check the "Authentication" option and fill in the username and password. Otherwise, you can skip this step.

  2. Click "OK" to save the settings and close the settings window.

Now, you have successfully configured the HTTP proxy in Android Studio.

Next, we will demonstrate a simple sample code that uses an HTTP proxy to obtain the content of a web page and control it

Guess you like

Origin blog.csdn.net/JieLun_C/article/details/132369340