{"id":987,"date":"2017-07-29T19:11:01","date_gmt":"2017-07-29T11:11:01","guid":{"rendered":"https:\/\/www.ray650128.com\/wordpress\/?p=987"},"modified":"2021-07-21T10:39:43","modified_gmt":"2021-07-21T02:39:43","slug":"androidkotlin-android%e5%b9%b3%e5%8f%b0%e6%96%b0%e8%88%88%e7%9a%84%e7%a8%8b%e5%bc%8f%e8%aa%9e%e8%a8%80","status":"publish","type":"post","link":"https:\/\/blog.ray650128.com\/?p=987","title":{"rendered":"[Android]Kotlin\u8a9e\u8a00"},"content":{"rendered":"\n<p>Google\u65bc\u4eca\u5e74\u7684Google IO\u5927\u6703\u4e0a\u5ba3\u5e03\uff0cKotlin\u5c07\u6210\u70baAndroid\u5e73\u53f0\u7684\u4e00\u7d1a\u958b\u767c\u8a9e\u8a00\u3002<\/p>\n\n\n\n<p>\u6216\u8a31\u4e0d\u4e45\u7684\u5c07\u4f86\uff0cKotlin\u53ef\u80fd\u6703\u53d6\u4ee3Java\u4f5c\u70baAndroid OS\u7684\u4e3b\u8981\u958b\u767c\u8a9e\u8a00\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7c21\u4ecb<\/h2>\n\n\n\n<p>\u5728\u7814\u7a76Kotlin\u7684\u8a9e\u6cd5\u548c\u7279\u6027\u4e4b\u524d\uff0c\u5148\u4f86\u4e86\u89e3\u4e00\u4e0b\u4ec0\u9ebc\u662fKotlin\u3002<\/p>\n\n\n\n<p>Kotlin\u548cJava\u4e00\u6a23\uff0c\u662f\u904b\u884c\u5728JVM\u4e0a\u7684\u7a0b\u5f0f\u8a9e\u8a00\uff0c\u7531JetBrain\u958b\u767c\u3002<\/p>\n\n\n\n<p>Kotlin\u88ab\u8a2d\u8a08\u6210\u53ef\u4ee5\u548cJava\u7a0b\u5f0f\u78bc\u76f8\u4e92\u904b\u4f5c\u3002\u56e0\u6b64\u5728\u73fe\u6709\u7684Java\u5c08\u6848\u4e2d\u53ef\u4ee5\u76f4\u63a5\u5c0e\u5165Kotlin\u7684\u7a0b\u5f0f\u78bc\uff0c\u4e14\u5169\u8005\u7684\u7a0b\u5f0f\u78bc\u53ef\u4ee5\u4e0d\u9700\u8981\u9032\u884c\u4efb\u4f55\u8f49\u63db\u6216\u662f\u6a4b\u63a5\u5c31\u80fd\u76f4\u63a5\u547c\u53eb\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7279\u8272<\/h2>\n\n\n\n<p>Kotlin\u4f5c\u70ba\u4e00\u6b3e\u65b0\u7684\u7a0b\u5f0f\u8a9e\u8a00\uff0c\u96c6\u5408\u4e86\u73fe\u6709\u7684\u7a0b\u5f0f\u8a9e\u8a00\u8af8\u591a\u7279\u6027\uff0c\u4f7f\u5176\u8b8a\u6210\u4e00\u500b\u76f8\u5c0d\u65bcJava\u9084\u8981\u5bb9\u6613\u4e0a\u624b\u7684\u7a0b\u5f0f\u8a9e\u8a00\u3002<\/p>\n\n\n\n<p><strong>Kotlin\u5177\u5099\u4ee5\u4e0b\u7279\u8272\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u652f\u6301\u578b\u5225\u63a8\u8ad6\uff1a\u7a0b\u5f0f\u5728\u7de8\u8b6f\u6642\u80fd\u5920\u81ea\u52d5\u63a8\u5c0e\u51fa\u6578\u503c\u7684\u8cc7\u6599\u578b\u5225\u3002\u8b93\u958b\u767c\u8005\u5728\u5ba3\u544a\u8b8a\u6578\u6642\u76f4\u63a5\u8f38\u5165\u6578\u503c\u5373\u53ef\uff0c\u578b\u5225\u63a8\u65b7\u6703\u5728\u7de8\u8b6f\u6642\u7531\u7de8\u8b6f\u5668\u5e6b\u4f60\u5b8c\u6210\u3002<\/li><li>\u5e38\u6578\u3001\u8b8a\u6578\u6a19\u793a\u7c21\u6f54\u6613\u61c2\uff1aKotlin\u4f7f\u7528var\u8868\u793a\u8b8a\u6578\u3001val\u8868\u793a\u5e38\u6578\uff0c\u5bb9\u6613\u95b1\u8b80\u3002<\/li><li>\u6bcf\u884c\u7a0b\u5f0f\u78bc\u4e0d\u9700\u52a0\u4e0a\u5206\u865f\u505a\u70ba\u7d50\u5c3e<\/li><\/ul>\n\n\n\n<p><strong>\u9664\u4e86\u4e0a\u8ff0\u5e7e\u500b\u7279\u8272\u4e4b\u5916\uff0cKotlin\u5177\u5099\u4e86\u5e7e\u500b\u512a\u52e2\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>100%\u76f8\u5bb9Java\uff1a\u53ef\u4ee5\u5728\u73fe\u6709\u7684\u5c08\u6848\u76f4\u63a5\u4f7f\u7528Kotlin\u9032\u884c\u65b0\u9805\u76ee\u7684\u958b\u767c\uff0c\u548cJava\u53ef\u4ee5\u7121\u7e2b\u4e32\u63a5<\/li><li>\u652f\u63f4\u8de8\u5e73\u53f0\uff1aJetBrain\u53e6\u5916\u7684\u4e00\u500bKotlin\/Native\u5c08\u6848\uff0c\u76ee\u6a19\u662f\u53ef\u4ee5\u4f7f\u7528Kotlin\u4f86\u958b\u767cAndroid &amp; iOS\u96d9\u5e73\u53f0\u3002<\/li><li>\u53ef\u8b80\u6027\u9ad8\uff1a\u548cJava\u76f8\u6bd4\uff0c\u6368\u53bb\u8a31\u591a\u5197\u4f59\u7684\u7a0b\u5f0f\u78bc\u3001\u4e26\u52a0\u5165\u4e86\u8a31\u591a\u8a9e\u6cd5\u7cd6\u3002\u8b93\u4f7f\u7528Kotlin\u8a9e\u8a00\u958b\u767c\u7684\u7a0b\u5f0f\u78bc\u80fd\u5920\u4ee5\u66f4\u7c21\u6f54\u3001\u66f4\u4e7e\u6de8\u7684\u6a23\u5f0f\u5448\u73fe\u3002\u85c9\u6b64\u63d0\u9ad8\u7a0b\u5f0f\u78bc\u7684\u53ef\u8b80\u6027\u3002<\/li><li>Google\u5168\u529b\u652f\u63f4\uff1aGoogle\u65bc\u4eca\u5e74\u7684Google IO\u5927\u6703\u4e0a\u5ba3\u5e03\uff0cKotlin\u5c07\u6210\u70baAndroid\u5e73\u53f0\u7684\u4e3b\u8981\u958b\u767c\u8a9e\u8a00\u3002<s>(\u53ef\u80fd\u662f\u56e0\u70ba\u8ddf\u7532\u9aa8\u6587\u7684\u5b98\u53f8)<\/s> \u4e26\u91dd\u5c0dAndroid\u5e73\u53f0\u63d0\u4f9b\u958b\u767c\u8005\u4fbf\u5229\u7684\u5957\u4ef6\u4f7f\u7528<s>(\u9019\u9ede\u5f88\u91cd\u8981)<\/s><\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7d50\u5c3e<\/h2>\n\n\n\n<p>\u5728\u7c21\u55ae\u77ad\u89e3\u4e86Kotlin\u9019\u500b\u7a0b\u5f0f\u8a9e\u8a00\u7684\u7279\u6027\u53ca\u512a\u52e2\u4e4b\u5f8c\u3002<\/p>\n\n\n\n<p>\u4f5c\u70ba\u7d00\u9304\uff0c\u63a5\u4e0b\u4f86\u6211\u6703\u91dd\u5c0dKolin\u9019\u9580\u7a0b\u5f0f\u8a9e\u8a00\u7684\u7814\u7a76\u7d50\u679c\uff0c\u64b0\u5beb\u5e7e\u7bc7\u6587\u7ae0\u4f86\u8a18\u9304\u7814\u7a76\u5fc3\u5f97\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google\u65bc\u4eca\u5e74\u7684Google IO\u5927\u6703\u4e0a\u5ba3\u5e03\uff0cKotlin\u5c07\u6210\u70baAndroid\u5e73\u53f0\u7684\u4e00\u7d1a\u958b\u767c\u8a9e\u8a00\u3002 \u6216\u8a31\u4e0d &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[10,19],"class_list":["post-987","post","type-post","status-publish","format-standard","hentry","category-2","tag-android-app","tag-kotlin"],"_links":{"self":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts\/987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=987"}],"version-history":[{"count":7,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts\/987\/revisions"}],"predecessor-version":[{"id":1000,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts\/987\/revisions\/1000"}],"wp:attachment":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}