מידע על שימור הסוללה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
המשתמשים מסתמכים על המכשירים הניידים שלהם כמעט לכל דבר בימינו, החל משליחת אימיילים וניהול כספים, ועד לסטרימינג של סרטונים ומשחקי וידאו. כדי שאפליקציות יהיו שימושיות, רובן צריכות נתונים, תמונות ומדיה אחרת משירותים מרוחקים. חשוב לזכור שהאפליקציה שלכם היא רק אחת מתוך הרבה אפליקציות במכשיר של המשתמש, וכולן מתחרות על משאבי הרשת.
אם לא מנהלים את זה בצורה טובה, זה עלול להשפיע באופן דרמטי ושלילי על ביצועי הסוללה, ולגרום לשימוש מיותר ברוחב הפס המוגבל של המשתמש.
החל מ-Android 8.0, בוצעו כמה עדכונים במערכת ההפעלה כדי לשפר את חיי הסוללה, את חוויית המשתמש ואת תקינות המערכת. עם זאת, יש שיקולים, אסטרטגיות ודפוסים נוספים שגם אתם, כמפתחים, יכולים להשתמש בהם. בקשות שהאפליקציה שולחת לרשת יכולות להיות גורם משמעותי לריקון הסוללה, כי הן מסתמכות על רדיו סלולרי ו-Wi-Fi שצורכים הרבה חשמל.
במדריך הזה נסביר על:
- איך מודל הקישוריות של האפליקציה מתקשר עם מכונת מצבים של רדיו אלחוטי.
- איך משתמשים בטכניקות לצמצום ההשפעה של חיבור הנתונים.
- איך לפתור בעיות שקשורות לחיבור איטי.
- איך להריץ עבודה ברקע רק בתנאים ספציפיים, למשל כשהמכשיר בטעינה או מחובר ל-Wi-Fi.
- איך עוקבים אחרי השימוש בסוללה של האפליקציה לאורך זמן.
בסוף, תלמדו על שלוש קטגוריות רחבות של עדכונים:
עדכונים שמתחילים על ידי המשתמש,
עדכונים שמתחילים על ידי האפליקציה,
ועדכונים שמתחילים על ידי השרת,
עם כלים וטכניקות למיקסום היעילות של כל קטגוריה.
בסופו של דבר, האחריות שלנו כקהילת מפתחים היא לספק למשתמשים את חוויית השימוש הטובה ביותר באפליקציות.
חומר נוסף
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-27 (שעון UTC)."],[],[],null,["Users rely on their mobile devices for virtually everything these days, from\nsending emails and managing finances, to streaming videos and streaming and\nplaying video games. In order to be useful, most apps require data, images, and\nother media from remote services. It's important to remember that your app is\njust one of many apps on the user's device, all competing for network resources.\nManaged poorly, this can have a dramatic and detrimental impact on battery\nperformance and unnecessarily use the user's limited network bandwidth.\n\nStarting with [Android 8.0](/about/versions/oreo/android-8.0-changes), several\nupdates were introduced to the OS which help preserve battery, user experience,\nand system health. However, there are additional considerations, strategies, and\npatterns that you as a developer can employ yourself, as well. Requests that\nyour app makes to the network can be a major cause of battery drain because\nthey rely on the heavily power-consuming cellular and Wi-Fi radios.\n\nIn this guide, you'll learn about the following:\n\n- How your app's connectivity model interacts with the wireless radio state machine.\n- How to employ techniques for minimizing the impact of your data connection.\n- How to troubleshoot slow connections.\n- How to run background work only under specific conditions such as when the device is charging or on Wi-Fi.\n- How to track your app's battery usage over time.\n\nFinally, you'll learn about three broad categories of updates:\n[User-initiated](/develop/connectivity/minimize-effect-regular-updates#user-initiated),\n[App-initiated](/develop/connectivity/minimize-effect-regular-updates#app-initiated),\nand\n[Server-initiated](/develop/connectivity/minimize-effect-regular-updates#server-initiated),\nwith tools and techniques for maximizing the efficiency of each category.\n\nUltimately, it's all of our responsibilities as a developer community to provide\nthe best app experience for our users.\n\nAdditional material"]]