Android - What determines which devices my phone can cast to? - android

I'm making an app that should be able to cast to TV's (Android TV & Chromecast). I have experience with Android Development, but I am still at the learning point regarding google cast.
In my environment there are few TV's (5+),and when I open Youtube app on my phone, and select Cast button, device discovers couple of TV's (2-3, or more), but when I start my app and select Cast button, my app discovers only 1 TV (same TV every time).
I want to ask if someone can explain what determines which devices I can cast to? i.e. why youtube app discovers 3+ devices to cast to, and my app discovers only 1 device. It's the same phone, same environment (same TV's), same network.
Thanks in advance for any clarification on this.
EDIT
Smartphone: Sony Xperia L1 (G3311).
Here is some of the TV's I'm using:
TV #1 : Philips 43PUS6412/12 --- Android TV (V.8)
TV #2 : Samsung 7 Series (50) - Model Code: UE50NU7402 --- Android TV
TV #3 : Samsung 5 Series (32) - Some older model --- Android TV BOX (MI BOX, model: MDZ-16-AB)
I checked, all devices are on the same WI-FI network.
And this is even more confusing for me:
On Youtube app I see all these TV's all the time, while
On Sony' default "Album" app, as well as in the app I made, and google cast sample app I downloaded to phone also - at first I saw ONLY "MiBox", none else.
After some time, when I tried couple of times again and again, all apps mentioned above have discovered "Philips TV", but now they didn't discover "MiBox",
For couple of tries, apps managed to discover both "Philips TV" and "MiBox" at the same time,
Then, again these apps discovered only "MiBox", without "Philips",
And now again, apps see only "Philips", without "MiBox"...
I don't know what is happening, what is causing this behaviour, so please I would really appreciate any help.

By themselves Samsung TVs run Tizen. In the Tizen App Store there is a YouTube client which I presume the YouTube Android phone app is connecting to (you may have paired them at some point, i.e. same login credentials).
While a TV set like Philips is running Android TV, from my understanding that the running the Chromecast receiver app isn't consistent. I searched on the model and didn't see that particular model has the "Works with Google Assistant" branding or any branding that it supports "Google Cast"/"Google Chromecast".
For example Sony has a page on updating the "Built in Chromecast" app:
https://www.sony.com/electronics/support/articles/00114152
I would use that page as a guide and see if the Philips TV set has a Chromecast receiver app and is updated. My guess is that even if it does, it doesn't run the background correctly (and would have gotten the appropriate branding logos).
A similar situation exists for any Android TV box like MiBox, the Chromecast receiver app isn't consistent.
See this Reddit thread about the subject:
https://www.reddit.com/r/AndroidTV/comments/74klxy/casting_to_mi_box/
If you are doing development work. I would advise at least one Google Chromecast device as a baseline since Google controls the software updates and built the hardware.

Related

Settings to set a Screen Saver are not showing on Google Chromecast

I’m developing a custom screen saver for Android TV devices.
On Google Chromecast, to set a screen saver, there is no possibility to do it in system settings, but it is possible to open it with intent.
val intent = Intent(Intent.ACTION_MAIN).setClassName(
"com.android.tv.settings",
"com.android.tv.settings.device.display.daydream.DaydreamActivity"
)
startActivity(intent)
After OS Update (OS version 10, 1 May 2022), this intent is presented but doing nothing.
Start activity is called, but nothing happens.
I also checked similar apps, like PhotoGalery, and Dreamy, and there is the same problem.
Is there any other way to handle this?
Chromecast with Google TV (HD or 4K)
As you've discovered, the July 2022 update for the Chromecast with Google TV removed the ability/intent to open the Screensaver settings screen which allowed a user to...
Select Ambient or any other installed 3rd party screensaver
Change the timeout before the screensaver starts
We don't know the reason for its removal but this update did free up more space on the device - and as the Android OS is smaller, maybe they thought it wasn't needed and removed it?
Of course, it's possible a future update will restore the feature but who knows.
Solutions?
Currently, there are no good or easy solutions for regular or non-technical users.
I have a screensaver in Play Store and I advise users to check my website for instructions on how to...
Install the Android SDK Tools
Run two ADB commands to set my screensaver as default and change the timeout value if needed
But that's hardly a great experience.
Other Android TV devices
It's also important to know that a Chromecast with Google TV is different to other Android TVs, it's been customised a bit more - compare their Settings screens, for example.
Both the latest 2022 Sony TVs with Android 10 and Nvidia Shield running Android 11 still have the ability to choose 3rd party screensavers.
By contrast, the Amazon Fire TV devices had this option removed from the very beginning.

Android app for control Smart TV (All brands)

