ทำการดำเนินการของเครือข่ายโดยใช้ Cronet
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Cronet คือสแต็กเครือข่าย Chromium ที่พร้อมใช้งานสำหรับแอป Android ในรูปแบบ
ไลบรารี Cronet ใช้ประโยชน์จากเทคโนโลยีหลายอย่างที่ช่วยลดเวลาในการตอบสนองและเพิ่มอัตราการส่งข้อมูลของคำขอเครือข่ายที่แอปของคุณต้องใช้ในการทำงาน
ไลบรารี Cronet จะจัดการคำขอของแอปที่ผู้คนนับล้านใช้เป็นประจำทุกวัน เช่น
YouTube
แอป Google
Google Photos
และ Maps - การนำทางและการเดินทาง
ฟีเจอร์
- การรองรับโปรโตคอล
- Cronet รองรับโปรโตคอล
HTTP,
HTTP/2 และ
HTTP/3 ผ่าน QUIC โดยเนทีฟ
- การจัดลำดับความสำคัญของคำขอ
- ไลบรารีช่วยให้คุณตั้งค่าแท็กลำดับความสำคัญสำหรับคำขอได้ เซิร์ฟเวอร์สามารถ
ใช้แท็กลำดับความสำคัญเพื่อกำหนดลำดับการจัดการคำขอ
- การแคชทรัพยากร
- Cronet สามารถใช้แคชในหน่วยความจำหรือแคชดิสก์เพื่อจัดเก็บทรัพยากรที่ดึงข้อมูลมาใน
คำขอเครือข่าย ระบบจะแสดงคำขอที่ตามมาภายหลังจากแคชโดยอัตโนมัติ
- คำขอแบบไม่เรียลไทม์
- คำขอเครือข่ายที่ออกโดยใช้ไลบรารี Cronet จะเป็นแบบไม่พร้อมกันโดยค่าเริ่มต้น
ระบบจะไม่บล็อกเธรดของ Worker ขณะรอให้คำขอส่งกลับมา
- การบีบอัดข้อมูล
- Cronet รองรับการบีบอัดข้อมูลโดยใช้รูปแบบข้อมูลที่บีบอัดด้วย Brotli
ดูวิธีใช้ไลบรารี Cronet ในแอปสำหรับ Android ได้ที่ส่งคำขออย่างง่าย นอกจากนี้ คุณยังเรียกดูตัวอย่าง Cronet
ใน GitHub ได้ด้วย
คุณส่งความคิดเห็นเกี่ยวกับไลบรารี Cronet ได้โดยใช้เครื่องมือติดตามปัญหาของ Chromium ตรวจสอบรายการข้อบกพร่องในเครื่องมือติดตามปัญหาเพื่อให้แน่ใจว่าปัญหาของคุณยังไม่ได้รับการรายงาน หากยังไม่มีการรายงานปัญหา ให้รายงานข้อบกพร่องโดยใส่คำว่า Cronet ในบรรทัดสรุป
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# Perform network operations using Cronet\n\nCronet is the Chromium network stack made available to Android apps as a\nlibrary. Cronet takes advantage of multiple technologies that reduce the latency\nand increase the throughput of the network requests that your app needs to work.\n\nThe Cronet Library handles the requests of apps used by millions of people on a\ndaily basis, such as\n[YouTube](https://play.google.com/store/apps/details?id=com.google.android.youtube),\n[Google App](https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox),\n[Google Photos](https://play.google.com/store/apps/details?id=com.google.android.apps.photos),\nand [Maps - Navigation \\& Transit](https://play.google.com/store/apps/details?id=com.google.android.apps.maps).\n\nFeatures\n--------\n\n**Protocol support**\n: Cronet natively supports the\n [HTTP](https://tools.ietf.org/html/rfc2616),\n [HTTP/2](https://tools.ietf.org/html/rfc7540), and\n [HTTP/3 over QUIC](https://www.chromium.org/quic) protocols.\n\n**Request prioritization**\n: The library allows you to set a priority tag for the requests. The server can\n use the priority tag to determine the order in which to handle the requests.\n\n**Resource caching**\n: Cronet can use an in-memory or disk cache to store resources retrieved in\n network requests. Subsequent requests are served from the cache automatically.\n\n**Asynchronous requests**\n: Network requests issued using the Cronet Library are asynchronous by default.\n Your worker threads aren't blocked while waiting for the request to come back.\n\n**Data compression**\n: Cronet supports data compression using the\n [Brotli Compressed Data Format](https://tools.ietf.org/html/rfc7932).\n\nTo learn how to use the Cronet Library in your app for Android, see [Send a\nsimple request](/develop/connectivity/cronet/start). You can also\nbrowse the\n[Cronet Sample](https://github.com/GoogleChromeLabs/cronet-sample)\non GitHub.\n\nYou can send feedback about the Cronet Library using the [Chromium Issue\nTracker](https://crbug.com). Check the list of bugs in the issue tracker to make\nsure that your issue hasn't already been reported. If your issue hasn't been\nreported, file a bug with the word *Cronet* in the summary line."]]