{"id":205,"date":"2016-05-25T15:02:46","date_gmt":"2016-05-25T06:02:46","guid":{"rendered":"http:\/\/kanehiro.exe.jp\/?p=205"},"modified":"2016-05-25T15:02:46","modified_gmt":"2016-05-25T06:02:46","slug":"xamarin%e3%80%81%e3%82%b6%e3%83%9e%e3%83%aa%e3%83%b3%e3%80%81%e9%9d%92%e7%a9%ba%e3%80%81%e6%99%b4%e3%82%8c%e3%81%9f%e7%a9%ba%e3%80%80%ef%bc%8d%e4%bd%8f%e6%89%80%e3%81%8b%e3%82%89%e7%b7%af%e5%ba%a6","status":"publish","type":"post","link":"https:\/\/kanehiro.exe.jp\/?p=205","title":{"rendered":"Xamarin\u3001\u30b6\u30de\u30ea\u30f3\u3001\u9752\u7a7a\u3001\u6674\u308c\u305f\u7a7a\u3000\uff0d\u4f4f\u6240\u304b\u3089\u7def\u5ea6\u30fb\u7d4c\u5ea6\u3092\u53d6\u5f97\u3059\u308b\uff0d"},"content":{"rendered":"<p>\u3000\u3053\u3061\u3089\u306e<a href=\"http:\/\/www.kerorin.com\/fanclub\/cm.html\" title=\"\u30b1\u30ed\u30ea\u30f3\" target=\"_blank\">\u30b5\u30a4\u30c8<\/a>\u306e\u30e1\u30ed\u30c7\u30a3\u30fc\u3068\u3068\u3082\u306b\u304a\u697d\u3057\u307f\u304f\u3060\u3055\u3044\u3002<br \/>\n\u6b63\u5f0f\u306a\u30bf\u30a4\u30c8\u30eb\u306f<strong>Visual Studio\u306eXamarin\u3067Android\u30a2\u30d7\u30ea\u3092\u4f5c\u308b(#6)\u3000Geocorder\u3092\u4f7f\u3046<\/strong>\u3067\u3059\u3002<br \/>\n6\u56de\u76ee\u3068\u306a\u308b\u4eca\u56de\u306f\u3001Geocorder\u3092\u4f7f\u3063\u3066\u4f4f\u6240\u304b\u3089\u7def\u5ea6\u30fb\u7d4c\u5ea6\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3059\u3002\u4eca\u56de\u3082<a href=\"https:\/\/developer.xamarin.com\/recipes\/android\/os_device_resources\/geocoder\/geocode_an_address\/\" target=\"_blank\">developer.xamarin.com<\/a>\u306e\u30ec\u30b7\u30d4\u3001\u307b\u3068\u3093\u3069\u305d\u306e\u307e\u307e\u3067\u3059\u304c\u3001\u65e5\u672c\u306e\u4f4f\u6240\u306e\u4e0e\u3048\u65b9\u3084\u82e5\u5e72\u88dc\u8db3\u8aac\u660e\u304c\u3042\u3063\u305f\u65b9\u304c\u826f\u3044\u304b\u3068\u601d\u3044\u66f8\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\r\n    android:orientation=&quot;vertical&quot;\r\n    android:layout_width=&quot;fill_parent&quot;\r\n    android:layout_height=&quot;fill_parent&quot;&gt;\r\n    &lt;Button\r\n        android:id=&quot;@+id\/geocodeButton&quot;\r\n        android:layout_width=&quot;fill_parent&quot;\r\n        android:layout_height=&quot;wrap_content&quot;\r\n        android:text=&quot;@string\/geocodeButtonText&quot; \/&gt;\r\n    &lt;TextView\r\n        android:id=&quot;@+id\/addressText&quot;\r\n        android:layout_width=&quot;fill_parent&quot;\r\n        android:layout_height=&quot;fill_parent&quot; \/&gt;\r\n&lt;\/LinearLayout&gt;\r\n<\/pre>\n<p>\u753b\u9762\u306b\u306f\u3001\u7def\u5ea6\u30fb\u7d4c\u5ea6\u5f15\u304d\u3092\u8d77\u52d5\u3059\u308b\u30dc\u30bf\u30f3\u3068\u53d6\u5f97\u3057\u305f\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u30d3\u30e5\u30fc\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306bMainActivity\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nusing System;\r\nusing Android.App;\r\nusing Android.Content;\r\nusing Android.Runtime;\r\nusing Android.Views;\r\nusing Android.Widget;\r\nusing Android.OS;\r\nusing System.Threading;\r\nusing Android.Locations;\r\nusing System.Linq;\r\n\r\nnamespace Geocorder\r\n{\r\n    &#x5B;Activity(Label = &quot;Geocorder&quot;, MainLauncher = true, Icon = &quot;@drawable\/icon&quot;)]\r\n    public class MainActivity : Activity\r\n    {\r\n        protected override void OnCreate(Bundle bundle)\r\n        {\r\n            base.OnCreate(bundle);\r\n\r\n            \/\/ Set our view from the &quot;main&quot; layout resource\r\n            SetContentView(Resource.Layout.Main);\r\n\r\n            \/\/ Get our button from the layout resource,\r\n            \/\/ and attach an event to it\r\n            var button = FindViewById&lt;Button&gt;(Resource.Id.geocodeButton);\r\n            button.Click += (sender, e) =&gt; {\r\n                new Thread(new ThreadStart(() =&gt; {\r\n                    var geo = new Geocoder(this);\r\n\r\n                    \/\/var addresses = geo.GetFromLocationName(&quot;50 Church St, Cambridge, MA&quot;, 1);\r\n                    var addresses = geo.GetFromLocationName(&quot;\u6771\u4eac\u90fd\u6e2f\u533a\u516d\u672c\u67285-11-16&quot;, 1);\r\n\r\n                    RunOnUiThread(() =&gt; {\r\n                        var addressText = FindViewById&lt;TextView&gt;\r\n                               (Resource.Id.addressText);\r\n\r\n                        addresses.ToList().ForEach((addr) =&gt; {\r\n                            addressText.Append(addr.ToString() +\r\n                                   &quot;\\r\\n\\r\\n&quot;);\r\n                        });\r\n                    });\r\n                })).Start();\r\n\r\n            };\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>Geocoder#GetFromLocationName\u306b\u306f\u3001\u65e5\u672c\u8a9e\u306e\u4f4f\u6240\u3092\u305d\u306e\u307e\u3093\u307e\u4e0e\u3048\u307e\u3059\u3002<br \/>\nRunOnUiThread\u306f\u5185\u90e8\u3067\u3001Handler#post\u3092\u547c\u3093\u3067\u3044\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/05\/geocoder.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/05\/geocoder-168x300.png\" alt=\"geocoder\" width=\"168\" height=\"300\" class=\"alignnone size-medium wp-image-207\" srcset=\"https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/05\/geocoder-168x300.png 168w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/05\/geocoder-576x1024.png 576w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/05\/geocoder-624x1109.png 624w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/05\/geocoder.png 1440w\" sizes=\"(max-width: 168px) 100vw, 168px\" \/>\u5b9f\u884c\u7d50\u679c<\/a><br \/>\n\u7def\u5ea6\u30fb\u7d4c\u5ea6\u306e\u307b\u304b\u306b\u90f5\u4fbf\u756a\u53f7\u3084\u8a73\u7d30\u306a\u4f4f\u6240\u3082\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u3053\u3061\u3089\u306e\u30b5\u30a4\u30c8\u306e\u30e1\u30ed\u30c7\u30a3\u30fc\u3068\u3068\u3082\u306b\u304a\u697d\u3057\u307f\u304f\u3060\u3055\u3044\u3002 \u6b63\u5f0f\u306a\u30bf\u30a4\u30c8\u30eb\u306fVisual Studio\u306eXamarin\u3067Android\u30a2\u30d7\u30ea\u3092\u4f5c\u308b(#6)\u3000Geocorder\u3092\u4f7f\u3046\u3067\u3059\u3002 6\u56de\u76ee\u3068\u306a\u308b\u4eca\u56de\u306f\u3001Geocorde [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,13],"tags":[],"_links":{"self":[{"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=\/wp\/v2\/posts\/205"}],"collection":[{"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=205"}],"version-history":[{"count":0,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=\/wp\/v2\/posts\/205\/revisions"}],"wp:attachment":[{"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}