<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                在學習了加載和顯示圖像的各種選項之后,來看看為 Glide 改變基本的網絡棧吧。該指南假定你正在使用 Gradle。 **集成網絡棧**? 通過 HTTP/HTTPS 從網絡上下載圖像并顯示是非常重要的一塊。雖然標準的 Android 網絡包也能做這些工作,但在 Android 中開發了很多提升網絡的模塊。每個庫有它自己的優勢和劣勢。最后,這其實需要項目的配合和開發人員自己的品位來決定的。 Glide 的開發者不強制設置網絡庫給你,所以 Glide 可以說和 HTTP/S 無關。理論上,它可以與任何的網絡庫實現,只要覆蓋了基本的網絡能力就行。用 Glide 集成一個網絡不是完全無縫的。它需要一個 Glide 的 [ModeLoader](http://bumptech.github.io/glide/javadocs/latest/com/bumptech/glide/load/model/ModelLoader.html) 的接口。為了讓你更加易用,Glide 為2個網絡庫提供了實現:[OkHttp](https://github.com/square/okhttp) 和 [Volley](https://developer.android.com/training/volley/index.html?hl=zh-cn)。 **OkHttp?** 假定你要集成 OkHttp 作為你給 Glide 的網絡庫。集成可以通過聲明一個 `GlideModule` 手動實現。如果你想要避免手動實現,只需要打開你的 `build.gradle` 然后在你的依賴中添加下面這兩行代碼: ~~~ dependencies { // your other dependencies // ... // Glide compile 'com.github.bumptech.glide:glide:3.6.1' // Glide's OkHttp Integration compile 'com.github.bumptech.glide:okhttp-integration:1.3.1@aar' compile 'com.squareup.okhttp:okhttp:2.5.0' } ~~~ Gradle 會自動合并必要的 `GlideModule` 到你的 `Android.Manifest`。Glide 會認可在 manifest 中的存在,然后使用 OkHttp 做到所有的網絡連接。 **Volley**? 另一方面,如果你偏愛使用 Volley,你必須改變你的 `build.gradle` 依賴: ~~~ dependencies { // your other dependencies // ... // Glide compile 'com.github.bumptech.glide:glide:3.6.1' // Glide's Volley Integration compile 'com.github.bumptech.glide:volley-integration:1.3.1@aar' compile 'com.mcxiaoke.volley:library:1.0.8' } ~~~ 這將添加 Volley 并集成該庫到你的項目中。集成庫添加到 `GlideModule` 到你的 `Android.Manifest`。Glide 會自動認出它,然后使用 Volley 作為網絡庫。并不要求做其他的配置! **警告:**:如果你把這兩個庫都在你的 `build.gradle` 中聲明了,那這兩個庫都會被添加。因為 Glide 沒有任何特殊的加載順序,你將會有一個不穩定的狀態,它并不明確使用哪個網絡庫,所以確保你只添加了一個集成庫。 **其他網絡庫**? 如果你是別的網絡庫的粉絲,你是不幸的。Glide 除了 Volley 和 OkHttp 外不會自動配置其他的庫。然而你隨時可以整合你喜歡的網絡庫,在 GitHub 上去開一個 pull request。為[Volley 和 OkHttp](https://github.com/bumptech/glide/tree/3.0/integration) 可能給你一個方向。 **Summary?** 你可以看到,集成網絡是相當容易,如果你剛好使用 Gradle 作為你的構建系統,這就不需要做額外的進一步配置。如果你不使用 Gradle,請看看[這里](https://github.com/bumptech/glide/wiki/Integration-Libraries)。在不久的將來,我們會在 `GlideModule` 來進行進一步的定制。敬請期待!
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看