สำรวจโฟลเดอร์ที่สร้างขึ้น
ดูว่าแต่ละโมดูลและไดเรกทอรีในเทมเพลตใช้ทำอะไร
สำรวจโฟลเดอร์ที่สร้างขึ้น เป็นบทเรียน Kotlin Multiplatform Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Kotlin Multiplatform Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Kotlin Multiplatform Academy มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Know Where Things Live
The template looks busy at first. Once you learn what each folder is for, you will always know where your code belongs. 🗺️
The shared Module
The shared module is the heart of KMP. The Kotlin you write here is reused by both the Android and iOS apps.
commonMain
Inside shared, commonMain holds platform-independent Kotlin. Code here must compile for every target you chose.
androidMain
androidMain is for shared code that needs Android-only APIs. It is your place for platform-specific actual implementations.
iosMain
iosMain mirrors androidMain for the Apple side. It holds Kotlin that touches iOS-only frameworks and platform details.
The Android App Module
The androidApp module is a normal Android project. It depends on the shared module and contains the Android UI and entry point.
The iOS App Folder
The iosApp folder is an Xcode project. You open it in Xcode, and it links the framework built from your shared module.
Gradle Files
The build.gradle.kts files configure each module. The shared one declares your targets and dependencies, so you will edit it often.
settings.gradle.kts
settings.gradle.kts lists which modules belong to the build. It is how Gradle knows shared and androidApp are part of one project.
gradle.properties
gradle.properties holds project-wide flags, like JVM memory and KMP options. Small tweaks here affect the whole build.
A Mental Map
Shared code goes in the shared module, platform UI lives in the app modules, and Gradle files glue it all together. That map carries you far.
Quick Check
Where should you put Kotlin code that must work on every target?
Recap
You toured the layout: the shared module with commonMain, androidMain and iosMain, the two app modules, and the Gradle files that bind them. ✅
คำถามที่พบบ่อย
บทเรียน “สำรวจโฟลเดอร์ที่สร้างขึ้น” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “สำรวจโฟลเดอร์ที่สร้างขึ้น” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Kotlin Multiplatform Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Kotlin Multiplatform Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “สำรวจโฟลเดอร์ที่สร้างขึ้น”
ดูว่าแต่ละโมดูลและไดเรกทอรีในเทมเพลตใช้ทำอะไร คุณปฏิบัติ Kotlin Multiplatform Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Kotlin Multiplatform Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Kotlin Multiplatform Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “สำรวจโฟลเดอร์ที่สร้างขึ้น” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Kotlin Multiplatform Academy นี้ได้ไหม
ได้ บทเรียน Kotlin Multiplatform Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- JDK, Android Studio และปลั๊กอิน KMP
- Xcode และ CocoaPods สำหรับฝั่ง iOS
- สร้างโปรเจกต์ด้วยตัวช่วยสร้าง KMP
- สำรวจโฟลเดอร์ที่สร้างขึ้น