{"id":4292,"date":"2016-08-09T10:00:12","date_gmt":"2016-08-09T01:00:12","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=4292"},"modified":"2016-08-08T18:34:37","modified_gmt":"2016-08-08T09:34:37","slug":"%e6%96%b0%e4%ba%ba%e6%88%90%e9%95%b7%e8%a8%98%e9%8c%b27th","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/4292","title":{"rendered":"\u65b0\u4eba\u6210\u9577\u8a18\u93327th"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001poppy\u3067\u3059<\/p>\n<p>\u6642\u523b\u6307\u5b9a\u3067Android\u3078\u901a\u77e5\u3059\u308b\u6a5f\u80fd\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059<br \/>\n\u4eca\u307e\u3067Broadcast\u3084Service\u306b\u3064\u3044\u3066\u306f\u5168\u304f\u3067\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u4f5c\u6210\u3057\u3066\u307f\u308b\u3068\u5c11\u3057\u3067\u3059\u304c\u7406\u89e3\u3067\u304d\u307e\u3057\u305f<br \/>\nBroadcast\u3084Service\u306f\u4eca\u5f8c\u3082\u5fc5\u8981\u3068\u306a\u308b\u306e\u3067\u3001\u5f90\u3005\u306b\u3067\u3059\u304c\u7406\u89e3\u3092\u6df1\u3081\u3066\u3044\u304d\u305f\u3044\u3067\u3059<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-4361\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2016\/08\/device-2016-08-08-173411-169x300.png\" alt=\"device-2016-08-08-173411\" width=\"169\" height=\"300\" border=\"1\" srcset=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2016\/08\/device-2016-08-08-173411-169x300.png 169w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2016\/08\/device-2016-08-08-173411.png 1080w\" sizes=\"(max-width: 169px) 100vw, 169px\" \/><br \/>\n<!--more--><\/p>\n<h4>\u4f7f\u7528\u3057\u305f\u4e3b\u306a\u30af\u30e9\u30b9<\/h4>\n<p>\u6642\u523b\u6307\u5b9a\u3067\u901a\u77e5\u3059\u308b\u306b\u306f\u3001<br \/>\nPendingIntent<br \/>\nAlarmManager<br \/>\nNotification<br \/>\n\u3092\u4f7f\u7528\u3057\u307e\u3059<\/p>\n<h4>PendingIntent<\/h4>\n<p>PendingIntent\u306f\u6307\u5b9a\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u767a\u884c\u3059\u308bIntent<\/p>\n<p>\u6295\u3052\u308b\u5148\u306b\u3088\u3063\u3066\u30e1\u30bd\u30c3\u30c9\u304c\u7570\u306a\u308agetActivity\u3068getBroadcast\u3001getService\u304c\u3042\u308a\u307e\u3059\u304c\u3001<br \/>\n\u4eca\u56de\u306fgetBroadcast\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001Broadcast\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u306eonReceive\u3067\u53d7\u3051\u53d6\u308a\u307e\u3059<\/p>\n<p>PendingIntent\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u308b\u969b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3057\u305f<\/p>\n<pre style=\"border: dashed #000000 2px; padding-left: 5px;\"><code>Intent intent = new Intent(this, MyBroadcastReceiver.class);\r\nrequestCode = \u30e1\u30e2\u65e5\u4ed8 + \u30e1\u30e2ID;\r\nPendingIntent pIntent = \r\n\t\tPendingIntent.getBroadcast(this, int requestCode, \r\n\t\t\t\tintent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n<\/code><\/pre>\n<p>\u8907\u6570\u306e\u901a\u77e5\u3092\u767b\u9332\u3059\u308b\u5834\u5408\u306b\u306f\u3001requestCode\u306b\u540c\u3058\u6570\u5024\u3092\u4f7f\u7528\u3059\u308b\u3068\u4e0a\u66f8\u304d\u3055\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\uff01<br \/>\n\u4eca\u56de\u3067\u306f\u3001\u30e1\u30e2\u306e\u65e5\u4ed8\u3068\u65e5\u4ed8\u6bce\u306eID\u3067\u30e1\u30e2\u6bce\u306e\u30e6\u30cb\u30fc\u30af\u306arequestCode\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059<\/p>\n<h4>AlarmManager<\/h4>\n<p>AlarmManager\u306f\u6307\u5b9a\u3057\u305f\u6642\u9593\u3067\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u706b\u3055\u305b\u307e\u3059<br \/>\n\u30a4\u30d9\u30f3\u30c8\u767a\u706b\u6642\u306bPendingIntent\u3092\u6295\u3052\u307e\u3059<br \/>\n\u76ee\u899a\u307e\u3057\u3084\u4eca\u56de\u306e\u79c1\u304c\u4f5c\u6210\u3059\u308b\u30ab\u30ec\u30f3\u30c0\u30fc\u30a2\u30d7\u30ea\u306a\u3069\u3001\u6642\u523b\u3092\u6307\u5b9a\u3057\u3066\u901a\u77e5\u3059\u308b\u30a2\u30d7\u30ea\u306b\u306f\u5fc5\u9808\u306e\u30af\u30e9\u30b9\u3067\u3059\u306d\uff01<\/p>\n<p>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u751f\u6210\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u53d6\u5f97\u3057\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 2px; padding-left: 5px;\"><code>AlarmManager manager = (AlarmManager) getSystemService(ALARM_SERVICE);\r\n<\/code><\/pre>\n<p>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u751f\u6210\u306e\u6b21\u306b\u306f\u5b9f\u969b\u306b\u30a2\u30e9\u30fc\u30e0\u306e\u30bb\u30c3\u30c8\u3092\u3057\u3066\u3044\u304d\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 2px; padding-left: 5px;\"><code>manager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pIntent);\r\n<\/code><\/pre>\n<p>\u30a2\u30e9\u30fc\u30e0\u3092\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u306fset\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059<\/p>\n<p>\u3053\u308c\u3067\u6307\u5b9a\u6642\u523b\u306b\u306a\u308c\u3070onReceive\u306bPendingIntent\u304cBroadcast\u3055\u308c\u308b\u306e\u3067\u3001onReceive\u306e\u4e2d\u3067\u51e6\u7406\u3092\u3057\u3066\u3044\u304d\u307e\u3059<\/p>\n<h4>Notification<\/h4>\n<p>Notification\u306f\u901a\u77e5\u3092\u51fa\u3059\u305f\u3081\u306b\u4f7f\u7528\u3057\u307e\u3059<br \/>\n\u305d\u306e\u305f\u3081\u306b\u3001onReceive\u3067\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u3063\u3066\u304b\u3089\u901a\u77e5\u3092\u51fa\u3059\u3088\u3046\u306b\u3057\u307e\u3059<br \/>\n\u901a\u77e5\u3092\u30bf\u30c3\u30d7\u3057\u305f\u969b\u306b\u306f\u30a2\u30e9\u30fc\u30e0\u304c\u901a\u77e5\u3057\u305f\u30e1\u30e2\u306e\u8a73\u7d30\u753b\u9762\u3078\u3068\u9077\u79fb\u3059\u308b\u3088\u3046\u306bIntent\u3092\u8a2d\u5b9a\u3057\u307e\u3059<\/p>\n<p>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3084\u901a\u77e5\u306e\u8a73\u7d30\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3057\u305f<\/p>\n<pre style=\"border: dashed #000000 2px; padding-left: 5px;\"><code>Notification noti = new NotificationCompat.Builder(context)\r\n\t\t\t\t.setWhen(System.currentTimeMillis())\r\n\t\t\t\t.setTicker(\"\u4e88\u5b9a\u306e\u6642\u9593\u3067\u3059!\")\r\n\t\t\t\t.setContentTitle(\"\u901a\u77e5\")\r\n\t\t\t\t.setContentText(title)\r\n\t\t\t\t.setDefaults(Notification.DEFAULT_ALL)\r\n\t\t\t\t.setSmallIcon(R.drawable.normal)\r\n\t\t\t\t.setAutoCancel(true)\r\n\t\t\t\t.setContentIntent(sender)\r\n\t\t\t\t.build();\r\nNotificationManager manager =\r\n\t\t(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);\r\nmanager.notify(reqestID, noti);\r\n<\/code><\/pre>\n<p>Notification\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u751f\u6210\u6642\u306b\u8a2d\u5b9a\u307e\u3067\u3057\u3066\u3044\u307e\u3059<\/p>\n<p>NotificationManager\u3067\u5b9f\u969b\u306b\u901a\u77e5\u3092\u8868\u793a\u3057\u307e\u3059<\/p>\n<h4>\u7d42\u308f\u308a\u306b<\/h4>\n<p>Intent\u3068PendingIntent\u306e\u4f7f\u3044\u5206\u3051\u3067\u3059\u304c\u3001\u73fe\u6bb5\u968e\u3067\u306e\u7406\u89e3\u306f\u300c\u3084\u308a\u305f\u3044\u3053\u3068\u306b\u4f7f\u3046\u30e1\u30bd\u30c3\u30c9\u3067\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u65b9\u3092\u4f7f\u3048\u3070\u3088\u3044\u300d\u3067\u3059<br \/>\n\u4eca\u56de\u306f\u3001\u6307\u5b9a\u6642\u523b\u306e\u6307\u5b9a\u3067\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u706b\u3055\u305b\u308b\u305f\u3081\u306bAlartManager\u3092\u4f7f\u3044\u307e\u3057\u305f\u3088\u306d\uff1f<br \/>\nAlarmManager\u306e\u30a2\u30e9\u30fc\u30e0\u3092\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3059\u308b\u305f\u3081\u306eset\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bPendingIntent\u3092\u5fc5\u8981\u3068\u3057\u3066\u3044\u307e\u3059\u306e\u3067PendingIntent\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f<\/p>\n<pre style=\"border: dashed #000000 2px; padding-left: 5px;\"><code>set(int type, long triggerAtMillis, PendingIntent operation)\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u706b\u66dc\u65e5\u62c5\u5f53\uff1apoppy\u304b\u3089\u3067\u3057\u305f<\/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\/4292\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/4292\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"\u65b0\u4eba\u6210\u9577\u8a18\u93327th\" 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\/4292\" data-text=\"\u65b0\u4eba\u6210\u9577\u8a18\u93327th\" 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\/4292\" 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\/4292\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001poppy\u3067\u3059 \u6642\u523b\u6307\u5b9a\u3067Android\u3078\u901a\u77e5\u3059\u308b\u6a5f\u80fd\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059 \u4eca\u307e\u3067Broadcast\u3084Service\u306b\u3064\u3044\u3066\u306f\u5168\u304f\u3067\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u4f5c\u6210\u3057\u3066\u307f\u308b\u3068\u5c11\u3057\u3067\u3059\u304c\u7406\u89e3\u3067\u304d\u307e\u3057\u305f Broadcast\u3084Se [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/4292"}],"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=4292"}],"version-history":[{"count":17,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/4292\/revisions"}],"predecessor-version":[{"id":4432,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/4292\/revisions\/4432"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=4292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=4292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=4292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}