ביצוע פעולות ברשת באמצעות Cronet
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Cronet היא חבילה של פרוטוקולי רשת של Chromium שזמינה לאפליקציות ל-Android כספרייה. Cronet משתמש בכמה טכנולוגיות שמצמצמות את זמן האחזור ומגדילות את קצב העברת הנתונים של בקשות הרשת שהאפליקציה צריכה כדי לפעול.
ספריית Cronet מטפלת בבקשות של אפליקציות שמשמשות מיליוני אנשים על בסיס יומי, כמו YouTube, Google App, Google Photos ו-Maps - Navigation & Transit.
תכונות
- תמיכה בפרוטוקולים
- Cronet תומך באופן מובנה בפרוטוקולים HTTP, HTTP/2 ו-HTTP/3 over QUIC.
- קביעת סדר עדיפויות לבקשות
- הספרייה מאפשרת להגדיר תג עדיפות לבקשות. השרת יכול להשתמש בתג העדיפות כדי לקבוע את הסדר שבו הוא יטפל בבקשות.
- שמירת משאבים במטמון
- Cronet יכול להשתמש במטמון בזיכרון או במטמון בדיסק כדי לאחסן משאבים שאוחזרו בבקשות רשת. בקשות עוקבות מוגשות מהמטמון באופן אוטומטי.
- בקשות אסינכרוניות
- בקשות רשת שמונפקות באמצעות ספריית Cronet הן אסינכרוניות כברירת מחדל.
ה-worker threads לא נחסמים בזמן ההמתנה לחזרת הבקשה.
- דחיסת נתונים
- 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."]]