我一直在阅读有关可穿戴设备sdk的信息,以及它现在和未来能做什么。
我的问题是,用户是否可以按下手表上的某些东西来提醒我的应用程序智能手机上的某些东西,或者用户是否必须对着手表说话或收到来自我的应用程序的通知才能与我的智能手机应用程序进行交互?
谢谢
发布于 2014-03-22 04:35:07
你将能够有“动作”,所以是的。例如,Gmail应用程序的一个动作是你可以在手机上弹出“回复”、“回复所有”等。
根据Android Wear开发人员网站,以下代码片段将在您的手持设备上启动意图: //为查看地图意图的操作构建意图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。请参阅“添加操作按钮”部分
https://stackoverflow.com/questions/22569000
复制相似问题