Android Video Pushed To Internet TV - android

I've got an application with Exoplayer. Works perfectly.
A request came to implement the "Cast to TV" (like the Apple TV Icon you get at the bottom when an Apple TV is present in the same network)
I've been trying to read up on this for Android, though seem to get lost be different information by different contradictions.
Some talk about a sender and receiver app, but i'm pretty sure this would not be needed as I have seen other apps where i can just push to the tv without having to install other software on the tv or whatever. (I understand that these TV's must comply to some certain standard)
Surely there is a way to:
Put a cast button at the top
Press it and show a selection screen of devices available
Then tell the player to "cast to tv"
(simply said of course)
Does anyone know of clear information and/or sample?
Please don't link to the Android pages, because that's one of the reasons I got lost in this matter.
https://developer.android.com/guide/topics/media/mediarouter.html
has no mention of needing another app.
What is allShare? Only for samsung or is there a universal standard?
Thank you to the person who will take the time to explain and provide some insight to where to start.

Related

How to connect and send data between android devices java

First off - YES I KNOW that there are an incredible amount of "tutorials" on the internet as well as SO questions on the topic that this question is on as well. PLEASE understand.
I have an app, and am trying to add functionality to transfer data between two Android devices. The data is small, merely xy coordinates for a button-clicking game to make it multiplayer. I decided that Bluetooth is my best bet. HOWEVER, after spending about 3 hours reading the official docs, I am still stuck. All I need is to: 1. Connect to a chosen device 2. Send the data. Its mostly about "Bluetooth Servers" and stuff, but I need a quick connection, and the code to send the data. Everything I've seen requires a HUGE amount of code, and doesn't really solve my problem. If the amount of code is required, is there a library that can help me? NOTE: I have already seen these, this, and this. Generally, the code provided doesn't work, is too cluttered/unreadable, outdated, or not easily implementable in my app without a major re-config pain. I'm looking for a solution that is Up To Date and Working.
(I can also be convinced to use WiFi if thats a better path to go down :\ ).
I also need the code to be compatible between Android devices down to API 21.
Scenario:
User_1 opens game and clicks "Multiplayer Mode". Selects "Start as Host". Now a game is running, but not started.
User_2 opens game and clicks "Multiplayer Mode". Selects "Join Device" In the background, the app is connecting the devices together.
A default Android Dialog appears, and they select RANDOM_GAME_NAME device, and clicks "Join".
User_1 is informed of them joining the game.
Game starts. Both players have a "board" where they try to tap buttons. User_1 taps button_1. Game sends signal to User_2 device that button_1 has been tapped and is now untappable. And vice versa until all the buttons are tapped.
Only two players can play at a time.

How do Android TV box software developers ensure best compatibility from third party apps for their (gyroscopic) remote controls?