I have developed an android application that allows to control the Smart TV. It is based on Connect SDK and Conenct SDK Sampler, which allows the phone to pair with the TV and control it with the usual functions such as volume down or navigation on the smart TV interface using the up/down/left/right/ok buttons.
The problem is that according to my statistics, about half of the users have some non-working buttons, I sent a failure event in case the user presses the button, and the Connect SDK responds that the function is not supported, success and failure events are related as 50 at 50. I add screenshots with failure statistics: Button names and number of failures and TV models and the number of failures
I want to reduce the number of non-working buttons for users to a minimum, I will be grateful for any help. I tried to look at several analog applications published on Google Play and saw that some applications, in addition to the Connect SDK, use separate classes for Samsung and other brands, but I did not understand where these classes came from (which library or api?). I am unlikely to be able to develop extensions for each brand, like Tizen or WebOS. I only have Android TV which by the way also has more non-working buttons than working ones.

Screen Mirror with remote display app for samsung TV

I want to develop an app on android that uses screen mirroring with Samsung TV. I'm looking to use my android app screen as a remote(say a game controller) & TV screen to run the actual game. My initial approach was learning google cast but it needs a chromecast dongle which I don't want to use for this project. I want to use Samsung Smart TV's Screen Mirroring feature to do so. After some googling, I figured out that samsung uses Allshare Framework API for screen mirroring/cast but I'm not completely sure on this. I'm currently struggling to find a proper documentation for screen mirroring. If someone can point to the correct documentation link then that'd be awesome. Also, please correct me if I'm wrong with the assumption that this can be achieved using Allshare API only.
It seems Samsung have came out with this new SDK - Samsung Multiscreen SDK( or maybe I've found it now :)). This link should cover most of the questions I've asked above. Also, if you are Unity user, Samsung has their own version of Unity which comes intalled with Samsung Multiscreen Game SDK. But you need to send a partnership request to samsung in order to use this version of Unity. Apart from these two, you can also use Connect SDK which is independent of any technology, i.e. it covers almost every other technology used for Cast. For exmple, if you have a Samsung Smart TV at your home & a Roku connection. With Samsung SDK you can only discover Smart TV but not Roku stick. Whereas, with Connect SDK you can discover Samsung Tv as well as Roku & any other Cast device which is available in your network.

Chromecast API doesn't accuratelly detect when device is connected/disconnected

I have a problem when i am trying to use my chromecast device.
Currently I have an app for Android , one for iOS
and these 2 apps from github.
https://github.com/googlecast/MediaRouter-Cast-Button-android
https://github.com/googlecast/CastVideos-android
All of them have a common problem. They sometimes cannot accuratelly tell if a chromecast device is connected or disconnected.Taking around a minute before they find it out themselfs.While an application like Youtube , discovers if it is connected or not, instantly.
EDIT #1 START:
While using the application "Cast Videos" for android from GitHub the following thing happens.
I hold the android device in my hand (Samsung Galaxy S2).
I know chromecast is on because I can see it on my monitor.
I start the application "Cast Videos".
The Chromecast icon does not appear, even if the chromecast device is on.
EDIT #1 END;
I have tried using the app_id from my own receiver application , and the default receiver app_id.
I have found a way to trick them into finding the device. By launching the youtube application on an Android or iOS device , connect to the chromecast device , then disconnect.
When I return to on off the apps I have mentioned at the start of the question , they can detect it now , and connect to it.
The two applications from github are not modified , and use the most up to date support libraries (appcompat, mediarouter, CCL).
The applications are now being currently build on a Mac (if that matters). I don't think it will be of any difference if they were built on Windows or something else.
EDIT #2:
I am starting to suspect that actually the wifi router in the building im programming may cause these connection problems. Because when I send the app to other people they don't have the same problem.
EDIT #3:
Good news :D.
The latest update on the castcompanionlibrary made chromecast detection much more reliable and the sample now detects preciselly every time if it is connected or not.

Emulate a 'Chromecast' or allow receiver capability

I'm posting my question here because I can't find any suitable answer to it.
I have an Android device that acts as a 'Google TV Board/Box' (linked to TV, network connection, Android OS, ...)
And I have multiple Android devices (smartphones and tablets).
I would like to be able to use the Chromecast application to cast the screen of a tablet (for example) to the 'Google TV board/box'.
I don't want to use an external Chromecast device as I have all the power needed directly from the board/box.
I heard about the Cheapcast application which emulate a chromecast device but I tested it and since Google change its politics regarding security certificates, I'm not able to make it works.
So my question is :
Is there any way to emulate a chromecast on an Android device
OR
Is there any way to make this possible wihtout emulating on an Android OS ? Maybe some king of API ?
Thank you for your time!
As you noticed, the official Cast SDKs on the sender sides validate that the Cast device they are talking to is a genuine device, hence you cannot emulate a Cast device if your sender is an using official Cast SDK.

Categories

Resources