{"id":37229,"date":"2024-11-01T09:55:54","date_gmt":"2024-11-01T09:55:54","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=37229"},"modified":"2024-11-01T11:36:05","modified_gmt":"2024-11-01T11:36:05","slug":"java-android-app-development-course-creating-kakaotalk-notifications","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/37229\/","title":{"rendered":"Java Android App Development Course, Creating KakaoTalk Notifications"},"content":{"rendered":"<p><body><\/p>\n<p>\n    In this course, we will develop an Android app using Java and implement the functionality to send notifications via KakaoTalk.<br \/>\n    We plan to complete a feature that sends notifications to users when specific events occur using the KakaoTalk API.<br \/>\n    This process will be explained based on Android Studio, and basic Android development knowledge is required.\n<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>Installation and setup of Java and Android SDK<\/li>\n<li>Installation of Android Studio<\/li>\n<li>Creation of a KakaoTalk developer account and app<\/li>\n<li>Verification of API Key and Secret Key<\/li>\n<\/ul>\n<h2>1. Android Studio Project Setup<\/h2>\n<p>\n    Open Android Studio and create a new project. Select &#8220;Empty Activity&#8221; and complete the basic configuration before creating the project.\n<\/p>\n<h3>1.1 Gradle Setup<\/h3>\n<p>\n    Next, open the build.gradle file of the app module and add the necessary libraries. We will be using Retrofit2 and Gson to utilize the KakaoTalk API.\n<\/p>\n<pre><code>dependencies {\n    implementation 'com.squareup.retrofit2:retrofit:2.9.0'\n    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'\n}<\/code><\/pre>\n<h2>2. KakaoTalk API Integration<\/h2>\n<p>\n    Create an application in the KakaoTalk Developer Center and verify the API Key. This key will be needed for future API calls.\n<\/p>\n<h3>2.1 Retrofit Setup<\/h3>\n<p>\n    Add configuration to communicate with the API using Retrofit. Create a Retrofit instance and set up the necessary API interface.\n<\/p>\n<pre><code>public interface KakaoApi {\n    @FormUrlEncoded\n    @POST(\"\/v2\/api\/talk\/memo\/default\/send\")\n    Call<responsebody> sendMessage(@Header(\"Authorization\") String token,\n                                    @Field(\"template_object\") String templateObject);\n}<\/responsebody><\/code><\/pre>\n<h3>2.2 Implement Method for API Call<\/h3>\n<p>\n    Implement a method to invoke the KakaoTalk API to send messages. OAuth authentication is required to authenticate the sender.\n<\/p>\n<pre><code>public class KakaoService {\n    private static final String BASE_URL = \"https:\/\/kapi.kakao.com\";\n    private KakaoApi kakaoApi;\n\n    public KakaoService() {\n        Retrofit retrofit = new Retrofit.Builder()\n                .baseUrl(BASE_URL)\n                .addConverterFactory(GsonConverterFactory.create())\n                .build();\n        kakaoApi = retrofit.create(KakaoApi.class);\n    }\n\n    public void sendKakaoTalk(String accessToken, String message) {\n        String jsonTemplate = \"{\\\"object_type\\\":\\\"text\\\",\\\"text\\\":\\\"\" + message + \"\\\"}\";\n        Call<responsebody> call = kakaoApi.sendMessage(\"Bearer \" + accessToken, jsonTemplate);\n        call.enqueue(new Callback<responsebody>() {\n            @Override\n            public void onResponse(Call<responsebody> call, Response<responsebody> response) {\n                if (response.isSuccessful()) {\n                    Log.d(\"KakaoTalk\", \"Message sent successfully\");\n                } else {\n                    Log.d(\"KakaoTalk\", \"Message sending failed: \" + response.message());\n                }\n            }\n\n            @Override\n            public void onFailure(Call<responsebody> call, Throwable t) {\n                Log.d(\"KakaoTalk\", \"Error occurred: \" + t.getMessage());\n            }\n        });\n    }\n}<\/responsebody><\/responsebody><\/responsebody><\/responsebody><\/responsebody><\/code><\/pre>\n<h2>3. User Interface Implementation<\/h2>\n<p>\n    Create a simple UI to receive input from the user. Use EditText and Button to implement the functionality to input and send messages.\n<\/p>\n<pre><code>&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/messageInput\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:hint=\"Enter message\"\/&gt;\n\n    &lt;Button\n        android:id=\"@+id\/sendButton\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"Send\"\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<h3>3.1 Connect UI to Activity<\/h3>\n<p>\n    Connect UI elements to the Activity to send a KakaoTalk message when the button is clicked.\n<\/p>\n<pre><code>public class MainActivity extends AppCompatActivity {\n    private KakaoService kakaoService;\n    private EditText messageInput;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        messageInput = findViewById(R.id.messageInput);\n        Button sendButton = findViewById(R.id.sendButton);\n        kakaoService = new KakaoService();\n\n        sendButton.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                String message = messageInput.getText().toString();\n                String accessToken = \"YOUR_ACCESS_TOKEN\";  \/\/ Enter the access token here\n                kakaoService.sendKakaoTalk(accessToken, message);\n            }\n        });\n    }\n}<\/code><\/pre>\n<h2>4. Testing and Deployment<\/h2>\n<p>\n    Run the app, enter a message, and click the &#8216;Send&#8217; button to check if the message is sent via KakaoTalk.<br \/>\n    If there are no issues, you can distribute it as an APK file for use on other devices.\n<\/p>\n<p>\n    Through this course, you have been able to implement a feature that directly sends notifications from an Android app using the KakaoTalk API.<br \/>\n    Future additional features may include considering automating the sending of KakaoTalk messages by catching user phone notifications.<br \/>\n    Create an app that communicates with more users through these features!\n<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this course, we will develop an Android app using Java and implement the functionality to send notifications via KakaoTalk. We plan to complete a feature that sends notifications to users when specific events occur using the KakaoTalk API. This process will be explained based on Android Studio, and basic Android development knowledge is required. &hellip; <a href=\"https:\/\/atmokpo.com\/w\/37229\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Java Android App Development Course, Creating KakaoTalk Notifications&#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":[137],"tags":[],"class_list":["post-37229","post","type-post","status-publish","format-standard","hentry","category-java-android-app-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java Android App Development Course, Creating KakaoTalk Notifications - \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\/37229\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Android App Development Course, Creating KakaoTalk Notifications - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"In this course, we will develop an Android app using Java and implement the functionality to send notifications via KakaoTalk. We plan to complete a feature that sends notifications to users when specific events occur using the KakaoTalk API. This process will be explained based on Android Studio, and basic Android development knowledge is required. &hellip; \ub354 \ubcf4\uae30 &quot;Java Android App Development Course, Creating KakaoTalk Notifications&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/37229\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:55:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:36:05+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\/37229\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37229\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Java Android App Development Course, Creating KakaoTalk Notifications\",\"datePublished\":\"2024-11-01T09:55:54+00:00\",\"dateModified\":\"2024-11-01T11:36:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37229\/\"},\"wordCount\":353,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Java Android app development\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/37229\/\",\"url\":\"https:\/\/atmokpo.com\/w\/37229\/\",\"name\":\"Java Android App Development Course, Creating KakaoTalk Notifications - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:55:54+00:00\",\"dateModified\":\"2024-11-01T11:36:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37229\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/37229\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/37229\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Android App Development Course, Creating KakaoTalk Notifications\"}]},{\"@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":"Java Android App Development Course, Creating KakaoTalk Notifications - \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\/37229\/","og_locale":"ko_KR","og_type":"article","og_title":"Java Android App Development Course, Creating KakaoTalk Notifications - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"In this course, we will develop an Android app using Java and implement the functionality to send notifications via KakaoTalk. We plan to complete a feature that sends notifications to users when specific events occur using the KakaoTalk API. This process will be explained based on Android Studio, and basic Android development knowledge is required. &hellip; \ub354 \ubcf4\uae30 \"Java Android App Development Course, Creating KakaoTalk Notifications\"","og_url":"https:\/\/atmokpo.com\/w\/37229\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:55:54+00:00","article_modified_time":"2024-11-01T11:36:05+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\/37229\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/37229\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Java Android App Development Course, Creating KakaoTalk Notifications","datePublished":"2024-11-01T09:55:54+00:00","dateModified":"2024-11-01T11:36:05+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/37229\/"},"wordCount":353,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Java Android app development"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/37229\/","url":"https:\/\/atmokpo.com\/w\/37229\/","name":"Java Android App Development Course, Creating KakaoTalk Notifications - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:55:54+00:00","dateModified":"2024-11-01T11:36:05+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/37229\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/37229\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/37229\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Java Android App Development Course, Creating KakaoTalk Notifications"}]},{"@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\/37229","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=37229"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37229\/revisions"}],"predecessor-version":[{"id":37230,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37229\/revisions\/37230"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=37229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=37229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=37229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}