Create custom google now cards

元气小坏坏 提交于 2019-12-03 00:37:09

问题


Google provides a variety of 'cards' for Google Now (http://www.google.com/landing/now/). Is it possible to create your own cards? The system looks pretty modular, but I haven't found any documentation or instructions to do so. (I believe you need to supply the content of the card, and some way of signaling when it is supposed to be shown. There is probably just some interface that you have to implement.)

If there is no documented solution, a hackish/undocumented way would be ok, too. I'm mostly curious how it works.

Edit: Specifically, does somebody have knowledge about the internals of Google Now, e.g. by decompiling the .apk? What I've seen suggests it is pretty modular, and it should be fairly easy to drop another class into the .apk, or to maybe inject code using Cydia Substrate. I know that there is (as of Nov. 2013) no official way to add new cards.


回答1:


Actually Google announced last week that developers can now develop custom Google Now cards:

http://www.google.com/landing/now/integrations.html

However, a developer guide seems not available yet.

Edit: On the end of the page they point out that:

We'll let you know when we are able to onboard more partners




回答2:


There is currently no way to do that. Google makes its own cards and custom application cannot register any cards. But I hope it will be possible in future.




回答3:


There is a work-around that will soon allow you to place cards in Google Now's stream at a particular time or a particular location: Use Google Keep (https://drive.google.com/keep/)

You can create a new card at Google Keep with a time based or location based reminder, depending on which the relevant card will show up in Google Now.

Since Google Keep is now in Drive, the API is expected to be available soon (keep a lookout for it at http://discovery-check.appspot.com/ )




回答4:


There is not way to do this by your own at the moment. If you really want to do it you can fill in this form: https://services.google.com/fb/forms/nowintegrations/. You can ask Google if they want to cooperate to create a Google Now card.




回答5:


Note quite an answer, as it is still not possible to create Google Now cards, but you can now hook into the Google Now search function (basically Android's Siri) and provide custom search results. For example you can say "show me the lyrics to..." and it opens a lyrics app.

Here is a link to the project which is based on the Xposed framework.

Just guessing from my impression of the Google Search apk (which includes all the Google Now functionality and even the home screen on KitKat), it should be possible to use a similar technique to inject cards into the app - however since the app is huge and very complicated, it will be a lot of work. I'd keep my eyes open on the xda-developers forums, wouldn't be surprized if someone there solves this in the future.




回答6:


It appears that there is developer documentation on how to push google now info via email, eg. flight details, restaurant reservations etc.

https://developers.google.com/schemas/now/cards

I have yet to dig into this, but may update this answer if I discover anything significant.



来源:https://stackoverflow.com/questions/13220923/create-custom-google-now-cards

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!