14. ANCSって何?
Apple Notification Center Service (ANCS)
ANCSの目的は、BLEを通してiOSと接続されたアクセサリに、iOS
で発生する様々なNotificationを通知する仕組み
ANCSのデザイン3原則
- Simplicity(簡潔的)
- Efficiency(効率的)
- Scalability(スケーラビリティ)
15. Android Wearって何?
Small, powerful devices, worn on the body. Useful information when you
need it most. Intelligent answers to spoken questions. Tools to help reach
fitness goals. Your key to a multiscreen world.
- 体に装着した、小さくパワフルなデバイス群。
- あなたがより情報を必要とする時の便利な情報。
- 音声での質問にこたえるインテリジェントな応答。
- フィットネスの成功を手助けするツール。
- マルチスクリーンワールドへのキー。
33. Notification
Notification
2:30
Ddconnect
int notificationId = 001;
// Build intent for notification content
Intent viewIntent = new Intent(this, ViewEventActivity.class);
viewIntent.putExtra(EXTRA_EVENT_ID, eventId);
PendingIntent viewPendingIntent =
PendingIntent.getActivity(this, 0, viewIntent, 0);
!NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_event)
.setContentTitle(eventTitle)
.setContentText(eventLocation)
.setContentIntent(viewPendingIntent);
!// Get an instance of the NotificationManager service
NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(this);
!// Build the notification and issues it with notification manager.
notificationManager.notify(notificationId, notificationBuilder.build());
34. スマフォ操作
Notification
スマフォ操作
2:30
Ddconnect
// Build an intent for an action to view a map
Intent mapIntent = new Intent(Intent.ACTION_VIEW);
Uri geoUri = Uri.parse("geo:0,0?q=" + Uri.encode(location));
mapIntent.setData(geoUri);
PendingIntent mapPendingIntent =
PendingIntent.getActivity(this, 0, mapIntent, 0);
!NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_event)
.setContentTitle(eventTitle)
.setContentText(eventLocation)
.setContentIntent(viewPendingIntent)
.addAction(R.drawable.ic_map,
getString(R.string.map), mapPendingIntent);
!// Get an instance of the NotificationManager service
NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(this);
!// Build the notification and issues it with notification manager.
notificationManager.notify(notificationId, notificationBuilder.build());
35. 音声入力
Notification
スマフォ操作
音声入力
2:30
Ddconnect
// Create intent for reply action
Intent replyIntent = new Intent(this, ReplyActivity.class);
PendingIntent replyPendingIntent =
PendingIntent.getActivity(this, 0, replyIntent, 0);
!// Build the notification
NotificationCompat.Builder replyNotificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_new_message)
.setContentTitle("Message from Travis")
.setContentText("I love key lime pie!")
.setContentIntent(replyPendingIntent);
!// Create the remote input
RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
.setLabel(replyLabel)
.build();
!// Create wearable notification and add remote input
Notification replyNotification =
new WearableNotifications.Builder(replyNotificationBuilder)
.addRemoteInputForContentIntent(replyAction)
.build();
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="reply_choices">
<item>Yes</item>
<item>No</item>
<item>Maybe</item>
</string-array>
</resources>