短信Android应用程序

短信Android应用程序,android,sms,wear-os,smart-device,Android,Sms,Wear Os,Smart Device,智能手表如何接收手机短信?我正在寻找一个类似的应用程序,我不知道从哪里开始。我想为我的平板电脑制作一个显示短信通知的应用程序 要创建发送到已连接的Android Wear设备的通知,您需要使用Support v4软件包中的NotificationCompat类。 可以找到如何执行此操作的详细文档 代码基本上分解为以下代码段(从文档中复制): 这会在手持设备以及连接的Android Wear设备上创建通知,甚至不会创建Wear应用程序。配对和传输过程由操作系统处理 总的来说,Android开发者的

智能手表如何接收手机短信?我正在寻找一个类似的应用程序,我不知道从哪里开始。我想为我的平板电脑制作一个显示短信通知的应用程序

要创建发送到已连接的Android Wear设备的通知,您需要使用Support v4软件包中的NotificationCompat类。 可以找到如何执行此操作的详细文档

代码基本上分解为以下代码段(从文档中复制):

这会在手持设备以及连接的Android Wear设备上创建通知,甚至不会创建Wear应用程序。配对和传输过程由操作系统处理


总的来说,Android开发者的培训部分总是一个开始研究的好地方。

我没有成功实现NotificationCompat.Builder的任何运气。你熟悉蓝牙模式吗?我一直在读关于MAP(消息访问配置文件)的书,它允许在设备之间交换消息。想知道我是否可以走这条路?能更详细地描述一下你的问题吗?这种方法的前提是,您已使用Android Wear应用程序将Smartwatch连接到手机。我没有在Android上使用任何低级蓝牙服务。如果您想传输比只发送通知更复杂的数据,您应该使用Google服务,以确保在多个设备上的兼容性,请参阅
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());