Placeholder Image

字幕表 動画を再生する

  • HttpURLConnection is one HTTP client

  • that you can use to make HTTP requests in Android.

  • Now, you can also use third-party libraries that

  • weren't created by Google.

  • For example, OKHttp is a popular open-source HTTP client

  • created by the Square Mobile Payments Company.

  • They've done a lot of open-source work for Android.

  • This class helps you send and

  • receive data across the web using an HTTP connection.

  • Once you have a URL,

  • actually opening up an HTTP connection is actually pretty straightforward.

  • You start by calling url.openConnection.

  • Then to actually fire off the connection, and

  • be ready to return results, you go ahead and you specify the RequestMethod.

  • In this case, we're going to use the GET HTTP method.

  • Then, you go ahead and call Connect and then finally, you call getInputStream

  • on your connection which is going to be the input stream containing the results.

  • Now, despite the of the codes that you see here,

  • the Android platform is actually handling many of the complex networking

  • details on to the hood for you.

  • In other words, Android as an operating system is actually working with your

  • device's hardware to setup connection and handled some of the physical steps

  • that need to happen in order for the communication to work.

HttpURLConnection is one HTTP client

字幕と単語

動画の操作 ここで「動画」の調整と「字幕」の表示を設定することができます

A2 初級

HTTPURLコネクション (HttpURLConnection)

  • 17 1
    Shuyang に公開 2021 年 01 月 14 日
動画の中の単語