{"id":162,"date":"2025-12-16T08:33:44","date_gmt":"2025-12-16T00:33:44","guid":{"rendered":"https:\/\/www.thebugmuxi.xyz\/?p=162"},"modified":"2025-12-16T08:33:46","modified_gmt":"2025-12-16T00:33:46","slug":"%e5%ae%89%e5%8d%93kotlin%e5%bc%80%e5%8f%91%e5%ad%a6%e4%b9%a0%e8%ae%a1%e5%88%92","status":"publish","type":"post","link":"https:\/\/www.thebugmuxi.xyz\/index.php\/2025\/12\/16\/%e5%ae%89%e5%8d%93kotlin%e5%bc%80%e5%8f%91%e5%ad%a6%e4%b9%a0%e8%ae%a1%e5%88%92\/","title":{"rendered":"\u5b89\u5353(Kotlin)\u5f00\u53d1\u5b66\u4e60\u8ba1\u5212"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\ud83d\udcc5 \u5907\u8d5b\u5b66\u4e60\u89c4\u5212\u603b\u89c8<\/h3>\n\n\n\n<p>\u7ed3\u5408\u6280\u80fd\u5927\u8d5b\u6ce8\u91cd<strong>\u5b9e\u8df5\u80fd\u529b<\/strong>\u548c<strong>\u884c\u4e1a\u6807\u51c6<\/strong>\u7684\u7279\u70b9\uff0c\u4e3a\u4f60\u8bbe\u8ba1\u4e86\u4ee5\u4e0b3\u4e2a\u9636\u6bb5\u7684\u5b66\u4e60\u8def\u7ebf\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u81ea\u8eab\u57fa\u7840\u548c\u8ddd\u79bb\u6bd4\u8d5b\u7684\u65f6\u95f4\u7075\u6d3b\u8c03\u6574\u6bcf\u4e2a\u9636\u6bb5\u7684\u65f6\u957f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9636\u6bb5<\/th><th>\u6838\u5fc3\u76ee\u6807<\/th><th>\u63a8\u8350\u65f6\u95f4<\/th><th>\u5173\u952e\u4ea7\u51fa<\/th><\/tr><\/thead><tbody><tr><td><strong>\u7b2c\u4e00\u9636\u6bb5\uff1a\u57fa\u7840\u6784\u5efa<\/strong><\/td><td>\u638c\u63e1Kotlin\u6838\u5fc3\u8bed\u6cd5\u4e0e\u5b89\u5353\u5f00\u53d1\u6838\u5fc3\u7ec4\u4ef6\u3002<\/td><td>6-8\u5468<\/td><td>\u72ec\u7acb\u5b8c\u6210\u591a\u4e2a\u5c0f\u578b\u7ec3\u4e60App\u3002<\/td><\/tr><tr><td><strong>\u7b2c\u4e8c\u9636\u6bb5\uff1a\u80fd\u529b\u8fdb\u9636<\/strong><\/td><td>\u719f\u7ec3\u8fdb\u884c\u6570\u636e\u5b58\u50a8\u3001\u7f51\u7edc\u901a\u4fe1\u548c\u67b6\u6784\u8bbe\u8ba1\u3002<\/td><td>6-8\u5468<\/td><td>\u5b8c\u62101-2\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u7efc\u5408\u6027\u9879\u76ee\u3002<\/td><\/tr><tr><td><strong>\u7b2c\u4e09\u9636\u6bb5\uff1a\u51b2\u523a\u4e0e\u6a21\u62df<\/strong><\/td><td>\u5f3a\u5316\u5b9e\u6218\u3001\u4ee3\u7801\u4f18\u5316\u548c\u6a21\u62df\u6bd4\u8d5b\u73af\u5883\u3002<\/td><td>\u8d5b\u524d4-6\u5468<\/td><td>\u5f62\u6210\u4e2a\u4eba\u9879\u76ee\u4ee3\u7801\u5e93\uff0c\u9002\u5e94\u9650\u65f6\u538b\u529b\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udee0\ufe0f \u5206\u9636\u6bb5\u5b66\u4e60\u8def\u5f84\u4e0e\u8d44\u6e90<\/h3>\n\n\n\n<p><strong>\u7b2c\u4e00\u9636\u6bb5\uff1a\u57fa\u7840\u6784\u5efa\uff086-8\u5468\uff09<\/strong><br>\u6b64\u9636\u6bb5\u7684\u76ee\u6807\u662f\u6253\u4e0b\u624e\u5b9e\u7684\u8bed\u8a00\u548c\u6846\u67b6\u57fa\u7840\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6838\u5fc3\u4efb\u52a1<\/strong>\uff1a\n<ol class=\"wp-block-list\">\n<li><strong>Kotlin\u8bed\u8a00\u57fa\u7840<\/strong>\uff1a\u719f\u7ec3\u638c\u63e1\u53d8\u91cf\u3001\u51fd\u6570\u3001\u63a7\u5236\u6d41\u3001\u96c6\u5408\u3001Lambda\u8868\u8fbe\u5f0f\u7b49\u6838\u5fc3\u8bed\u6cd5\u3002\u5b66\u4e60Kotlin\u7684<strong>\u7a7a\u5b89\u5168<\/strong>\u7279\u6027\uff0c\u8fd9\u662fKotlin\u76f8\u6bd4Java\u7684\u91cd\u8981\u4f18\u52bf\u3002<\/li>\n\n\n\n<li><strong>Android Studio\u4e0e\u73af\u5883<\/strong>\uff1a\u719f\u7ec3\u5b89\u88c5\u548c\u4f7f\u7528Android Studio\uff0c\u521b\u5efa\u9879\u76ee\uff0c\u4f7f\u7528\u6a21\u62df\u5668\u6216\u771f\u673a\u8c03\u8bd5\u3002<\/li>\n\n\n\n<li><strong>\u6838\u5fc3\u7ec4\u4ef6\u4e0eUI\u5f00\u53d1<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li><strong>Activity\u4e0eIntent<\/strong>\uff1a\u7406\u89e3\u751f\u547d\u5468\u671f\uff0c\u638c\u63e1\u9875\u9762\u8df3\u8f6c\u548c\u6570\u636e\u4f20\u9012\u3002<\/li>\n\n\n\n<li><strong>\u57fa\u7840UI\u63a7\u4ef6<\/strong>\uff1a\u719f\u7ec3\u4f7f\u7528<code>TextView<\/code>\u3001<code>Button<\/code>\u3001<code>EditText<\/code>\u3001<code>ImageView<\/code>\u3001<code>RecyclerView<\/code>\u7b49\u3002<\/li>\n\n\n\n<li><strong>\u754c\u9762\u5e03\u5c40<\/strong>\uff1a\u638c\u63e1<code>LinearLayout<\/code>\u3001<code>ConstraintLayout<\/code>\u7b49\u5e03\u5c40\u65b9\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li><strong>\u63a8\u8350\u5b66\u4e60\u8d44\u6e90<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li><strong>\u5728\u7ebf\u8bfe\u7a0b<\/strong>\uff1a\u300aAndroid\uff08\u5b89\u5353\uff09\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\uff08\u5c71\u4e1c\u8054\u76df\uff09\u300b\u6216\u300a\u79fb\u52a8\u7ec8\u7aef\u5e94\u7528\u5f00\u53d1\u300b\u7684\u201c\u57fa\u4e8eKotlin\u8bed\u8a00\u201d\u90e8\u5206\uff0c\u8bfe\u7a0b\u5185\u5bb9\u76f4\u63a5\u4e14\u7cfb\u7edf\u3002<\/li>\n\n\n\n<li><strong>\u56fe\u4e66\u8f85\u52a9<\/strong>\uff1a\u300aKotlin\u4ece\u96f6\u5230\u7cbe\u901aAndroid\u5f00\u53d1\u300b\uff0c\u53ef\u4f5c\u4e3a\u624b\u8fb9\u5de5\u5177\u4e66\u67e5\u9605\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>\u7b2c\u4e8c\u9636\u6bb5\uff1a\u80fd\u529b\u8fdb\u9636\uff086-8\u5468\uff09<\/strong><br>\u6b64\u9636\u6bb5\u91cd\u70b9\u662f\u638c\u63e1\u6784\u5efa\u5b8c\u6574\u5e94\u7528\u6240\u5fc5\u9700\u7684\u5173\u952e\u6280\u672f\u6808\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6838\u5fc3\u4efb\u52a1<\/strong>\uff1a\n<ol class=\"wp-block-list\">\n<li><strong>\u6570\u636e\u6301\u4e45\u5316<\/strong>\uff1a\u638c\u63e1<code>SharedPreferences<\/code>\u8f7b\u91cf\u5b58\u50a8\u3001<code>SQLite<\/code>\u6570\u636e\u5e93\u64cd\u4f5c\uff08\u53ef\u4f7f\u7528Room\u7b49\u6846\u67b6\u7b80\u5316\uff09\u3002<\/li>\n\n\n\n<li><strong>\u7f51\u7edc\u7f16\u7a0b<\/strong>\uff1a\u5b66\u4e60\u4f7f\u7528<code>Retrofit<\/code> + <code>JSON<\/code>\u8fdb\u884c\u7f51\u7edc\u8bf7\u6c42\uff0c\u7406\u89e3\u5f02\u6b65\u5904\u7406\u3002<\/li>\n\n\n\n<li><strong>\u56db\u5927\u7ec4\u4ef6\u6df1\u5316<\/strong>\uff1a\u5b66\u4e60<code>Service<\/code>\uff08\u540e\u53f0\u670d\u52a1\uff09\u3001<code>BroadcastReceiver<\/code>\uff08\u5e7f\u64ad\u63a5\u6536\u8005\uff09\u7684\u5de5\u4f5c\u539f\u7406\u548c\u573a\u666f\u3002<\/li>\n\n\n\n<li><strong>\u67b6\u6784\u4e0e\u534f\u7a0b<\/strong>\uff1a\u4e86\u89e3<code>MVVM<\/code>\u67b6\u6784\u6a21\u5f0f\u7684\u57fa\u7840\u6982\u5ff5\uff0c\u5f00\u59cb\u5b66\u4e60\u4f7f\u7528Kotlin<strong>\u534f\u7a0b<\/strong>\u5904\u7406\u5f02\u6b65\u4efb\u52a1\uff0c\u8fd9\u662f\u73b0\u4ee3\u5b89\u5353\u5f00\u53d1\u7684\u8d8b\u52bf\u3002<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li><strong>\u63a8\u8350\u5b66\u4e60\u8d44\u6e90<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li><strong>\u5b9e\u8df5\u4e0e\u9879\u76ee<\/strong>\uff1a\u7ee7\u7eed\u8ddf\u5b66\u7b49\u8bfe\u7a0b\u4e2d\u7684\u7efc\u5408\u6027\u9879\u76ee\uff08\u5982\u201c\u901a\u8baf\u5f55\u201d\u3001\u201c\u5728\u7ebf\u7ffb\u8bd1\u5de5\u5177\u201d\uff09\uff0c\u5e76\u5c1d\u8bd5\u72ec\u7acb\u4eff\u5199\u3002<\/li>\n\n\n\n<li><strong>\u5b98\u65b9\u6587\u6863<\/strong>\uff1a\u9047\u5230\u5177\u4f53\u6280\u672f\u95ee\u9898\u65f6\uff0c\u4f18\u5148\u67e5\u9605Android Developers\u5b98\u65b9\u6587\u6863\uff0c\u786e\u4fdd\u4fe1\u606f\u6700\u65b0\u6700\u51c6\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>\u7b2c\u4e09\u9636\u6bb5\uff1a\u51b2\u523a\u4e0e\u6a21\u62df\uff08\u8d5b\u524d4-6\u5468\uff09<\/strong><br>\u6b64\u9636\u6bb5\u7684\u6838\u5fc3\u662f\u8f6c\u5316\u77e5\u8bc6\u4e3a\u7ade\u8d5b\u80fd\u529b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6838\u5fc3\u4efb\u52a1<\/strong>\uff1a\n<ol class=\"wp-block-list\">\n<li><strong>\u9879\u76ee\u5b9e\u6218\u4e0e\u590d\u76d8<\/strong>\uff1a\u81ea\u4e3b\u8bbe\u8ba1\u5e76\u5b8c\u6210\u4e00\u4e2a\u6db5\u76d6<strong>\u6570\u636e\u5c55\u793a\uff08\u7f51\u7edc\/\u672c\u5730\uff09\u3001\u7528\u6237\u4ea4\u4e92\u3001\u6570\u636e\u6301\u4e45\u5316<\/strong>\u7684\u5b8c\u6574\u5e94\u7528\u3002\u5b8c\u6210\u540e\uff0c\u5fc5\u987b\u8fdb\u884c<strong>\u4ee3\u7801\u91cd\u6784\u548c\u4f18\u5316<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u6280\u80fd\u5927\u8d5b\u9488\u5bf9\u6027\u8bad\u7ec3<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li><strong>\u9650\u65f6\u7f16\u7a0b<\/strong>\uff1a\u9488\u5bf9\u6bd4\u8d5b\u53ef\u80fd\u9650\u65f6\u7684\u7279\u70b9\uff0c\u8fdb\u884c\u9650\u65f6\uff08\u59824-6\u5c0f\u65f6\uff09\u5b8c\u6210\u6307\u5b9a\u6a21\u5757\u7684\u8bad\u7ec3\u3002<\/li>\n\n\n\n<li><strong>\u4ee3\u7801\u89c4\u8303\u4e0e\u6ce8\u91ca<\/strong>\uff1a\u523b\u610f\u7ec3\u4e60\u7f16\u5199\u6e05\u6670\u3001\u7b26\u5408\u89c4\u8303\u7684\u4ee3\u7801\uff0c\u5e76\u6dfb\u52a0\u5fc5\u8981\u6ce8\u91ca\u3002<\/li>\n\n\n\n<li><strong>\u6a21\u5757\u590d\u7528<\/strong>\uff1a\u6574\u7406\u548c\u5c01\u88c5\u81ea\u5df1\u5e38\u7528\u7684\u5de5\u5177\u7c7b\uff08\u5982\u7f51\u7edc\u8bf7\u6c42\u5c01\u88c5\u3001\u6570\u636e\u5e93Helper\u7b49\uff09\uff0c\u63d0\u9ad8\u73b0\u573a\u7f16\u7801\u6548\u7387\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6a21\u62df\u4e0e\u4fe1\u606f\u6536\u96c6<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u5173\u6ce8 <strong>\u201c\u5c71\u4e1c\u7701\u6280\u80fd\u4eba\u624d\u8bc4\u4ef7\u5de5\u4f5c\u7f51\u201d<\/strong> \u4e0a\u53d1\u5e03\u7684\u6bd4\u8d5b\u4e13\u680f\uff0c\u7559\u610f\u7b2c\u4e09\u5c4a\u5927\u8d5b\u7684<strong>\u5b98\u65b9\u6280\u672f\u6587\u4ef6<\/strong>\uff0c\u8fd9\u662f\u5907\u8d5b\u7684\u7ec8\u6781\u6307\u5357\u3002<\/li>\n\n\n\n<li>\u5bfb\u627e\u6216\u7ec4\u7ec7\u7ebf\u4e0a\u6a21\u62df\u8d5b\uff0c\u4f53\u9a8c\u5b9e\u6218\u538b\u529b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca1 \u5907\u8d5b\u5173\u952e\u63d0\u9192\u4e0e\u5efa\u8bae<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5b98\u65b9\u52a8\u6001\u81f3\u5173\u91cd\u8981<\/strong>\uff1a\u7b2c\u4e09\u5c4a\u5927\u8d5b\u7684\u5177\u4f53\u9879\u76ee\u548c\u89c4\u7a0b\u5c1a\u672a\u516c\u5e03\u3002\u8bf7\u52a1\u5fc5\u5b9a\u671f\u8bbf\u95ee<strong>\u5c71\u4e1c\u7701\u6280\u80fd\u4eba\u624d\u8bc4\u4ef7\u5de5\u4f5c\u7f51 (http:\/\/www.sdosta.org.cn)<\/strong>\uff0c\u5173\u6ce8\u201c\u7b2c\u4e09\u5c4a\u5c71\u4e1c\u7701\u804c\u4e1a\u6280\u80fd\u5927\u8d5b\u201d\u4e13\u680f\u3002\u8fd9\u662f\u83b7\u53d6\u6700\u51c6\u786e\u53c2\u8d5b\u8981\u6c42\u3001\u6280\u672f\u6807\u51c6\u7b49\u4fe1\u606f\u7684\u552f\u4e00\u5b98\u65b9\u6e20\u9053\u3002<\/li>\n\n\n\n<li><strong>\u201c\u505a\u201d\u6bd4\u201c\u770b\u201d\u66f4\u91cd\u8981<\/strong>\uff1a\u5f00\u53d1\u662f\u5b9e\u8df5\u5b66\u79d1\u3002\u6bcf\u5b66\u4e00\u4e2a\u77e5\u8bc6\u70b9\uff0c\u52a1\u5fc5\u5728Android Studio\u4e2d\u52a8\u624b\u5b9e\u73b0\uff0c\u54ea\u6015\u53ea\u662f\u4fee\u6539\u51e0\u884c\u4ee3\u7801\u3002\u5efa\u7acb\u81ea\u5df1\u7684<strong>GitHub\u4ed3\u5e93<\/strong>\uff0c\u6301\u7eed\u63d0\u4ea4\u4ee3\u7801\uff0c\u65e2\u80fd\u5907\u4efd\u4e5f\u80fd\u5c55\u793a\u5b66\u4e60\u8f68\u8ff9\u3002<\/li>\n\n\n\n<li><strong>\u5f80\u5c4a\u9879\u76ee\u662f\u91cd\u8981\u53c2\u8003<\/strong>\uff1a\u76ee\u524d\u5b98\u65b9\u672a\u516c\u5e03\u5f80\u5c4a\u8d5b\u9898\uff0c\u4f46\u4f60\u53ef\u4ee5\u5173\u6ce8\u7b2c\u4e8c\u5c4a\u5927\u8d5b\u4e2d\u662f\u5426\u6709\u201c\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u201d\u6216\u76f8\u8fd1\u7c7b\u522b\u9879\u76ee\u3002\u4e86\u89e3\u5176\u5927\u81f4\u65b9\u5411\uff0c\u5bf9\u5907\u8d5b\u6709\u53c2\u8003\u4ef7\u503c\u3002<\/li>\n\n\n\n<li><strong>\u79ef\u6781\u5bfb\u6c42\u4ea4\u6d41<\/strong>\uff1a\u53ef\u4ee5\u5c1d\u8bd5\u5728\u6280\u672f\u793e\u533a\uff08\u5982CSDN\u3001\u6398\u91d1\uff09\u5bfb\u627e\u540c\u5728\u5c71\u4e1c\u5907\u8d5b\u7684\u5f00\u53d1\u8005\uff0c\u4ea4\u6d41\u5b66\u4e60\u5fc3\u5f97\uff0c\u751a\u81f3\u53ef\u4ee5\u7ec4\u961f\u6a21\u62df\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udcc5 \u5907\u8d5b\u5b66\u4e60\u89c4\u5212\u603b\u89c8 \u7ed3\u5408\u6280\u80fd\u5927\u8d5b\u6ce8\u91cd\u5b9e\u8df5\u80fd\u529b\u548c\u884c\u4e1a\u6807\u51c6\u7684\u7279\u70b9\uff0c\u4e3a\u4f60\u8bbe\u8ba1\u4e86\u4ee5\u4e0b3\u4e2a\u9636\u6bb5\u7684\u5b66\u4e60\u8def\u7ebf\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u81ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":147,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,7,1],"tags":[33,39,8,38],"class_list":["post-162","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kotlin","category-7","category-leam","tag-kotlin","tag-39","tag-8","tag-38"],"_links":{"self":[{"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":1,"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/posts\/162\/revisions\/163"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/media\/147"}],"wp:attachment":[{"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thebugmuxi.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}