androidtemplatesandroid-auto

How do I implement a template for Android Auto that enables search by letter while driving?


I want to make an app for Android Auto and the user should be able to search through a long list of items by name during the drive. Obviously, the keyboard is blocked while driving and I am aware of that, but I've seen a functionality in the native phone app and also in Spotify that offers the user to select the first letter of what he wants to see to seize down the results. (That would already greatly reduce results, as it would split them by 28. I know that there is no possibility to search with more than one letter and I also don't need that, one is just enough, would already be great). Here are screenshots of what it looks like in Spotify: enter image description here enter image description here

I tried it with SearchTemplate and Gridtemplate of the Android for Cars App Library (as Spotifys thing looks like a Gridtemplate) on CarApiLvl 5 and added a huge list (100 items) that made the template display a scrollbar. I also added a major case letter of the alphabet to every item in front, hoping that the system may look for something like that. However, the functionality did not show up automatically, so I suppose it's either not built in or it requires some specific meta-data/callback to work. Sadly, I cannot find any official documentation on it. Does any of you know, how to get use of this functionality? Is there a sort functionality I need to implement and expose or anything like that? I am working with the Android for Cars App Library, so I can't really do any custom stuff.


Solution

  • There isn't an equivalent to this for Car App Library apps at this point. Though media apps like Spotify may look similar to apps built using the Car App Library, they aren't actually built with it. If you'd like, you can make a feature request for the Car App Library and provide details about your use case.