{"id":810,"date":"2018-04-08T21:34:05","date_gmt":"2018-04-08T12:34:05","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=810"},"modified":"2023-05-27T17:46:08","modified_gmt":"2023-05-27T08:46:08","slug":"%e3%80%90android%e3%80%91%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%81%a8%e3%83%aa%e3%82%b9%e3%83%8a%e3%83%bc%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=810","title":{"rendered":"\u3010Android\u3011\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb(Java\u30b3\u30fc\u30c9\uff09\u306e\u57fa\u672c"},"content":{"rendered":"<p>\u305d\u308c\u3067\u306f\u3001\u3088\u3046\u3084\u304f\u672c\u984c\u306eJava\u30bd\u30fc\u30b9\u3067\u3042\u308b\u300c\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u300d\u306e\u57fa\u672c\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-520\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u3088\u304f\u4f7f\u3046\u30d5\u30a1\u30a4\u30eb1.png\" alt=\"\" width=\"201\" height=\"72\" \/><\/p>\n<p>Android\u306f\u3001Java\u8a00\u8a9e\u3067\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001<strong>Android\u30a2\u30d7\u30ea\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306e\u7279\u6709\u306e\u66f8\u304d\u65b9\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u4e2d\u5fc3\u306b\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u306a\u304a\u3001\u3053\u3053\u3067\u306f\u3001Java\u306e\u57fa\u672c\u7684\u306a\u6587\u6cd5\u306b\u3064\u3044\u3066\u306f\u89e3\u8aac\u3057\u307e\u305b\u3093\u3002\u3082\u3057\u3001\u4e0d\u5b89\u3068\u3044\u3046\u65b9\u306f\u3001\u307e\u305aJava\u8a00\u8a9e\u305d\u306e\u3082\u306e\u306e\u6587\u6cd5\u306b\u3064\u3044\u3066\u4ed6\u306e\u66f8\u7c4d\u306a\u308a\u3067\u52c9\u5f37\u3055\u308c\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/strong><\/span><\/p>\n<p>\u4e0b\u8a18\u306f\u3001Empty Activity\u3092\u4f5c\u3063\u305f\u969b\u306b\u3001\u307e\u305a\u6700\u521d\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage com.test.helloworld;\r\n\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_main);\r\n\t}\r\n}\r\n\r\n<\/pre>\n<h2>\u30a2\u30d7\u30ea\u306e\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066<\/h2>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class MainActivity extends AppCompatActivity {\r\n\u3000\u2026\r\n}\r\n<\/pre>\n<p>\u30a2\u30d7\u30ea\u3092\u4f5c\u308b\u3068\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306a\u30af\u30e9\u30b9\u5ba3\u8a00\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u300cMainActivity\u300d\u306f\u4eca\u56de\u4f5c\u6210\u3057\u305f\u30a2\u30d7\u30ea\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<h3>AppCompatActivity\u30af\u30e9\u30b9<\/h3>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u3001\u300cAppCompatActivity\u30af\u30e9\u30b9\u300d\u3092\u7d99\u627f\u3057\u3066\u3044\u307e\u3059\u3002Android\u306e\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u306f\u3001\u5fc5\u305a\u3053\u306e\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u3066\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u30af\u30e9\u30b9\u306f\u3001Android\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u57fa\u672c\u7684\u306a\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<h2>onCreate\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066<\/h2>\n<p>\u6b21\u306b\u3001\u6c17\u306b\u306a\u308b\u306e\u304c\u3001\u4e0b\u8a18\u306e\u300conCreate\u30e1\u30bd\u30c3\u30c9\u300d\u3067\u3059\u3088\u306d\u3002\u3053\u308c\u306f\u3001<span style=\"color: #ff0000;\"><strong>Android\u30a2\u30d7\u30ea\u3092\u8d77\u52d5\u3059\u308b\u3068\u307e\u305a\u521d\u3081\u306b\u5b9f\u884c\u3055\u308c\u308b\u30e1\u30bd\u30c3\u30c9<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002 \u666e\u901a\u306e\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u30a2\u30d7\u30ea\u3067\u52d5\u304b\u3059Java\u3067\u3042\u308c\u3070\u3001<strong>\u300cpublic static void main(String args[])\u300d<\/strong>\u306b\u8a72\u5f53\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t}\r\n<\/pre>\n<p>\u306a\u306e\u3067\u3001\u672c\u30e1\u30bd\u30c3\u30c9\u306b\u306f\u3001<strong>\u753b\u9762\u3084\u30c7\u30fc\u30bf\u306e\u4f5c\u6210\u306b\u5fc5\u8981\u306a\u521d\u671f\u51e6\u7406<\/strong>\u3092\u4e3b\u306b\u3001\u8a18\u8ff0\u3057\u3066\u3044\u304f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n\r\nsuper.onCreate(savedInstanceState);\r\n\r\n<\/pre>\n<p>\u307e\u305f\u3001onCreate\u30e1\u30bd\u30c3\u30c9\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4e0a\u8a18\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u300csuper.onCreate(savedInstanceState);\u300d\u3068\u3044\u3046\u306e\u306f\u3001super\u304c\u3001\u7d99\u627f\u5143\u306e\u89aa\u30af\u30e9\u30b9\u306e\u300cAppCompatActivity\u300d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u89aa\u30af\u30e9\u30b9\u306b\u3082onCreate\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308b\u306e\u3067\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n\r\nsetContentView(R.layout.activity_main);\r\n\r\n<\/pre>\n<p>\u4e0a\u8a18\u884c\u306b\u95a2\u3057\u3066\u306f\u3001<strong>\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb(xml)\u3067\u5ba3\u8a00\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u3053\u306e\u30a2\u30d7\u30ea\u306e\u753b\u9762\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb(xml)\u306b\u3064\u3044\u3066\u5206\u304b\u3089\u306a\u3044\u65b9\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3092\u3054\u53c2\u7167\u4e0b\u3055\u3044\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"xaEqdvDj4g\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=530\">\u3010Android\u3011\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb(res\/layout\/\uff5e.xml)\u306e\u69cb\u6210\u8981\u7d20<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=530&#038;embed=true#?secret=xaEqdvDj4g\" data-secret=\"xaEqdvDj4g\" width=\"500\" height=\"282\" title=\"&#8220;\u3010Android\u3011\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb(res\/layout\/\uff5e.xml)\u306e\u69cb\u6210\u8981\u7d20&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h3>R\u306b\u3064\u3044\u3066<\/h3>\n<p>\u300cR.layout.activity_main\u300d\u3068\u3044\u3046\u8a18\u8ff0\u3067\u3059\u304c\u3001\u300cactivity_main\u300d\u306f\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u306b\u306a\u308a\u307e\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u300cR\u300d\u3068\u306f\u4f55\u3067\u3057\u3087\u3046\u304b\u3002<\/strong><\/span><\/p>\n<p>R\u306f\u3001\u7d50\u8ad6\u304b\u3089\u8a00\u3048\u3070\u3001<strong>\u300cR\u30af\u30e9\u30b9\u300d\u3068\u3044\u3046\u30af\u30e9\u30b9\u304c\u3042\u308b<\/strong>\u306e\u3067\u3059\u3002<\/p>\n<p>\u300cR.layout.activity_main\u300d\u81ea\u4f53\u304c\u3001<strong>\uff32\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30d1\u30b9\u3092\u793a\u3059\u5b9a\u6570<\/strong>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u5b9f\u969b\u306b\u306f\u3001\u300cR.layout.activity_main\u300d\u306f\u3001\u300cres\/layout\/activity_main.xml\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u305d\u308c\u3067\u306f\u3001\u3088\u3046\u3084\u304f\u672c\u984c\u306eJava\u30bd\u30fc\u30b9\u3067\u3042\u308b\u300c\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u300d\u306e\u57fa\u672c\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u304d\u307e\u3059\u3002 Android\u306f\u3001Java\u8a00\u8a9e\u3067\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001Android\u30a2\u30d7\u30ea\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306e\u7279\u6709\u306e\u66f8\u304d\u65b9\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001 [&hellip;]","protected":false},"author":1,"featured_media":824,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/810"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=810"}],"version-history":[{"count":13,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions"}],"predecessor-version":[{"id":20067,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions\/20067"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/824"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}