{"id":37083,"date":"2024-11-01T09:54:43","date_gmt":"2024-11-01T09:54:43","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=37083"},"modified":"2024-11-01T11:42:18","modified_gmt":"2024-11-01T11:42:18","slug":"kotlin-android-app-development-course-creating-a-to-do-list-app","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/37083\/","title":{"rendered":"Kotlin Android App Development Course: Creating a To-Do List App"},"content":{"rendered":"<p><body><\/p>\n<p>Hello! In this tutorial, we will learn how to create a To-Do List app using Kotlin for Android. This app will have a simple user interface, allowing users to add tasks, display the list, and delete completed tasks.<\/p>\n<h2>Table of Contents<\/h2>\n<ul>\n<li><a href=\"#required_materials\">1. Required Materials<\/a><\/li>\n<li><a href=\"#project_setup\">2. Project Setup<\/a><\/li>\n<li><a href=\"#ui_design\">3. UI Design<\/a><\/li>\n<li><a href=\"#writing_kotlin_code\">4. Writing Kotlin Code<\/a><\/li>\n<li><a href=\"#app_testing\">5. App Testing<\/a><\/li>\n<li><a href=\"#conclusion\">6. Conclusion<\/a><\/li>\n<\/ul>\n<h2 id=\"required_materials\">1. Required Materials<\/h2>\n<p>To develop the app, you will need the following materials:<\/p>\n<ul>\n<li><strong>Android Studio:<\/strong> Install the latest version<\/li>\n<li><strong>Kotlin:<\/strong> Ensure the latest version is included<\/li>\n<li><strong>Emulator or connected Android device:<\/strong> An environment to test the app<\/li>\n<\/ul>\n<h2 id=\"project_setup\">2. Project Setup<\/h2>\n<p>Open Android Studio and create a new project. Select the \u201cEmpty Activity\u201d template and enter the following settings:<\/p>\n<ul>\n<li><strong>Name:<\/strong> ToDoListApp<\/li>\n<li><strong>Package name:<\/strong> com.example.todolistapp<\/li>\n<li><strong>Save location:<\/strong> Choose your desired location<\/li>\n<li><strong>Language:<\/strong> Kotlin<\/li>\n<li><strong>Minimum API level:<\/strong> API 21 (Lollipop)<\/li>\n<\/ul>\n<p>Once the project is created, it is important to understand the basic structure of Android Studio. Take a careful look and open the \u2018MainActivity.kt\u2019 file.<\/p>\n<h2 id=\"ui_design\">3. UI Design<\/h2>\n<p>Now, modify the XML layout file to design the user interface. Open the \u2018res\/layout\/activity_main.xml\u2019 file and enter the following code:<\/p>\n<pre><code>\n    &lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n    &lt;RelativeLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"&gt;\n\n        &lt;EditText\n            android:id=\"@+id\/task_input\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:hint=\"Enter your task\"\n            android:layout_margin=\"16dp\"\/&gt;\n\n        &lt;Button\n            android:id=\"@+id\/add_task_button\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"Add\"\n            android:layout_below=\"@id\/task_input\"\n            android:layout_marginStart=\"16dp\"\n            android:layout_marginTop=\"8dp\"\/&gt;\n\n        &lt;ListView\n            android:id=\"@+id\/task_list\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"0dp\"\n            android:layout_below=\"@id\/add_task_button\"\n            android:layout_marginTop=\"8dp\"\n            android:layout_weight=\"1\"\/&gt;\n\n    &lt;\/RelativeLayout&gt;\n    <\/code><\/pre>\n<p>The above code includes an EditText for users to enter their tasks, a Button to add tasks, and a ListView to display the task list.<\/p>\n<h2 id=\"writing_kotlin_code\">4. Writing Kotlin Code<\/h2>\n<p>Now, open the MainActivity.kt file and add the following code to implement the functionality of the task list:<\/p>\n<pre><code>\n    package com.example.todolistapp\n\n    import android.os.Bundle\n    import android.view.View\n    import android.widget.ArrayAdapter\n    import android.widget.Button\n    import android.widget.EditText\n    import android.widget.ListView\n    import androidx.appcompat.app.AppCompatActivity\n\n    class MainActivity : AppCompatActivity() {\n        private lateinit var taskInput: EditText\n        private lateinit var addTaskButton: Button\n        private lateinit var taskListView: ListView\n        private val taskList = mutableListOf<String>()\n\n        override fun onCreate(savedInstanceState: Bundle?) {\n            super.onCreate(savedInstanceState)\n            setContentView(R.layout.activity_main)\n\n            taskInput = findViewById(R.id.task_input)\n            addTaskButton = findViewById(R.id.add_task_button)\n            taskListView = findViewById(R.id.task_list)\n\n            val adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, taskList)\n            taskListView.adapter = adapter\n\n            addTaskButton.setOnClickListener {\n                addTask()\n            }\n\n            taskListView.setOnItemClickListener { _, _, position, _ ->\n                removeTask(position)\n            }\n        }\n\n        private fun addTask() {\n            val task = taskInput.text.toString()\n            if (task.isNotEmpty()) {\n                taskList.add(task)\n                taskInput.text.clear()\n                (taskListView.adapter as ArrayAdapter<*>).notifyDataSetChanged()\n            }\n        }\n\n        private fun removeTask(position: Int) {\n            taskList.removeAt(position)\n            (taskListView.adapter as ArrayAdapter<*>).notifyDataSetChanged()\n        }\n    }\n    <\/code><\/pre>\n<p>This code handles two functionalities: adding tasks and deleting them when clicked. It displays the content entered by the user in the ListView, allowing them to delete items by clicking on the list items.<\/p>\n<h2 id=\"app_testing\">5. App Testing<\/h2>\n<p>Before running the app, ensure there are no errors in the code. Click the \u201cRun\u201d button at the bottom left of Android Studio to run the app, or press Shift + F10 to execute. Make sure an emulator or a real device is connected.<\/p>\n<p>Once the app is running, you will see a task input field, an add button, and a task list on the screen. You can enter the necessary tasks and click the \u2018Add\u2019 button to add them to the list. Clicking on an item in the list will delete it.<\/p>\n<h2 id=\"conclusion\">6. Conclusion<\/h2>\n<p>In this tutorial, we learned how to create a simple To-Do List app using Kotlin. We learned how to handle user input and interact with UI elements. By creating such a simple app, you can enhance your understanding of Android app development. Challenge yourself to expand functionality by adding complexity to the code and design!<\/p>\n<p>Thank you!<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello! In this tutorial, we will learn how to create a To-Do List app using Kotlin for Android. This app will have a simple user interface, allowing users to add tasks, display the list, and delete completed tasks. Table of Contents 1. Required Materials 2. Project Setup 3. UI Design 4. Writing Kotlin Code 5. &hellip; <a href=\"https:\/\/atmokpo.com\/w\/37083\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Kotlin Android App Development Course: Creating a To-Do List App&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[143],"tags":[],"class_list":["post-37083","post","type-post","status-publish","format-standard","hentry","category-kotlin-android-app-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kotlin Android App Development Course: Creating a To-Do List App - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/37083\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kotlin Android App Development Course: Creating a To-Do List App - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Hello! In this tutorial, we will learn how to create a To-Do List app using Kotlin for Android. This app will have a simple user interface, allowing users to add tasks, display the list, and delete completed tasks. Table of Contents 1. Required Materials 2. Project Setup 3. UI Design 4. Writing Kotlin Code 5. &hellip; \ub354 \ubcf4\uae30 &quot;Kotlin Android App Development Course: Creating a To-Do List App&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/37083\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:54:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:42:18+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/37083\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37083\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Kotlin Android App Development Course: Creating a To-Do List App\",\"datePublished\":\"2024-11-01T09:54:43+00:00\",\"dateModified\":\"2024-11-01T11:42:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37083\/\"},\"wordCount\":424,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Kotlin Android app development\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/37083\/\",\"url\":\"https:\/\/atmokpo.com\/w\/37083\/\",\"name\":\"Kotlin Android App Development Course: Creating a To-Do List App - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:54:43+00:00\",\"dateModified\":\"2024-11-01T11:42:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37083\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/37083\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/37083\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kotlin Android App Development Course: Creating a To-Do List App\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Kotlin Android App Development Course: Creating a To-Do List App - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/37083\/","og_locale":"ko_KR","og_type":"article","og_title":"Kotlin Android App Development Course: Creating a To-Do List App - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Hello! In this tutorial, we will learn how to create a To-Do List app using Kotlin for Android. This app will have a simple user interface, allowing users to add tasks, display the list, and delete completed tasks. Table of Contents 1. Required Materials 2. Project Setup 3. UI Design 4. Writing Kotlin Code 5. &hellip; \ub354 \ubcf4\uae30 \"Kotlin Android App Development Course: Creating a To-Do List App\"","og_url":"https:\/\/atmokpo.com\/w\/37083\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:54:43+00:00","article_modified_time":"2024-11-01T11:42:18+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/37083\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/37083\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Kotlin Android App Development Course: Creating a To-Do List App","datePublished":"2024-11-01T09:54:43+00:00","dateModified":"2024-11-01T11:42:18+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/37083\/"},"wordCount":424,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Kotlin Android app development"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/37083\/","url":"https:\/\/atmokpo.com\/w\/37083\/","name":"Kotlin Android App Development Course: Creating a To-Do List App - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:54:43+00:00","dateModified":"2024-11-01T11:42:18+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/37083\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/37083\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/37083\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Kotlin Android App Development Course: Creating a To-Do List App"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=37083"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37083\/revisions"}],"predecessor-version":[{"id":37084,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37083\/revisions\/37084"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=37083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=37083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=37083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}