0Pricing
Kotlin Multiplatform Academy · درس

مشاركة المنطق لا الواجهة: وعد KMP

لماذا يشارك KMP منطق الأعمال بينما يمكن أن تبقى الواجهة أصلية

مشاركة المنطق لا الواجهة: وعد KMP درس مجاني في Kotlin Multiplatform Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Kotlin Multiplatform Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Welcome to KMP

Kotlin Multiplatform lets you write one set of Kotlin code and run it on many platforms. Its big idea is to share logic, not UI. 🚀

What Counts as Logic

Your business logic is the brain of the app: calculations, rules, validation, and data handling. None of that needs to know which screen shows it.

What Counts as UI

The UI is buttons, lists, and screens the user taps. It is deeply tied to each platform's look and native feel, so it often stays separate.

The Core Promise

KMP's promise is simple: write your logic once in shared Kotlin, then plug it into a native Android UI and a native iOS UI.

A Tiny Shared Function

Here is shared logic both apps can call. Notice it has zero UI code, just a pure function returning a value.

fun greeting(name: String): String {
    return "Hello, " + name + "!"
}

One Source of Truth

When the rule lives in shared code, both apps use the exact same version. That is your single source of truth, with no drift.

No More Double Bugs

Without sharing, a tax rule gets coded twice and breaks twice. KMP fixes a bug in one place and both platforms get the fix.

Why Keep UI Native

Users expect a true Android feel and a true iOS feel. Keeping the native UI means each app looks and behaves the way its users love.

Sharing Is a Spectrum

You decide how much to share. Many teams start by sharing only the data layer, then grow the shared part over time.

Less Code, Fewer Mistakes

One shared rulebook means less duplicated work and fewer places to make mistakes. That is the real payoff of the KMP promise.

Native Where It Counts

KMP is not all-or-nothing. You share the brain and stay native for the parts that truly differ between Android and iOS.

Quick Check

Let's check the core KMP promise.

Recap

KMP means share logic, keep UI native. You get one source of truth for rules, fewer bugs, and apps that still feel native. Nice start! 🎉

الأسئلة الشائعة

هل درس «مشاركة المنطق لا الواجهة: وعد KMP» مجاني؟

نعم — نص درس «مشاركة المنطق لا الواجهة: وعد KMP» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Kotlin Multiplatform Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.

ماذا ستتعلم في «مشاركة المنطق لا الواجهة: وعد KMP»؟

لماذا يشارك KMP منطق الأعمال بينما يمكن أن تبقى الواجهة أصلية تتمرن على Kotlin Multiplatform Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Kotlin Multiplatform Academy؟

لا تُشترط خبرة سابقة. Kotlin Multiplatform Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «مشاركة المنطق لا الواجهة: وعد KMP»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Kotlin Multiplatform Academy هذا؟

نعم. كل درس في Kotlin Multiplatform Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. مشاركة المنطق لا الواجهة: وعد KMP
  2. KMP مقابل Flutter وReact Native
  3. الأهداف: Android وiOS وDesktop وWeb وServer
  4. ما يمكن وما لا يمكن مشاركته بعد
← العودة إلى Kotlin Multiplatform Academy