Not able to discover chromecast device in android - 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.

Related

BLE device not showing up in Android Chrome

I have a Bluetooth Low Energy (BLE) device and want to access it from a web page using the Web Bluetooth API.
This works perfectly fine in Chrome on Windows (at least with current versions of Chrome and Windows) and even with the WebBLE App on iPadOS (since Safari won't support WebBluetooth).
But I have multiple Android devices running the current versions of Android (12) and Chrome (97), where in the browser device chooser, the device won't show up. Some other unknown devices show up, but my device does not.
What could be the reason just this one device does not show up and how could I gather more information about this situation?
It happens in the native browser dialog so my usual debugging steps don't work.
Update:
I have already checked with chrome://bluetooth-internals, and the result is the same. The device shows up on Chrome/Windows but not on Chrome/Android.
Now I also used chrome://device-log which on both Windows and Android shows only
Bluetooth Internals Page initiating Bluetooth discovery session
nRF Connect for Mobile shows the device instantly, and it also shows up in the Android Bluetooth settings. Only Chrome Web Bluetooth doesn't show it.
Update2:
The adb logcat reveals the following line during Chrome Bluetooth discovery:
V/BtGatt.GattService(19403): Skipping data matching denylist
What's that? Has Chrome its own denylist for bluetooth devices?
Update3:
Android has a denylist for BLE devices, which should not be applied if the App (Chrome) has ACCESS_FINE_LOCATION permissions. But Samsung seems to apply the denylist nonetheless, even if Chrome has all necessary permissions.
https://www.chromium.org/developers/how-tos/file-web-bluetooth-bugs/ lists tools and log viewing approaches thay may help, including:
chrome://bluetooth-internals
nRF Connect for Android
chrome://device-log
Try requestDevice with "acceptAllDevices":true as well if you haven't yet.
It is unfortunate that this device is getting filtered out even though it isn't a location beacon (iBeacon, eddyStone) but this behavior is currently working as intended according to https://bugs.chromium.org/p/chromium/issues/detail?id=1296054.
The reason the device is not showing up is that Android has a denylist which matches Eddystone and iBeacon payloads using the advertising data.
My device seems to have something in its advertising data which matches Eddystone or iBeacon and thus is ignored, even though it is a digital tape measure.
Sources:
https://android.googlesource.com/platform/packages/apps/Bluetooth/+/master/src/com/android/bluetooth/gatt/GattService.java#255
https://android.googlesource.com/platform/packages/apps/Bluetooth/+/master/src/com/android/bluetooth/btservice/AdapterService.java#3939

Android send notification message to device without client app installed on the device

I would like to know is there any way to send notification from a server to an Android device without a client app installed on the device. Does android OS has such functionality. Based on the answer here Does Android support near real time push notification? Google Cloud Messaging do similar things, but it seems the client app need to be installed on user mobile.
Basically what I want do when an android device comes in range of an iBeacon
I need to send the notification messages to the user mobile.
Is there any way to achieve it. Any possible solution?
Edit:
The real scenario is like,
I have the beacon placed in somewhere, when the a device comes in range of the beacon, some how I have to detect the device(if the device Bluetooth is on) and get some id of the device send notification from cloud server. Where as the device(Android phone) don't know the beacon is there, or there is no app installed on the device to detect the beacon.
I am not sure whether it's possible to achieve the above goal in such a scenario.
Please let me know your valuable feedback.
Chrome 42 or higher for Android supports push notifications from websites, which allows you to send notifications without installing an app.
If you're specifically looking to start notifications from a beacon, Chrome 49 added support for beacons

Android discovering same app UUID devices

I am using bluetooth adapter to discover bluetooth devices. The search displays all devices (iOS , Android, Speakers etc) which are available in surrounding with Bluetooth turned ON.
My App sends and receive data, so installed on two different Android Devices, app can perform a chat functionality, provided both apps are using same App UUID.
Is it possible that when I perform the device discovery/search, I only limit discovery to those devices which are Android and are using my App i.e. my App UUID and not to show all other bluetooth devices.
I know this happens in iOS using characteristic UUID.
Appreciate Response.
1) First you're doing an Inquiry (search) of all nearby devices
2) for each device enumerated, do a Discovery (SDP) on it to gather all its services/profiles; If you found the one you're searchnign for, display it, otherwise forget it...
PS: I have no idea about selecting Android devices only... You can use the CoD (Class Of Device) but not sure that you can separate Android from other "smartphones"...

Broadcasting a File over WiFi, without Client App

Target:
Sending a file to connected peers. The connected peers should recieve the File without a preinstalled app.
Situation - Question:
I'm writing an app that opens WiFi-direct or a WiFi-Hotspot for other devices. The other devices connect to the device (Main-Device) where the App is installed on. Now the Main-Device should broadcast a file and every device connected to the Main-Device should get a notification, that it could receive a file. But, the other devices should not need an App to receive the file!
Is this possible? Cause all I found till now describes how you can send something from one to an other device if both installed the same app. Using sockets and one device becomes server and the other client.
Reason:
I try to create a game, which just is installed on a Main-Device. Other devices can join the game by connecting over WiFi, then they'll receive a HTML5-file from the Main-Device which they can open in their browser. As soon as they have the HTML5-file they'll be able to interact with the game on the Main-Device.
But I don't want to force everybody who likes to join the game to download the app. Another Point is, if this is possible, I don't need to rewrite the app for other systems. Cause every Smartphone/Tablet has a Browser.
But, the other devices should not need an App to receive the file! Is this possible?
No, it isn't.
I try to create a game, which just is installed on a Main-Device. Other devices can join the game by connecting over WiFi
That, is possible. What you need to do is build a captive portal.
Basically, all DNS names resolve to your server's IP address, and all traffic that would be routed elsewhere is not routed to the internet. How you do this depends on your network setup. There is a lot of software available. I've used Untangle before with decent results: https://www.untangle.com/store/captive-portal.html

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

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!

Categories

Resources