New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Assistant App Actions for AntennaPod #4417
Google Assistant App Actions for AntennaPod #4417
Conversation
… comments and specified entity set in actions.xml.
* Implemented in-app search with Google Assistant * Updated a comment to split long sentences
* Implemented in-app search with Google Assistant * Updated a comment to split long sentences * Change urls to match the original package name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for working on this.
I added a few comments below. Additionally, please have a look at the integration tests on CircleCI. They currently fail because of some minor code style issues :)
|
||
feature = feature.toLowerCase(); | ||
switch (feature) { | ||
case "downloads": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty similar to the switch
in loadFragment
. Could that one be re-used instead of creating another switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature names (and therefore, the parameters used in a potential user query in the Assistant) don’t exactly match the Strings in the loadFragment switch so it’s not possible to simply re-use it. One solution would be to add an additional method to convert the strings first, which would then get rid of the second switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same as the identifier specified in actions.xml
(entity identifier="DOWNLOADS"
)? If so, why do you use lower case here and upper case in actions.xml
?
app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
Outdated
Show resolved
Hide resolved
Nice. Without knowing anything about development: Does this also introduce pause & resume commands mentioned in the feature request? |
This pull request uses Google Assistant App Actions and introduces the “open app feature” and “get thing” (in-app search) functionality. There exist other frameworks that could be used to introduce commands mentioned in the feature request (https://developer.android.com/guide/topics/media-apps/interacting-with-assistant). |
Thanks :) If i interpret that answer correctly (again, I'm not a developer), pausing/rewinding/resuming isn't possible yet with this PR. If that's the case, I don't think it 'closes' #3806, which specifically requests this:
Not saying support for this has to be added now, but I'd remove the 'close' command from the description :) |
I think we already do the things necessary to support play/pause. At least the MediaSession handling in https://developer.android.com/guide/topics/media-apps/interacting-with-assistant is implemented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still trying to setup the test tool (this needs more setup than I expected) but in the meantime, I have 2 more comments :)
|
||
feature = feature.toLowerCase(); | ||
switch (feature) { | ||
case "downloads": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same as the identifier specified in actions.xml
(entity identifier="DOWNLOADS"
)? If so, why do you use lower case here and upper case in actions.xml
?
Hi @ByteHamster @mgborowiec |
I finally managed to set this up on my device. Still not sure if the localization works. When I select another language than English it does not seem to recognize the identifiers and just sends the entered text to AntennaPod. Also, I am unable to actually use the voice feature like in the demo videos - it only works from the actions test tool. There is not a lot of example code available, unfortunately, and there seem to be not many open-source projects that use this. I just found some conversations about early versions of the PR but I did not find solutions there either. Maybe we could just push this to Google in the next update to test more easily but tell nobody that it is included. @keunes @tonytamsf Do you think the Google Assistant query |
@ByteHamster my initial reaction is to search for new podcasts, but after playing with the app with queue search, episode search in a feed, I think the voice search would be a good feature to search for what is already on my phone. This would make finding something much simpler. I realize I don't use the search feature because it is often hidden. I just found today that there is a search for queue :) Once we can search locally, then via the assistant, we can layer the search for new podcasts, through verbal interaction later. I think Google has a iterative search feature.. when you don't find what you are looking for. Update: I have been thinking of what the user would expect the default search for a podcast app, and I think they expect to search for a new podcast that does not exist yet. Use case 1: They heard about a badminton podcast, so they want to search for and subscribe to 'badminton' on AntennaPod. I think most AntennaPod users play episode from the queue, vs searching for an episode and playing. |
Sounds like a good idea
I would say search within what's already in the app. I reckon that adding a new podcast is more exceptional than playing existing content. Since many users don't use the queue, I imagine they look for specific content to listen to depending on the mood/interest. I don't know if it's possible, but I would reckon that adding a new podcast deserves its own command, like |
Actually, that one just searches everywhere. Basically every screen has a search feature and only the podcast-specific ones limit the items searched.
I don't know enough about Google Assistant and I don't use it personally. So this would have to be implemented by someone else.
Not sure if this is true. Sometimes I wish we had at least a tiny bit of analytics.
I will set it to app-local search but to cover both use-cases we could display a button that opens "add podcast" search when there are no results. |
Thanks! |
So no communication about this yet, right? Or we can test in the beta release? It's possible to test OK Google from your phone's assistant, right? |
It should be available in the next beta release and can be tested with "Ok Google" (as soon as it is approved by Google, for which we are also dependent on mfietz. I already asked him to apply for Assistant approval).
Yes, please don't post it on Twitter or in the release notes. I want to see if it works before we make it public. |
This pull request has been mentioned on AntennaPod Forum. There might be relevant details there: https://forum.antennapod.org/t/voice-command-to-resume-latest-podcast/3997/2 |
This pull request adds support for Google Assistant App Actions in AntennaPod. Demo videos available here and here.
App Actions Overview
App Actions let developers integrate their mobile applications with Google Assistant to enable tasks in the app directly from the Assistant. App Actions are supported on Android 5 (API level 21) and higher. Further documentation available here.
Implemented Features
This pull request implements the “Open app feature” built-in intent to enable users to navigate to the most relevant features of AntennaPod, like Downloads, Subscriptions, Playback History, Queue and Episodes directly from the Assistant with queries like “Open Downloads on AntennaPod” or “Show me History on AntennaPod”.
It also implements the “Get thing” built-in intent to enable users to use the in-app search of AntennaPod directly from the Google Assistant with queries like “Search for BBC on AntennaPod”.
Testing
It can be tested with the App Actions test tool plugin in Android Studio. App Actions can only be tested with a physical device.
Deployment
There are further steps required to be taken by the maintainers for deployment, including uploading the app (containing actions.xml) to the Google Play console for publishing as well as filling out a deployment request form (sample answers below). Guidelines for deployment can be found here and here.
Suggested answers for the deployment form:
Summary: Navigate to the popular features and perform in-app search from Google Assistant.
Description: Examples of supported queries include “Open Downloads on AntennaPod”, “Show me History on AntennaPod”, “Search for BBC on AntennaPod”.
This project was a part of Google STEP internship.
Closes #3806