I am trying to create a custom UI screen for the "player picker UI" that comes with google play services for turn based multiplayer. The default one can be seen here:
https://developers.google.com/games/services/android/realtimeMultiplayer?hl=fr-CH#invite_players_option
That page(which is real time I know) mentions how to use the default UI and that a custom UI can be used, but does not mention the actual methods to customize the look. I'm not a fan of the huge icons, and would rather a simple list. I have been trying to research this out for a few days, and have found nothing.
I am looking for any help on which methods I need to call in order to customize. Is it done in the onActivityResult method? Has anyone had any luck doing something similar?
Thank you
It means that you can create your own UI from scratch, and interact with Google Play Services using the provided API. They do not provide a way to customize the look of the player selection UI that google provides.
Related
I would like to display some information from a Firebase database on the screen of my Nest Hub.
Let's say I want to scroll through 10 items and display their details every 5s.
If I am not wrong, I am tied to only 2 possibilities
Assistant Actions
I read the doc and made some POC, but it seems overcompliacted, I have to create a project, that I cannot deploy publicly, create a Firebase function to create the webhook, and I don't really have complex Assistant commands to send, so it seems overcomplicated at first sight.
=> Maybe I missed a way to make that simple?
Cast SDK
As an Android dev familiar with Java and now Kotlin, this seems easier, but as far as I understand, I can only cast Media to the Nest. Should I then create a layout with all my info, turn them to image files, and finally create a slideshow for the Nest Hub?
Thanks for any advise
Part of this answer depends on your use-case. Creating an Action via Actions Builder would give you a fair amount of flexibility over the interaction model, as it will support voice commands and you'd be able to trigger it directly from the device ("Talk to X").
Creating something via Cast may be easier, as you're just projecting content (a webview). While easier, you'd need to be able to start it from another device and can't control it with voice. Control can be done through the casting device.
Based on the use-case you've given, as a passive display, I would suggest going with the Cast SDK. You can look at implementing a custom web receiver to manage your web app.
How does google go about searching items in google play? I was trying to find out how to implement a search like that, but the closest thing I managed to find was this, but that creates another activity, unlike google play, which seems only to perform a fragment transition. The reason I'm asking this is that my app uses mostly fragments durring the app flow and the only way I could think of to perform this would be using custom searchview...
Is there any simple way to do this?
AutoCompleteTextView is your answer. If you are looking for the complete tutorial then go through this.
If you look at most Google Play Apps like
Google Play Magazine
:
Google Play Music
How do you call it? On a scale from 1 to 10 based on beginner programming level skill, how do you rate the difficulty of implementing them? Where are the best places to start?
It's called Navigation Drawer.
There is an example from the official documentation on how to implement them. In my experience, I would say it's easy to implement to a simple one. But as such in above picture, it's a little more tricker but I've seen some examples.
I'm using a MediaRouteButton to connect to a ChromeCast device. Once a user is connected they can click on the MediaRouteButton to disconnect, but I would like to place another specific disconnect button in the UI. I've been searching for a way to programmatically disconnect from the selected route, but I can't seem to find anything.
If you are using the MediaRouteHelper, you don't have access to the piece that you are looking for. You can extend MediaRouter and do all the discovery related stuff yourself and then you'll have access to what you want. That said, I strongly recommend not to provide a second mechanism for deselection of a route; we strongly urge developers to use the standard way that we have built. People may not yet be fully familiar with this relatively new approach to select a device and cast content to them but as more and more apps use that, it will become very familiar. Since popular Google apps also use that (e.g. YouTube or Play Movie or Play Music), then a lot of people will learn about that quickly.
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.
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.
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
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/ )
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.
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.
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.