{"id":331,"date":"2012-05-25T22:11:51","date_gmt":"2012-05-25T13:11:51","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2012\/05\/25\/android_10\/"},"modified":"2012-05-25T22:11:51","modified_gmt":"2012-05-25T13:11:51","slug":"android_10","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2012\/05\/25\/android_10\/","title":{"rendered":"Android \u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u30a2\u30d7\u30ea\u306b\u7d44\u307f\u8fbc\u3080"},"content":{"rendered":"<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2012\/05\/16\/android_app\">\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u4f5c\u308a\u65b9\u3092\u5c11\u3057\u8abf\u3079\u3066<\/a>\u3001\u306a\u306b\u304b\u3064\u304f\u308d\u3046\u304b\u3068\u601d\u3063\u305f\u306e\u3060\u3051\u3069\u3001\u3044\u308d\u3044\u308d\u5236\u7d04\u304c\u591a\u304f\u3066(\u307e\u3041\u5e38\u6642\u30db\u30fc\u30e0\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3060\u304b\u3089\u5f53\u305f\u308a\u524d\u3068\u3044\u3048\u3070\u5f53\u305f\u308a\u524d\u3060\u3051\u3069)\u9762\u5012\u3002\u305f\u3060\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3001\u30e9\u30f3\u30c1\u30e3\u30fc\u304f\u3089\u3044\u3064\u304f\u3063\u3066\u7d44\u307f\u8fbc\u3082\u3046\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_12E3A\/android_widget01.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"android_widget01\" border=\"0\" alt=\"android_widget01\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_12E3A\/android_widget01_thumb.png\" width=\"194\" height=\"320\" \/><\/a><\/p>\n<h2>\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u51e6\u7406<\/h2>\n<p>\u57fa\u672c\u7684\u306b\u306f\u3001<a href=\"http:\/\/developer.android.com\/guide\/topics\/appwidgets\/index.html\">\u3053\u3053<\/a> \u306e \u30b5\u30f3\u30d7\u30eb\u306e\u307e\u307e\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306a\u4f5c\u308a\u65b9\u306e\u90e8\u5206\u306f\u3001<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2012\/05\/16\/android_app\">\u3053\u3061\u3089<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2012\/05\/16\/android_app\">https:\/\/www.typea.info\/blog\/index.php\/2012\/05\/16\/android_app<\/a><\/p>\n<p>\u300c\u51e6\u7406\u304c\u91cd\u304f\u3066\u3082\u8efd\u304f\u3066\u3082\u3001\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u3059\u308b\u307b\u3046\u304c\u3088\u3044\u300d \u3063\u3066\u3001<a href=\"http:\/\/www.atmarkit.co.jp\/fsmart\/articles\/android10\/android10_3.html\">\u3053\u3053<\/a> \u306b\u66f8\u3044\u3066\u3042\u3063\u305f\u3051\u3069\u3001\u7406\u5c48\u304c\u308f\u304b\u3089\u306a\u3044\u306e\u3067\u3001\u5f93\u308f\u306a\u3044\u3067\u304a\u304f\u3002<\/p>\n<p>\u3042\u3068\u3001\u6ce8\u610f\u70b9\u304c\u3044\u304f\u3064\u304b\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u308f\u306a\u3044\u3068\u3001extra \u30c7\u30fc\u30bf\u3092\u6e21\u3057\u3066\u3082\u3001\u53d7\u3051\u53d6\u308b\u3068\u304d\u306b null \u3068\u306a\u3063\u3066\u3057\u307e\u3044\u6e21\u3089\u306a\u3044\u3002<\/p>\n<p>\u56de\u907f\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u5bfe\u5fdc\u3002<\/p>\n<h3>requestCode \u3092 Intent \u306e\u7a2e\u985e\u6bce\u306b\u5225\u306e\u5024\u3092\u6307\u5b9a\u3059\u308b<\/h3>\n<p>\u4e0a\u56f3\u306e\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306f\u3001\u30a2\u30a4\u30b3\u30f3\u3001\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u3001\u97f3\u58f0\u5165\u529b\u30dc\u30bf\u30f3\u306e3\u3064\u304b\u3089\u306a\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u305e\u308c\u3001\u8d77\u52d5\u3001\u8d77\u52d5\uff0b\u691c\u7d22\u51e6\u7406\u547c\u3073\u51fa\u3057\u3001\u8d77\u52d5\uff0b\u97f3\u58f0\u691c\u7d22\u51e6\u7406\u547c\u3073\u51fa\u3057 \u3092\u884c\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u4f8b\u3067\u306f\u3001PendingIntent \u306e\u547c\u3073\u51fa\u3057\u306e\u3001\u7b2c2\u3001\u7b2c4 \u5f15\u6570\u304c\u30010 \u306b\u306a\u3063\u3066\u304a\u308a\u3001<\/p>\n<pre>PendingIntent.getActivity(context, 0, intent, 0);<\/pre>\n<p>\u304b\u3064\u3001<a href=\"http:\/\/developer.android.com\/reference\/android\/app\/PendingIntent.html#getActivity(android.content.Context, int, android.content.Intent, int)\">PendingIntent \u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/a>\u3067\u30012\u3064\u3081\u306e\u5f15\u6570\u306f\u3001currently not used <\/p>\n<p>requestCode<br \/>\n  <br \/>Private request code for the sender (currently not used)<\/p>\n<p>\u3068\u304b\u306a\u3063\u3066\u308b\u306e\u3060\u304c\u3001\u305d\u308c\u305e\u308c\u7a2e\u985e\u306e\u533a\u5225\u304c\u3064\u304f\u3088\u3046\u306b\u30b3\u30fc\u30c9\u3092\u632f\u308b<\/p>\n<h3>flags \u306b\u306f\u3001FLAG_UPDATE_CURRENT \u3092\u6307\u5b9a\u3059\u308b<\/h3>\n<p>\u307e\u305f\u30014\u3064\u3081\u306e\u5f15\u6570 flags \u306b 0 \u3067\u306f\u306a\u304f\u3001<a href=\"http:\/\/developer.android.com\/reference\/android\/app\/PendingIntent.html#FLAG_UPDATE_CURRENT\">FLAG_UPDATE_CURRENT<\/a> \u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\"><p>package info.typea.eitangoroid;\r\n\r\nimport info.typea.eitangoroid.FlippadApplication.INTENT_EXTRA_KEY;\r\nimport info.typea.eitangoroid.pro.FlippadroidMainActivity;\r\nimport info.typea.eitangoroid.pro.R;\r\nimport android.app.AlarmManager;\r\nimport android.app.PendingIntent;\r\nimport android.app.SearchManager;\r\nimport android.app.Service;\r\nimport android.appwidget.AppWidgetManager;\r\nimport android.appwidget.AppWidgetProvider;\r\nimport android.content.ComponentName;\r\nimport android.content.Context;\r\nimport android.content.Intent;\r\nimport android.os.IBinder;\r\nimport android.util.Log;\r\nimport android.widget.RemoteViews;\r\n\r\npublic class FlippadWidgetProvider extends AppWidgetProvider {\r\n    \r\n    @Override\r\n    public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {\r\n        \r\n        for (int i=0; i&lt;appWidgetIds.length; i++) {\r\n            RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.flippad_widget);\r\n\r\n            Intent launchIntent = new Intent(context, FlippadroidMainActivity.class); \r\n            PendingIntent pendingLaunchIntent = PendingIntent.getActivity(context, 1, launchIntent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n            rv.setOnClickPendingIntent(R.id.btn_launch ,pendingLaunchIntent);\r\n\r\n            Intent searchIntent = new Intent(context, FlippadroidMainActivity.class); \r\n            searchIntent.setAction(Intent.ACTION_SEARCH);\r\n            PendingIntent pendingSearchIntent = PendingIntent.getActivity(context, 2, searchIntent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n            rv.setOnClickPendingIntent(R.id.btn_dummy_text ,pendingSearchIntent);\r\n            \r\n            Intent voiceSearchIntent = new Intent(context, FlippadroidMainActivity.class); \r\n            voiceSearchIntent.setAction(Intent.ACTION_SEARCH);\r\n            voiceSearchIntent.putExtra(INTENT_EXTRA_KEY.SEARCH_BY_VOICE.toString(), &quot;voice&quot;);\r\n            PendingIntent pendingVoiceSearchIntent = PendingIntent.getActivity(context, 3, voiceSearchIntent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n            rv.setOnClickPendingIntent(R.id.btn_speak ,pendingVoiceSearchIntent);\r\n            \r\n            appWidgetManager.updateAppWidget(appWidgetIds[i], rv);\r\n        }\r\n    }\r\n}<\/p><\/pre>\n<h2>\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u30ec\u30a4\u30a2\u30a6\u30c8<\/h2>\n<p>\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u7528\u306b\u3001\u7d75\u3092\u63cf\u304f\u306e\u3082\u9762\u5012\u306a\u306e\u3067\u3001Android \u304c\u3082\u3068\u3082\u3068\u6301\u3063\u3066\u3044\u308b\u30ea\u30bd\u30fc\u30b9\u3092\u4f7f\u3046\u30029\u30d1\u30c3\u30c1\u3068\u304b\u3064\u304f\u3063\u305f\u3053\u3068\u7121\u3044\u3057\u3002 <\/p>\n<p>Android \u306e drawable \u30ea\u30bd\u30fc\u30b9\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u3066\u304a\u8336\u3092\u6fc1\u305d\u3046\u3002<\/p>\n<p>Android \u306e drawable \u30ea\u30bd\u30fc\u30b9\u306f\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u306f\u3001<\/p>\n<h4>@android:drawable\/\u30ea\u30bd\u30fc\u30b9ID<\/h4>\n<p>\u3067\u6307\u5b9a\u3067\u304d\u308b<\/p>\n<p>Android \u306e drawable \u306a \u30ea\u30bd\u30fc\u30b9\u306e\u5185\u5bb9\u306f\u3001<a href=\"http:\/\/androiddrawables.com\/\">\u3053\u306e\u3042\u305f\u308a\u304b\u3089\u53c2\u7167\u3067\u304d\u308b<\/a> \u306e\u3067\u3001\u80cc\u666f\u3092 \u30dc\u30bf\u30f3\u306e\u753b\u50cf\u306b\u3057\u3001\u305d\u306e\u4e0a\u306b\u30dc\u30bf\u30f3\u3092\u4e09\u3064\u306a\u3089\u3079\u3066\u3001\u5de6\u7aef\u306e\u30dc\u30bf\u30f3\u306b\u306f\u30a2\u30d7\u30ea\u30a2\u30a4\u30b3\u30f3\u3001\u771f\u3093\u4e2d\u306e\u30dc\u30bf\u30f3\u306b\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u753b\u50cf(\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306b\u306f\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u304c\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001\u3042\u304f\u307e\u3067\u30a4\u30e1\u30fc\u30b8\u306e\u307f)\u3001\u53f3\u7aef\u306e\u30dc\u30bf\u30f3\u306b\u306f\u3001\u97f3\u58f0\u691c\u7d22\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3057\u3066\u307f\u305f\u3002<\/p>\n<p>\u6700\u521d\u306b\u6bd4\u3079\u305f\u3089\u3001\u30ec\u30a4\u30a2\u30a6\u30c8\u30a8\u30c7\u30a3\u30bf\u3082\u304b\u306a\u308a\u6d17\u7df4\u3055\u308c\u3066\u4f7f\u3044\u6613\u304f\u306a\u3063\u305f\u306a\u3041\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_12E3A\/android_widget02.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"android_widget02\" border=\"0\" alt=\"android_widget02\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_12E3A\/android_widget02_thumb.jpg\" width=\"394\" height=\"199\" \/><\/a><\/p>\n<p>XML \u306f\u3053\u3093\u306a\u611f\u3058<\/p>\n<pre class=\"prettyprint linenums\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;FrameLayout 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; android:paddingLeft=&quot;6dip&quot; android:paddingRight=&quot;6dip&quot; android:paddingTop=&quot;12dip&quot;&gt;\r\n\r\n    &lt;LinearLayout\r\n        android:layout_width=&quot;match_parent&quot;\r\n        android:layout_height=&quot;wrap_content&quot;\r\n        android:addStatesFromChildren=&quot;true&quot;\r\n        android:background=&quot;@android:drawable\/btn_default&quot; android:paddingTop=&quot;8dip&quot; android:paddingBottom=&quot;12dip&quot; android:paddingLeft=&quot;6dip&quot; android:paddingRight=&quot;6dip&quot;&gt;\r\n\r\n        &lt;ImageButton\r\n            android:id=&quot;@+id\/btn_launch&quot;\r\n            android:layout_width=&quot;wrap_content&quot;\r\n            android:layout_height=&quot;wrap_content&quot;\r\n            android:background=&quot;@drawable\/icon&quot; android:layout_gravity=&quot;center_vertical&quot;\/&gt;\r\n\r\n        &lt;ImageButton\r\n            android:id=&quot;@+id\/btn_dummy_text&quot;\r\n            android:layout_width=&quot;wrap_content&quot;\r\n            android:layout_height=&quot;match_parent&quot;\r\n            android:layout_weight=&quot;0.46&quot;\r\n            android:background=&quot;@android:drawable\/editbox_background_normal&quot;\r\n            android:minWidth=&quot;100dip&quot;\r\n            android:layout_gravity=&quot;center_vertical&quot;\/&gt;\r\n\r\n        &lt;ImageButton\r\n            android:id=&quot;@+id\/btn_speak&quot;\r\n            android:layout_width=&quot;wrap_content&quot;\r\n            android:layout_height=&quot;wrap_content&quot;\r\n            android:clickable=&quot;true&quot;\r\n            android:src=&quot;@android:drawable\/ic_btn_speak_now&quot; \/&gt;\r\n\r\n    &lt;\/LinearLayout&gt;\r\n\r\n&lt;\/FrameLayout&gt;<\/pre>\n<p>&#160;<\/p>\n<p>UI\u5468\u308a\u3082\u7d50\u69cb\u308f\u304b\u308a\u306b\u304f\u3044\u306e\u3067\u3001\u3053\u306e\u8fba\u306e\u672c\u3067\u3082\u304b\u3063\u3066\u52c9\u5f37\u3057\u3088\u3046\u304b\u306a\u3002<\/p>\n<p><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4822284476\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u4f5c\u308a\u65b9\u3092\u5c11\u3057\u8abf\u3079\u3066\u3001\u306a\u306b\u304b\u3064\u304f\u308d\u3046\u304b\u3068\u601d\u3063\u305f\u306e\u3060\u3051\u3069\u3001\u3044\u308d\u3044\u308d\u5236\u7d04\u304c\u591a\u304f\u3066(\u307e\u3041\u5e38\u6642\u30db\u30fc\u30e0\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3060\u304b\u3089\u5f53\u305f\u308a\u524d\u3068\u3044\u3048\u3070\u5f53\u305f\u308a\u524d\u3060\u3051\u3069)\u9762\u5012\u3002\u305f\u3060\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3001\u30e9\u30f3\u30c1\u30e3\u30fc\u304f\u3089\u3044\u3064\u304f\u3063\u3066\u7d44\u307f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[39],"tags":[],"class_list":["post-331","post","type-post","status-publish","format-standard","hentry","category-android"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=331"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/331\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}