تنفيذ عمليات الشبكة باستخدام Cronet
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
Cronet هو حزمة شبكة Chromium المتاحة لتطبيقات Android كمكتبة. يستفيد Cronet من تقنيات متعددة تقلل من وقت الاستجابة وتزيد من سرعة معالجة طلبات الشبكة التي يحتاجها تطبيقك للعمل.
تعالج مكتبة Cronet طلبات التطبيقات التي يستخدمها ملايين الأشخاص
يوميًا، مثل
YouTube
وتطبيق Google
وصور Google
وخرائط - التنقل والنقل العام.
الميزات
- دعم البروتوكول
- تتوافق خدمة Chrome في الأساس مع بروتوكولات HTTP وHTTP/2 وHTTP/3 عبر QUIC.
- طلب تحديد الأولويات
- تتيح لك المكتبة ضبط علامة أولوية للطلبات. يمكن للخادم
استخدام علامة الأولوية لتحديد ترتيب معالجة الطلبات.
- تخزين الموارد في ذاكرة التخزين المؤقت
- يمكن أن يستخدم Cronet ذاكرة تخزين في الذاكرة أو ذاكرة تخزين مؤقت على القرص لتخزين الموارد التي تم استردادها في طلبات الشبكة. ويتم عرض الطلبات اللاحقة من ذاكرة التخزين المؤقت تلقائيًا.
- الطلبات غير المتزامنة
- تكون طلبات الشبكة التي يتم إصدارها باستخدام مكتبة Cronet غير متزامنة تلقائيًا.
لن يتم حظر سلاسل محادثات العاملين أثناء انتظار ظهور الطلب.
- ضغط البيانات
- يتوافق تطبيق Cronet مع ضغط البيانات باستخدام تنسيق بيانات Brotli المضغوط.
لمعرفة كيفية استخدام مكتبة Cronet في تطبيقك لنظام Android، يُرجى مراجعة إرسال
طلب بسيط. يمكنك أيضًا تصفح
عينة Cronet
على GitHub.
يمكنك إرسال ملاحظات حول مكتبة Cronet باستخدام أداة تتبُّع مشاكل Chromium. تحقق من قائمة الأخطاء في أداة تعقب المشكلات للتأكد من أنه لم يتم الإبلاغ عن مشكلتك بالفعل. إذا لم يتم الإبلاغ عن مشكلتك،
أبلغ عن الخطأ باستخدام كلمة Cronet في سطر الملخص.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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."]]