can't find chromecast device using Google's sample app - android

Using this code, https://github.com/googlecast/cast-android-sample, I build android chromecast sample sender application.
And I also modified the code to use my appID, and uploaded whitelisted URL (already registered to Google).
But I can't find the chromecast device from this sample app. I mean, onDeviceAvailable() is not getting called. And I don't see any suspicious error / log while i am running the app.
is there anything that i need to try to see why i can't find the chromecast device?
(BTW, youtube app in the same device can find the chromecast device)
another question, which may not be related to the main question.
registering the device to have app_id, and whitelisted url is not mandatory step to find the chromecast device from app. right? I guess that registration step is needed for media stream not for device discovery.
can anyone share working sampleapp code / receiver.html? (for me to make sure that i didn't make a mistake..)
Thanks!

Did you try the Tic-tac-toe Android sample too? These two apps are using different ways of displaying the list of ChromeCast devices to the user.
Both sample apps work just fine for me. I used the default reciever.html and only added my own app id.
Technically it is not necessary to register the device to discover it on the network. You can try this app to find all DIAL devices: https://github.com/entertailion/DIAL
However, the Google Cast API wraps the DIAL discovery and they might be enforcing the app id requirement.

Ok, I think i found the cause (with help of you guys, thank you), but that does not mean that i can solve this.
TicTacToe is working because it does not need my app id. it's using something generally working (like what youtube / netflix is using).
I tried "TicTacToe" as app id for cast-android-sample app, and now it can see the chromecast device.
I tried my app id to TicTacToe and it can't show the web page on the screen. (of course i modified my receiver page that is whitelisted)
From above 2 test results, i am confident that there is something wrong with my app id.
How to solve? should i reply to "nobody#google.com" who gave me the app id? or should i register my device again? (is this ok?) i am not sure.... can anyone tell?

Assuming that you've also changed the settings on the Chromecast to send the serial to Google, then you may just need to wait a few hours after doing so. I was having the same issue where my device wouldn't show up with the sample app, after waiting a few hours after changing that setting it showed up just fine.

Did you try rebooting your device by going into your Chromecast settings via the Chromecast Android app or the Chromecast app for your computer?
I spoke to the Chromecast support team because I was having the same issue, and the reboot got it working.
To make sure that your device is whitelisted, you should be able to access this page from chrome (from a computer on the same network as your chromecast device):
<IP address of chromecast>:9222
If you can access that page, then it should work!

Related

App to Cast videoconference (zoom, skype, telegram)

Lets imagine i want to build some app for videoconferences or videomeeting that is chromecast-compatible.
So i can use my android device to connect meeting, after that i just click something like "cast to device" and get audio and video on my TV.
Also i noticed that skype, zoom, discord and all apps like this has not bulid-in chromecast support. So maybe it is impossible?
I tried to find something about that but but found nothing useful. I found zoom sdk, and chromecasst sdk, but not seen what actually i shoud cast. As i understood chromecast can send only media-content to reciever, but zoom sdk not actually provide some media-like links for conversation(videoconference).
So i want to know what are my steps to build my own chromecast-compatible meeting app and what may i want to use to develop app like that?
Or maybe someone know how can i use Zoom sdk to achive what i want?
When a sender device connects to a Chromecast, it has a limited set of "commands" it can send to the device.
There is no immediate way to send data other than those messages from the sender to the device - there is a 'custom' message, but that too only includes stringified JSON
The way this would have to work is too set up a stream of the screen/app you want to display via Chromecast and send a LOAD message to the Chromecast which will connect back to the sender (or a third party server where the video can be streamed from) and play it.
I'm not too confident this is going to work as intended though - there will be a significant delay between the sender and the Chromecast, and since the Chromecast has no mic, you will also have to use the mic of the sender and deal with the acoustic feedback.

How to reconnect chromecast device when restart app in android

Hello every one i faced one problem regarding chromecast when i connect to chromecast device and remove app from background and after that again open app
but app disconnect to chromecast device can any idea to auto connect chromecast device to my app please suggest .
You can follow our documentation on this very subject, if yo want to do it yourself, or you can use Cast Companion Library that does it for you. In short, you need to persist a few pieces of data (such as session id, route id) and use them to perform reconnection.

Cast api cast button not visible

I am new to Android development and I am trying to use the Android's Cast API. To start I have cloned and used the CastHelloText demo app. But there should be a cast button in the ActionBar/ToolBar which is for some reason not visible. I haven't registered any app to Cast Developer Console, I am just using the project as is, which means I am using the app id mentioned in their project. Does the chromecast device need to be powered on and plugged in and the android phone with the app be near/in front of the tv in order to make the button visible? I am a little confused as there is nothing mentioned anything like this in the documentation.
Your chromecast device should be powered on and on the same network as your phone (same wifi network on both). You do't need to be in front/near the TV as long as both devices are on the same wifi network but I presume you do want to be able to see the TV's screen to see if your app works or not, don't you?

connect to android devices using wifi direct without prompt

i am trying to connect two android devices using WIFI direct and i was successful. But the problem is the second device has to accept the a connection prompt after the other device initiates the connection. It is undesirable for what i am trying to achieve. I saw a few post here in stack overflow itself saying that currently its not possible. But came across an app called SUPERBEAM which user WIFI direct but without the prompt. A search in google gave me the following link from xda forum which says
SuperBeam creates an access point using Android's WiFi direct API's.
This essentially works like hotspot mode in old devices, but it is
guaranteed to work on newer devices like Nexus 7. Moreover, this mode
allows older devices to connect and receive files without having to
support WiFi direct's peer-to-peer connections and, more importantly, it
gets rid of the annoying "accept connection" prompt.
But no where i found information on how to implement this. Can anybody help me. Here is the link
http://forum.xda-developers.com/showthread.php?t=2177133
You could indeed simply use the createGroup function from the API to create a group, which also makes the access point. The first problem here is that the access point name & password are set automatically, and you can not change them.
So, you do need to pass the info to the connecting party, and for this, I would suggest using the local service advertising, and using the instance name there.
Did make simple test app for this and you can find it from Github under DrJukka/MyWifiMesh, also some discussions on the topic can be found from my blog
This can be achieve using Xposed framework. You need add the code and install the App. The phone needs to be rooted in order for it to work. I have tested it on multiple Samsung phones and it works.
Check this answer for details: How to auto-accept Wi-Fi Direct connection requests in Android

Not able to discover chromecast device in android

I am working with chromecast in android. I did almost every thing(according to me.)
I have whitelisted my chromecast Device.
Got AppID.
But still I am unbable to discover my chromecast device. I have follow this link How do I discover a Chromecast device using Android? as well as this https://developers.google.com/cast/cast_2nd-screen_app_tutorial. In chromecast app I have also checked this box Send this Chromecast's serial number when checking for update. What I am missing I cant understand.

Categories

Resources