Awareness API ช่วยให้คุณตอบสนองต่อการเปลี่ยนแปลงในบริบทของผู้ใช้ได้ แต่ความรับผิดชอบที่ยิ่งใหญ่ก็มาพร้อมกับพลังอันยิ่งใหญ่นี้ โปรดพิจารณาหลักเกณฑ์ต่อไปนี้เพื่อให้ผู้ใช้ได้รับประสบการณ์การใช้งานที่ดีที่สุด
แม้ว่าเราจะพยายามอย่างมากที่จะทำให้ Awareness API มีประสิทธิภาพ แต่ก็ยังอาจทำให้แบตเตอรี่หมดเร็วได้หากใช้งานอย่างไม่ระมัดระวัง Awareness API จะจัดการประสิทธิภาพของระบบให้คุณ อย่างไรก็ตาม หากคุณลงทะเบียนรั้วมากเกินไป Awareness API จะจำกัดการเรียกกลับเพื่อป้องกันไม่ให้แบตเตอรี่หมด ในทํานองเดียวกัน คําขอภาพรวมที่มากเกินไปก็อาจทำให้แบตเตอรี่หมดเร็วได้
ใช้ Awareness API เพื่อรับรู้
หากแอปต้องทํางานที่ไม่จําเป็นต้องดำเนินการในเวลาที่เจาะจง เช่น การซิงค์ข้อมูลหรือการดำเนินการล้างข้อมูล ให้พิจารณาใช้ JobScheduler API เพื่อดําเนินการดังกล่าว
[[["เข้าใจง่าย","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-25 UTC"],[[["The Awareness API lets your app react to user context changes, but it's crucial to use it responsibly to avoid negative user experiences."],["Manage user expectations by clearly indicating how your app will utilize the Awareness API and what actions it might trigger."],["Minimize notifications and ensure they are relevant to the user to prevent notification overload and maintain a positive user experience."],["Be aware of the Awareness API's potential impact on battery life and avoid excessive fence registrations or snapshot requests."],["Utilize the Awareness API primarily for context-aware features and consider alternatives like JobScheduler for non-time-sensitive tasks."]]],[]]