您好,我正在开发一个处理产品的应用程序,我想使用 Android 助手改善用户体验。
我阅读了 Google 的文档并首先尝试使用以下代码:
@Override
public void onProvideAssistContent(AssistContent assistContent) {
super.onProvideAssistContent(assistContent);
String structuredJson = new JSONObject()
.put("@type", "MusicRecording")
.put("@id", "https://example.com/music/recording")
.put("name", "Album Title")
.toString();
assistContent.setStructuredData(structuredJson);
}
该代码被调用,但没有添加到 Google 助手抓取当前 View 的正常体验中。 我还尝试使用产品架构 ( schema.org ) (使用@product、@brand、@review ...),因为我认为问题是 json 对象在谷歌搜索中没有给出任何结果。 但是这个新的 json 什么也没有出现。
当我认为问题在于 json 在 Google 搜索中没有定论或者我忘记做更多事情时,我错了吗?
谢谢
最佳答案
关于 Google Assistant,因为它是一个 Assistant,所以它会在向用户建议结果之前做更多的计算。这意味着您的分享内容将成为 Google Assistant 学习的数据,Google Assistant 会用它做一些只有 Google 知道的事情,这不是一个像 if else
条件这样的清晰概念。另外,您可以关注 this 上的评论,
我认为这会有所帮助。
关于android - 向 Android Assistant 添加内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40131372/