To explain my question, a bit of info about my test setup might help. I have a Moto Z, with a Moto Mod projector (my spoilt son's christmas present). I've now added a gyroscopic probox2 remote/gamepad, so he can theoretically use his phone while projecting, for films/games, without tapping the phone (which is behind him).
I've connected it and it works to an extent. It works in the core Android UI (home screen, app launcher, settings etc). However it doesn't work at all in most APPs. It works in Amazon Prime, for example, but not in Netflix.
I was expecting it to work pretty much seamlessly, as it would on Android TV boxes, even though I'm connecting it to a phone.
I've noticed it seems to identify itself to Android as a keyboard, rather than a gamepad, which makes sense since the gyroscopic "air mouse" functionality wouldn't necessarily make sense on a gamepad. The gboard popup disappears when the remote is connected, even though the remote itself doesn't have an actual keyboard. The remote allows you to switch between a sort of gamepad mode and a mouse mode, although in both cases identified as a keyboard.
Because it doesn't work out of the box in Android, and I think somebody would have noticed on an Android TV if it didn't work with Netflix, then I'm assuming Android TV developers do something to force compatibility from APPs that aren't allowing input from a "keyboard".
Possibly a service that detects "keyboard" presses and simultaneously triggers a "gamepad" press?
That's how I would probably approach it, and I assume that's how the non-root "button remapper" type APPs approach it, because they can't interfere with the actual button mapping file... but it might not be the best/easiest way?
Any ideas?
Having looked into this further I think I understand.
APPs for Android TV are maintained separately from their mobile counterparts (https://www.apkmirror.com/apk/netflix-inc/netflix-android-tv/netflix-android-tv-3-3-2-build-1530-release/netflix-android-tv-3-3-2-build-1530-android-apk-download/) and it's not possible to side-load them without getting hacky.
So that's basically the answer - the approach in the Android TV industry to ensure compatibility with keyboards, mice, and media remotes etc, is to create separate versions of apps for Android TV which support them. On mobile, presumably developers are mainly interested in ensure physical keyboards work in text input areas, rather than in all areas in unusual cases like mine.
Which doesn't help me at all.
The not so good ways of doing it... There's possibly an approach of creating a virtual gamepad, mapped to the key presses of the physical keyboard (i.e. remote). An example of an app which appears to do just this, requires root in order to do so https://play.google.com/store/apps/details?id=com.locnet.gamekeyboard2&hl=en_GB

Android App - Turn on "Screen Cast" from ChromeCast App

This is a tricky one and I am guessing it won't be answered as I am not sure its possible. I am working on an application that the customer would like screen cast on to a large TV, with effectively "one click" in a menu on an android device (to a ChromeCast).
Scenario is
ChromeCast in TV and on wifi (but not connected to android device).
Android application is run by user.
User hits "one click" button (which is more like two click), one to start cast device lookup, second selects device.
Mirroring occurs
That's pretty much it. Its the same feature as the ChromeCast App "Screen Cast" functionality...to be honest we just want to turn this on from our app, instead of having to load the ChromeCast App.
Thanks.
There is currently no API to turn mirroring on from within an app. Note that on devices such as N5, the mirroring option is also offered from the notification shade so no need to bring up the chromecast app.
I have the same problem. The only way I have been able to acheive this is by starting the chromecast app and starting screen mirroring from there, and have my app implement a Presentation class. Even though I have been able to fully implement the ChromeCast UIButton, it doesn't work for starting screen mirroring from within the app. Probably an undocumented API or something they might add in the future, but currently I have found no way of doing it only in-app.
-edit-
Just thought I'd mention it, but a while back (after I/O 15) Google updated the available ChromeCast API's. Using a CastPresentation and the latest callbacks, it's possible to do this.

Is Android Text to Speech Reliable?

I'm a fairly new Android developer working on an app that I would like to have speak text that the app supplies. I have found several examples on using the Text to Speech feature on Android phones, such as this one)
and I've been able to get them to work much of the time, but they don't consistently work without problems on the Eclipse Emulator or the HTC phone I use to test. Problems include the speech working sometimes and sometimes not, or the app causing the phone to go to google play to download "SpeechSynthesis Data Installer" even though the phone has already demonstrated the ability to do text to speech and even though the store says that the item is already installed on the phone. I won't go into all the examples of issues but there are several more that I have come across in a few hours.
My question is has anyone put the Text to Speech feature in an app put in the marketplace or on multiple phones and found it to be relatively reliable, simple and straightforward, or is it an unreliable and inconsistent feature no matter how well it is implemented? Thanks.

Is it possible to have a second screen device launch an application on Google TV?

I've been reading the AnyMot protocol and the fling is mentioned wherein a second screen app can launch the YouTube app. Could a tablet application launch say the Flixter, Pandora or the Goolge Music app without it being a remote control emulator. If so would the AnyMot protocol be what's used?
Thanks
Anymote is a very much adequate for that. If, you want to do an app like "Able Remote", you'll need to put a small app on the TV which will tell you what apps are present. But for what your asking, it's doable w/ just Anymote.

Categories

Resources