دورة الحياة / The lifecycle

الترتيب / Order
2 من 4 / 2 of 4
آخر تحديث / Updated
8 أكتوبر 2026 / 8 October 2026

أهداف الدرس

  1. أن تعرف حالات التطبيق.
  2. أن تحفظ عمل المستخدم قبل أن يوقفه النظام.
التطبيق يدور بين أربع حالات
التطبيق يدور بين أربع حالات
  1. عند التشغيل: حمّل ما حُفظ آخر مرة.
  2. في المقدّمة: اعرض وحدّث.
  3. قبل الخلفية: احفظ المسودّة فوراً.
  4. بعد التوقّف: لا تفترض أن شيئاً بقي في الذاكرة.

تمرين

لماذا لا ننتظر إغلاق التطبيق لنحفظ؟

الإجابة

لأن النظام قد يوقف التطبيق من الخلفية دون أي إشعار.

Lesson goals

  1. Know the app's states.
  2. Save the user's work before the system stops the app.
An app moves between four states
An app moves between four states
  1. On launch: load what was saved last time.
  2. In front: show and refresh.
  3. Before the background: save the draft at once.
  4. After a stop: assume nothing is left in memory.

Exercise

Why not wait until the app closes to save?

Answer

The system may stop a background app without any notice.

التعليقات / Comments

لا تعليقات بعد. كن أول من يسأل. / No comments yet. Be the first to ask.

تعليق الطالب يظهر فوراً، وتعليق الزائر بعد موافقة المدرّس. / A student's comment shows at once; a visitor's once the teacher approves it.

في «تطوير تطبيقات الهاتف» / In “Mobile app development”

  1. 1طبقات التطبيق / The app's layersالتعليقات مفتوحة / comments open
  2. 2دورة الحياة / The lifecycleفيها صور / has picturesالتعليقات مفتوحة / comments open
  3. 3الحديث الآمن مع الخادم / Talking safely to the serverالتعليقات مفتوحة / comments open
  4. 4الروابط والبطاقة الرقمية / Links and the digital cardفيها صور / has picturesالتعليقات مفتوحة / comments open

↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق↑ ↓ to move · Enter to open · Esc to close