{"id":189,"date":"2016-04-20T13:43:30","date_gmt":"2016-04-20T04:43:30","guid":{"rendered":"http:\/\/kanehiro.exe.jp\/?p=189"},"modified":"2016-04-21T14:56:15","modified_gmt":"2016-04-21T05:56:15","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","status":"publish","type":"post","link":"https:\/\/kanehiro.exe.jp\/?p=189","title":{"rendered":"Xamarin\u3001\u30b6\u30de\u30ea\u30f3\u3001\u9752\u7a7a\u3001\u6674\u308c\u305f\u7a7a"},"content":{"rendered":"<p>\u3000\u4eca\u56de\u304b\u3089\u30bf\u30a4\u30c8\u30eb\u3092\u5909\u3048\u307e\u3057\u305f\u3002\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(#4)\u3000TwoTouchMail\u3092\u4f5c\u308b<\/strong>\u3067\u3059\u3002<br \/>\n\u30004\u56de\u76ee\u3068\u306a\u308b\u4eca\u56de\u306f\u3001\u300c\u4f5c\u308c\u3070\u308f\u304b\u308b\uff01Androi\uff44\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u300d\u306e\u7b2c\u4e8c\u7ae0\u306e\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30eaTwoTouchMail\u3092Xamarin\u3067\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002\u3068\u306f\u8a00\u3063\u3066\u3082\u3001\u30a4\u30f3\u30c6\u30f3\u30c8\u3067\u30c7\u30fc\u30bf\u3092\u6e21\u3059\u65b9\u6cd5\u3084\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u3092\u6307\u5b9a\u3057\u306a\u3044\u6697\u9ed9\u7684\u306a\u30a4\u30f3\u30c6\u30f3\u30c8\u306b\u3064\u3044\u3066\u306f\u3053\u308c\u307e\u3067\u306e3\u56de\u3067\u3059\u3067\u306b\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3000\u4eca\u56de\u8aac\u660e\u3059\u308b\u306e\u306f\u3001dimens.xml\u3001RadioGroup\u306e\u4f7f\u3044\u65b9\u3001\u305d\u3057\u3066Strings.xml\u306b\u767b\u9332\u3057\u305f\u6587\u5b57\u5217\u3092C#\u306e\u30b3\u30fc\u30c9\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<br \/>\ndimens.xml\u306b\u306fpadding\u3067\u4f7f\u3046\u30de\u30fc\u30b8\u30f3\u306e\u30b5\u30a4\u30ba\u3092\u767b\u9332\u3057\u307e\u3059\u3002dimens.xml\u306f\u65b0\u898f\u4f5c\u6210\u3059\u308bXML\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>\ndimen.xml<\/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;resources&gt;\r\n  &lt;!-- Default screen margins, per the Android Design guidelines. --&gt;\r\n  &lt;dimen name=&quot;activity_horizontal_margin&quot;&gt;16dp&lt;\/dimen&gt;\r\n  &lt;dimen name=&quot;activity_vertical_margin&quot;&gt;16dp&lt;\/dimen&gt;\r\n&lt;\/resources&gt;\r\n<\/pre>\n<p>\u3000\u305d\u3057\u3066\u3001\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u30de\u30fc\u30b8\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4e0b\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u304a\u8fce\u3048\u3092\u983c\u3080PickUp.axml\u3067\u3059\u3002<br \/>\nRelativeLayout\u306e\u5185\u5074\u306b\u4f59\u767d\u3092\u4f5c\u308b\u305f\u3081\u306bdimens.xml\u306e\u7e26\u6a2amargin\u3092paddingXXXXXX\u306b\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\nPickUp.axml<\/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;RelativeLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\r\n    android:layout_width=&quot;match_parent&quot;\r\n    android:layout_height=&quot;match_parent&quot;\r\n    android:paddingBottom=&quot;@dimen\/activity_vertical_margin&quot;\r\n    android:paddingLeft=&quot;@dimen\/activity_horizontal_margin&quot;\r\n    android:paddingRight=&quot;@dimen\/activity_horizontal_margin&quot;\r\n    android:paddingTop=&quot;@dimen\/activity_vertical_margin&quot;&gt;\r\n    &lt;TextView\r\n        android:text=&quot;@string\/subject&quot;\r\n        android:layout_width=&quot;wrap_content&quot;\r\n        android:layout_height=&quot;wrap_content&quot;\r\n        android:textSize=&quot;18sp&quot;\r\n        android:id=&quot;@+id\/textView&quot; \/&gt;\r\n    &lt;EditText\r\n        android:layout_width=&quot;match_parent&quot;\r\n        android:layout_height=&quot;wrap_content&quot;\r\n        android:id=&quot;@+id\/editText&quot;\r\n        android:layout_below=&quot;@+id\/textView&quot;\r\n        android:layout_alignParentLeft=&quot;true&quot;\r\n        android:layout_alignParentStart=&quot;true&quot;\r\n        android:text=&quot;@string\/button_pickup&quot; \/&gt;\r\n    &lt;TextView\r\n        android:layout_width=&quot;wrap_content&quot;\r\n        android:layout_height=&quot;wrap_content&quot;\r\n        android:textAppearance=&quot;?android:attr\/textAppearanceMedium&quot;\r\n        android:text=&quot;@string\/place&quot;\r\n        android:id=&quot;@+id\/textView3&quot;\r\n        android:layout_below=&quot;@+id\/editText&quot;\r\n        android:layout_alignParentLeft=&quot;true&quot;\r\n        android:layout_alignParentStart=&quot;true&quot;\r\n        android:layout_marginTop=&quot;16dp&quot; \/&gt;\r\n    &lt;RadioGroup\r\n        android:id=&quot;@+id\/rg_place&quot;\r\n        android:layout_width=&quot;fill_parent&quot;\r\n        android:layout_height=&quot;wrap_content&quot;\r\n        android:layout_below=&quot;@+id\/textView3&quot;\r\n        android:layout_alignParentLeft=&quot;true&quot;\r\n        android:layout_alignParentStart=&quot;true&quot;&gt;\r\n        &lt;RadioButton\r\n            android:layout_width=&quot;wrap_content&quot;\r\n            android:layout_height=&quot;wrap_content&quot;\r\n            android:text=&quot;@string\/station&quot;\r\n            android:checked=&quot;true&quot;\r\n            android:id=&quot;@+id\/radioButton1&quot; \/&gt;\r\n        &lt;RadioButton\r\n            android:layout_width=&quot;wrap_content&quot;\r\n            android:layout_height=&quot;wrap_content&quot;\r\n            android:text=&quot;@string\/school&quot;\r\n            android:id=&quot;@+id\/radioButton2&quot; \/&gt;\r\n        &lt;RadioButton\r\n            android:layout_width=&quot;wrap_content&quot;\r\n            android:layout_height=&quot;wrap_content&quot;\r\n            android:text=&quot;@string\/always&quot;\r\n            android:id=&quot;@+id\/radioButton3&quot; \/&gt;\r\n    &lt;\/RadioGroup&gt;\r\n    &lt;Button\r\n        android:layout_width=&quot;wrap_content&quot;\r\n        android:layout_height=&quot;wrap_content&quot;\r\n        android:text=&quot;@string\/button_send&quot;\r\n        android:id=&quot;@+id\/button&quot;\r\n        android:layout_below=&quot;@+id\/rg_place&quot;\r\n        android:layout_centerHorizontal=&quot;true&quot; \/&gt;\r\n&lt;\/RelativeLayout&gt;\r\n<\/pre>\n<p><a href=\"http:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/PickUp2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/PickUp2-168x300.png\" alt=\"PickUp2\" width=\"168\" height=\"300\" class=\"alignnone size-medium wp-image-192\" srcset=\"https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/PickUp2-168x300.png 168w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/PickUp2-576x1024.png 576w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/PickUp2-624x1109.png 624w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/PickUp2.png 720w\" sizes=\"(max-width: 168px) 100vw, 168px\" \/><\/a><br \/>\n\u3053\u308c\u3067\u3001TextView\u3084RadioGroup\u306e\u5468\u56f2\u306b\u7a7a\u767d\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3000\u6b21\u306bRadioGroup\u306e\u4f7f\u3044\u65b9\u306b\u9032\u307f\u307e\u3059\u3002PickUp.axml\u306b\u3042\u308b\u3088\u3046\u306bRadioGroup\u306f\u8907\u6570\u306eRadioButton\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u3066\u3001\u629e\u4e00\u306b\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002\u3053\u306e\u4f8b\u306e\u5834\u5408\u3001\u4e00\u756a\u4e0a\u306e\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306eandroid:checked\u304c&#8221;true&#8221;\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3000RadioGroup\u3092\u4f7f\u3046PickUpActivity\u30af\u30e9\u30b9\u306e\u30b3\u30fc\u30c9\u3092\u307f\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\nPickUpActivity\u30af\u30e9\u30b9<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n   public class PickUpActivity : Activity\r\n    {\r\n        protected override void OnCreate(Bundle savedInstanceState)\r\n        {\r\n            base.OnCreate(savedInstanceState);\r\n\r\n            \/\/ Create your application here\r\n            SetContentView(Resource.Layout.PickUp);\r\n\r\n            var btnSend = FindViewById&lt;Button&gt;(Resource.Id.button);\r\n\r\n            btnSend.Click += delegate {\r\n                RadioGroup rgPlace = (RadioGroup)FindViewById(Resource.Id.rg_place);\r\n                int checkedId = rgPlace.CheckedRadioButtonId;\r\n                String strPlace = ((RadioButton)FindViewById(checkedId)).Text;\r\n                EditText edit01 = (EditText)FindViewById(Resource.Id.editText);\r\n                String title = edit01.Text;\r\n\r\n                Context context = this;\r\n                Android.Content.Res.Resources res = context.Resources;\r\n\r\n                var uri = Android.Net.Uri.Parse(&quot;mailto:&quot; + res.GetString(Resource.String.mail_to));\r\n\r\n                Intent intent = new Intent(Intent.ActionSendto, uri);\r\n                intent.PutExtra(Intent.ExtraSubject, title);\r\n                intent.PutExtra(Intent.ExtraText, strPlace + &quot;\u306b\u8fce\u3048\u306b\u304d\u3066&quot;);\r\n                StartActivity(intent);\r\n\r\n            };\r\n\r\n        }\r\n    }\r\n<\/pre>\n<p>\u3000<br \/>\n\u3000btnSend\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089\u3001\u9078\u629e\u3055\u308c\u3066\u3044\u308bRadioButton\u306eText\u3092\u30e1\u30fc\u30eb\u672c\u6587\u306b\u542b\u3081\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u307e\u305a\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306eID\u3092\u6b21\u306e\u30b3\u30fc\u30c9\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\nint checkedId = rgPlace.CheckedRadioButtonId;<br \/>\nAndroid SDK\u3092Java\u3067\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u30dc\u30bf\u30f3\u306eID\u306f\u30e1\u30bd\u30c3\u30c9\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002Xamarin\u306e\u5834\u5408\u306f\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u53d6\u5f97\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u82e5\u5e72\u304a\u5f97\u611f\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3000\u6b21\u306bStrings.xml\u306b\u767b\u9332\u3057\u305f\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3067\u3059\u304c\u3001Android.Content.Res\u306eResources\u30af\u30e9\u30b9\u306eGetString\u30e1\u30bd\u30c3\u30c9\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002Resource.String.mail_to\u306fStrings.xml\u306b\u767b\u9332\u3057\u305f\u9001\u4fe1\u5148\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3059\u3002<br \/>\n\u3000\u305d\u3057\u3066\u3001ActionSendto\u3092\u6307\u5b9a\u3057\u3066Intent\u3092\u751f\u6210\u3057\u3001PutExtra\u30e1\u30bd\u30c3\u30c9\u3067\u30bf\u30a4\u30c8\u30eb\u3084\u672c\u6587\u3092\u4ed8\u4e0e\u3057\u3001StartActivity\u30e1\u30bd\u30c3\u30c9\u3067\u6697\u9ed9\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\uff08\u660e\u793a\u7684\u306b\u9077\u79fb\u5148\u3092\u6307\u5b9a\u3057\u306a\u3044\u30a4\u30f3\u30c6\u30f3\u30c8\uff09\u3092\u767a\u884c\u3057\u307e\u3059\u3002<br \/>\n\u3000\u3059\u308b\u3068\u3001\u30e1\u30fc\u30eb\u30a2\u30d7\u30ea\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/mailapp2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/mailapp2-168x300.png\" alt=\"mailapp2\" width=\"168\" height=\"300\" class=\"alignnone size-medium wp-image-193\" srcset=\"https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/mailapp2-168x300.png 168w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/mailapp2-576x1024.png 576w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/mailapp2-624x1109.png 624w, https:\/\/kanehiro.exe.jp\/wp-content\/uploads\/2016\/04\/mailapp2.png 720w\" sizes=\"(max-width: 168px) 100vw, 168px\" \/><\/a><br \/>\n\u3000\u3053\u308c\u3067\u7c21\u5358\u306b\u30e1\u30fc\u30eb\u3092\u9001\u308b\u30a2\u30d7\u30ea\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u4eca\u56de\u304b\u3089\u30bf\u30a4\u30c8\u30eb\u3092\u5909\u3048\u307e\u3057\u305f\u3002\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(#4)\u3000TwoTouchMail\u3092\u4f5c\u308b\u3067\u3059\u3002  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,12,13],"tags":[],"_links":{"self":[{"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=\/wp\/v2\/posts\/189"}],"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=189"}],"version-history":[{"count":0,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions"}],"wp:attachment":[{"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kanehiro.exe.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}