แนวทางปฏิบัติแนะนำสำหรับฟีเจอร์เล่นขณะที่ดาวน์โหลด
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แนวทางปฏิบัติแนะนำเหล่านี้จะช่วยปรับปรุงเวลาในการตอบสนองของการติดตั้งได้เมื่อเปิดใช้ฟีเจอร์เล่นขณะที่ดาวน์โหลดสำหรับแอป
ใช้ SDK เวอร์ชันล่าสุด
ใช้ SDK เวอร์ชันล่าสุดสําหรับแอป โดยเฉพาะหากคุณใช้ SDK ต่อไปนี้
SDK เวอร์ชันล่าสุดได้รับการเพิ่มประสิทธิภาพสำหรับฟีเจอร์เล่นขณะที่ดาวน์โหลดให้ทำงานได้โดยไม่ต้องสแกนไบนารีทั้งหมดของแอป วิธีนี้ช่วยให้ผู้ใช้เริ่มแอปได้เร็วขึ้นเมื่อเปิดแอปเป็นครั้งแรก
ใช้แพ็กเกจชิ้นงานสำหรับเวลาติดตั้ง
ใช้ Asset Pack เวลาติดตั้งเพื่อจัดเก็บเนื้อหาเกมขนาดใหญ่ Google Play จะเพิ่มประสิทธิภาพการดาวน์โหลดโดยวิเคราะห์รูปแบบการใช้งานของ Asset Pack เวลาติดตั้ง ซึ่งจะช่วยให้เกมเปิดได้เร็วขึ้นมากขณะที่ดาวน์โหลดเฉพาะข้อมูลที่ผู้ใช้ต้องการในช่วงเปิดเกมครั้งแรก
ตารางต่อไปนี้แสดงโค้ดและทรัพยากรที่ Play เพิ่มประสิทธิภาพขณะที่คุณดาวน์โหลดเมื่อเกมใช้ Android App Bundle ที่มี Play Asset Delivery
รูปแบบทรัพยากร |
เพิ่มประสิทธิภาพโดย "เล่นขณะที่ดาวน์โหลด" |
ไม่ได้เพิ่มประสิทธิภาพโดย "เล่นขณะที่ดาวน์โหลด" |
ไฟล์ Android App Bundle |
โมดูลฐานและฟีเจอร์แบบไดนามิก ณ เวลาที่ติดตั้ง (ยกเว้นไดเรกทอรี "res/" และ "values/") |
ไดเรกทอรี `res/` และ `values/` ของโมดูลฐานและฟีเจอร์แบบไดนามิกที่ติดตั้ง |
|
ฟีเจอร์แบบไดนามิกแบบออนดีมานด์ |
ไฟล์ Play Asset Delivery |
แพ็กเกจชิ้นงานสำหรับเวลาติดตั้ง |
Asset Pack แบบดาวน์โหลดอัตโนมัติ |
|
Asset Pack แบบออนดีมานด์ |
จำกัดชิ้นงานที่โหลดไว้ล่วงหน้า
โหลดเฉพาะสิ่งที่จําเป็นสําหรับประสบการณ์การใช้งานปัจจุบันของผู้ใช้ เช่น เมนูหรือด่าน แทนการโหลดชิ้นงานแอปทั้งหมดพร้อมกัน การโหลดชิ้นงานมากเกินไปในประสบการณ์การใช้งานครั้งแรกจะใช้ข้อมูลเครือข่ายมากขึ้นตั้งแต่ต้น
คําแนะนําเพิ่มเติมสําหรับเกม Unity มีดังนี้
แก้ไข ANR
การแก้ไข ANR (ข้อผิดพลาดแอปพลิเคชันไม่ตอบสนอง) ในแอปยังช่วยปรับปรุงประสบการณ์การดาวน์โหลดแอปใน Play ได้ด้วย เช่น การนําการดำเนินการ IO ออกจากเธรดหลักจะช่วยลดความถี่ที่ ANR จะเกิดขึ้นขณะที่ Play ดาวน์โหลดชิ้นงานแอปในเบื้องหลัง
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["# Play as you Download best practices\n\nThese best practices can improve install latency when Play as you Download\nis enabled for your app.\n\nUse the latest SDKs\n-------------------\n\nUse the latest SDKs for your app, especially if you are using the following\nSDKs:\n\n- Facebook Core SDK: 11.2.0 or higher\n\n- FB Audience Network (ads): 6.5.1 or higher\n\nThe latest SDKs are optimized for Play as you Download to operate without\nscanning the entire app binary. This lets users start your app more quickly\nthe first time they launch.\n\nUse install-time asset packs\n----------------------------\n\nUse [install-time](/guide/playcore/asset-delivery#delivery-modes) asset packs to\nstore large game assets. Google Play optimizes downloads by analyzing use\npatterns of install-time asset packs. This helps the game launch much faster\nwhile only downloading data that users need during the initial game launch.\n\nThe following table shows what code and resources are optimized by Play as you\ndownload when games use an\n[Android App Bundle with Play Assets Delivery](/guide/app-bundle/app-bundle-format).\n\n| Resource format | Optimized by Play as you Download | Not optimized by Play as you Download |\n|---------------------------|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| Android App Bundle files | Base Module and install-time dynamic features (except 'res/' and 'values/' directories) | \\`res/\\` and \\`values/\\` directories of base module and install-time dynamic features |\n| Android App Bundle files | | On-demand dynamic features |\n| Play Asset Delivery files | Install-time asset packs | Fast-follow asset packs |\n| Play Asset Delivery files | | On-demand asset packs |\n\nLimit preloaded assets\n----------------------\n\nInstead of preloading all app assets at once, only load what's needed for the\ncurrent user experience such as the menu or level. Loading too many assets\nduring the initial experience uses more network data up front.\n\nHere are some additional recommendations for Unity games:\n\n- See\n [Loading resources at runtime](https://docs.unity3d.com/2022.2/Documentation/Manual/LoadingResourcesatRuntime.html).\n\n- Split large scenes into multiple scenes to avoid loading large amounts of\n asset data at once.\n\n- Use an asset loading profiler (such as the\n [Asset Loading Profiler module in\n Unity](https://docs.unity3d.com/2022.2/Documentation/Manual/profiler-asset-loading-module.html))\n to identify asset loading optimizations for your game.\n\nFix ANRs\n--------\n\nBy fixing [ANRs](/topic/performance/vitals/anr)\n(Application Not Responding errors) in your app, you can also improve the Play\nas you Download experience of the app. For example, by removing\n[IO operations from the main thread](https://developer.android.com/topic/performance/vitals/anr#io_on_the_main_thread),\nyou can minimize ANRs from occurring while Play is downloading app assets in\nbackground."]]