{"id":5748,"date":"2017-06-20T10:00:01","date_gmt":"2017-06-20T01:00:01","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=5748"},"modified":"2017-06-19T19:32:26","modified_gmt":"2017-06-19T10:32:26","slug":"androidstudio%e3%81%a7kotlin%e3%82%92%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/5748","title":{"rendered":"AndroidStudio\u3067Kotlin\u3092\u4f7f\u7528"},"content":{"rendered":"<p>\u5c11\u3057\u524d\u304b\u3089Kotlin\u306b\u5bfe\u3057\u3066\u306e\u8208\u5473\u306f\u3042\u308a\u3001AndroidStudio\u3067\u3082\u516c\u5f0f\u306b\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u4f7f\u3063\u3066\u898b\u3088\u3046\u304b\u3068\u601d\u3044\u307e\u3057\u305f<\/p>\n<p>Kotlin\u3092\u4f7f\u3046\u5834\u5408\u306bAndroid Studio3.0\u672a\u6e80\u3067\u306f\u3001Plugin\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001gradle\u3082\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f<br \/>\n Android Studio3.0\u304b\u3089\u306f\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u305b\u305a\u3068\u3082\u3001\u30d7\u30ea\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u3066\u3001\u6a19\u6e96\u6a5f\u80fd\u3068\u3057\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u307f\u305f\u3044\u3067\u3059<\/p>\n<p>\u4eca\u56de\u306f\u3001\u5909\u6570\u5ba3\u8a00\u3001if\u6587\u3001for\u6587\u306a\u3069\u306e\u57fa\u672c\u7684\u306a\u8a18\u8ff0\u3092\u307e\u3068\u3081\u3066\u3044\u304d\u307e\u3059<\/p>\n<p><!--more--><\/p>\n<h3>Kotlin<\/h3>\n<p>Kotlin\u306fJetBrains\u304c\u958b\u767a\u3092\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059<br \/>\n <span style=\"color: #0000ff\"><strong>Kotlin is 100% interoperable with Java(Kotlin\u306fJava\u3068100\uff05\u76f8\u4e92\u904b\u7528\u53ef\u80fd)<\/strong><\/span>\u3068\u3055\u308c\u3066\u304a\u308a\u3001<span style=\"color: #000000\">Java\u30af\u30e9\u30b9\u304b\u3089Kotlin\u30af\u30e9\u30b9\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u3001Kotlin\u30af\u30e9\u30b9\u304b\u3089Java\u30af\u30e9\u30b9\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059<\/span><\/p>\n<h3>Kotlin\u3067\u306e\u8a18\u8ff0<\/h3>\n<p>\u5909\u6570\u5ba3\u8a00\u3067\u306f\u3001var\u3068val\u3092\u4f7f\u3044\u307e\u3059<br \/>\n var\u3067\u5ba3\u8a00\u3055\u308c\u305f\u5909\u6570\u306f\u3001\u5185\u5bb9\u306e\u5909\u66f4\u304c\u53ef\u80fd\u3067\u3059<br \/>\n val\u3067\u5ba3\u8a00\u3055\u308c\u305f\u5909\u6570\u306f\u3001Java\u3067\u3044\u3046final\u3068\u540c\u69d8\u3067\u5185\u5bb9\u306e\u5909\u66f4\u304c\u4e0d\u53ef\u80fd\u3067\u3059<br \/>\n Kotlin\u3067\u306f\u3001<strong><span style=\"color: #0000ff\">final\u3068\u6253\u3064\u624b\u9593\u304c\u7701\u3051\u3066<\/span><\/strong>\u3044\u3044\u3067\u3059\u306d<\/p>\n<pre style=\"border: dashed #000000 2px\"><code>        var a : String = \"a\"\r\n        val b : String = \"b\"\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u307e\u305f\u3001Kotlin\u3067\u306f\u3001\u578b\u3092\u660e\u793a\u7684\u306b\u8a18\u8ff0\u3057\u306a\u304f\u3066\u3082\u3001\u4ee3\u5165\u6642\u306e\u53f3\u8fba\u304b\u3089\u578b\u3092\u63a8\u8ad6\u3057\u3066\u304f\u308c\u307e\u3059<br \/>\n \u3053\u306e\u5834\u5408\u306f\u3001c\u306fInt\u3001d\u306fDouble\u3001e\u306fFloat\u306b\u306a\u308a\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 2px\"><code>        var c = 1\r\n        val d = 2.1\r\n        val e = 3.14f<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>if\u6587\u3067\u306f\u3001\u5f93\u6765\u306e\u4f7f\u3044\u65b9\u306b\u52a0\u3048\u3066\u3001\u5f0f\u3068\u3057\u3066\u4f7f\u3048\u30d6\u30ed\u30c3\u30af\u5185\u306e\u6700\u5f8c\u306b\u8a55\u4fa1\u3055\u308c\u305f\u5024\u304c\u7d50\u679c\u3068\u3057\u3066\u4ee3\u5165\u3055\u308c\u308b<br \/>\n <span style=\"color: #0000ff\"><strong>\u5f0f\u3068\u3057\u3066\u4f7f\u3046\u5834\u5408\u306b\u306f\u3001else\u306f\u5fc5\u9808<\/strong><\/span>\u3068\u306a\u308a\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 2px\"><code>        \/\/\u5f93\u6765\u306e\u4f7f\u3044\u65b9\r\n        var max:Int\r\n        if(c &gt; d){\r\n            max = c\r\n        }else{\r\n            max = d\r\n        }\r\n\r\n        \/\/\u5f0f\u3068\u3057\u3066\u306e\u4f7f\u3044\u65b9\r\n        val x = if(c &gt; 40){\r\n            \"a\"\r\n        }else{\r\n            \"b\"\r\n        }\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>while\u6587\u306f\u3001Java\u3068\u540c\u69d8\u306e\u4f7f\u3044\u65b9\u3067\u3059<\/p>\n<pre style=\"border: dashed #000000 2px\"><code>        while(c &gt; 0){\r\n            c--\r\n        }\r\n<\/code><\/pre>\n<h3>\u7d42\u308f\u308a\u306b<\/h3>\n<p>\u5730\u5473\u306b\u5b09\u3057\u3044\u306e\u304c\u3001\u6587\u672b\u306e\u30bb\u30df\u30b3\u30ed\u30f3(;)\u304c\u4e0d\u8981\u306a\u306e\u6240\u3067\u3059\uff01<br \/>\n \u30bb\u30df\u30b3\u30ed\u30f3\u5fd8\u308c\u3067\u3001\u30a8\u30e9\u30fc\u3092\u63a2\u3059\u624b\u9593\u304c\u7701\u3051\u307e\u3059<br \/>\n Kotlin\u3092\u4f7f\u3063\u305f\u958b\u767a\u306e\u65b9\u304c\u624b\u9593\u306f\u5c11\u306a\u3044\u306e\u3067\u3001\u4eca\u5f8c\u306f\u3053\u3061\u3089\u3082\u4f7f\u3063\u3066\u958b\u767a\u3092\u3057\u3066\u3044\u304d\u305f\u3044\u3067\u3059<\/p>\n<p>\u6b21\u56de\u306f\u3001\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3084\u30af\u30e9\u30b9\u306a\u3069\u3092\u66f8\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059<\/p>\n<p>\u706b\u66dc\u65e5\u62c5\u5f53\uff1apoppy<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5748\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/5748\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"AndroidStudio\u3067Kotlin\u3092\u4f7f\u7528\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5748\" data-text=\"AndroidStudio\u3067Kotlin\u3092\u4f7f\u7528\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5748\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5748\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u5c11\u3057\u524d\u304b\u3089Kotlin\u306b\u5bfe\u3057\u3066\u306e\u8208\u5473\u306f\u3042\u308a\u3001AndroidStudio\u3067\u3082\u516c\u5f0f\u306b\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u4f7f\u3063\u3066\u898b\u3088\u3046\u304b\u3068\u601d\u3044\u307e\u3057\u305f Kotlin\u3092\u4f7f\u3046\u5834\u5408\u306bAndroid Studio3.0\u672a\u6e80\u3067\u306f\u3001Plugin\u304b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100,119,12],"tags":[56,79,120],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5748"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=5748"}],"version-history":[{"count":11,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5748\/revisions"}],"predecessor-version":[{"id":5770,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5748\/revisions\/5770"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=5748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=5748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=5748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}