4

我一直在阅读有关可穿戴设备 sdk 以及它现在和将来可以做什么的信息。

我的问题是用户是否能够按下手表上的某些东西来提醒我的应用程序注意智能手机上的某些东西,或者用户是否必须对着手表说话或接收来自我的应用程序的通知才能与我的智能手机应用程序交互?

谢谢

4

1 回答 1

2

你将能够有“行动”,所以是的。例如,Gmail 应用程序的其中一项操作是您可以“回复”、“全部回复”等,这些操作会在您的手机上弹出。

根据 Android Wear 开发者网站,以下代码片段将在您的手持设备上启动一个意图: // 为查看地图的操作构建一个意图 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);

请参阅:http: //developer.android.com/wear/notifications/creating.html了解更多信息。请参阅名为“添加操作按钮”的部分

于 2014-03-21T20:35:07.400 回答