Google-TV device not found to pair with Google Anymote - google-tv

In building the Google Android app for Anymote tv control (I've got some Sony Google TVs to work with), I never actually seem to find the TV when I run it - just getting "No Google TV devices found on ". I've tried it on an actual phone (not just the emulator) and have also tried the TV "connect" pairing button, but it never seems to find anything. Both the phone and the TV are on the same WiFi network. Anybody get this to work?

Does the google-tv-remote app work on your sony google tvs? If so then I would check the source for that app, found here. This should allow you to troubleshoot why your device is not found. The process of discovering devices depends on mDns as found here in the docs. So there are several things to check in regards to making sure multicast packets are allowed on your network/device.
As a fallback I would also allow manual ip entry in case a user wasn't able to discover the device on their network, the google-tv-remote allows for this as well, I would take a look at that source to get an idea of how that applications handles different scenarios.
And as always, if it's not working, provide some examples of how you are trying to do the discovery as you haven't provided any information(source, logs, etc) for anyone to look at.

My experience with the sony google tv is that the multicast packets are reliably sent out shortly after the box is started. Paring at all other times is virtually impossible

Related

How can I find the list of all available nearby devices, even if they don't have my app?

Follow up for this post from Jul. 2020. I want to know if it's possible to programmatically access the total list and number of available devices around me, even if they don't have the same app installed; similar to what AirDop does.
I've looked at Peer To Peer, Nearby Interactions, Bonjour framework and all of them require the same app to be downloaded.
Any thoughts?
You can't do that since all mentioned frameworks need to run same type of session with another devices, which is (currently) impossible without an app.

Third party apps in Apple Watch without internet

I'm trying to compare the possibilities of use beetween Apple WatchOS and Android Wear when it comes to using them without the phone nearby. And without conection to internet (Wi-Fi).
I own a Android Wear and have tested the possibilities but cant get an Apple Watch and all the info I can find is this: https://support.apple.com/en-us/HT205547
It says that with wifi you can: Use apps that support Wi-Fi. But what does it mean to support Wi-Fi? Does that mean third party apps cannot be used without internet in any case?
Thanks very much for the help!
Third party apps can run on watchOS without a network connection even if the Watch is not connected to the paired iPhone.
That piece of documentation you linked is only showing which system apps can be used without being connected to an iPhone with/without network connection.
If your watchOS app is not network based, it can fully function even when the Watch is not connected to the iPhone and there are no known Wifi networks available.

Issue with the wifi in iPad

I am working on a educational related apps. My app functionality is working well when the WIFI is connected otherwise it is getting crashed.
In my app I am connecting with the server using NSURLRequest class its working.
the download also not having any problem if the wifi is available.
problem rectification: I have to know weather the my app device is connected with external network or not.
So, how can I know my app is connected with the wifi or not?
The following link consists source code, in which it consists how to check the reachability. That means the wifi or any network is connected of not.
http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html
Apple provides sample code called "Reachability" to detect when the network is available. That would be a good starting point, though a quick Google should locate some alternatives.

How do we detect if wifi becomes unavailable in iPhone SDK

Is there any way that we can programatically identify when the wifi of a user becomes available/unavailable?
My application requires exchanging messages between two different devices. It is working good in stable wifi setups. But if the wifi is unstable, I am having trouble in detecting if the other device is available or not.
I am not sure if this is expected, but my bonjour based NSNetService discoverer is not updating the available devices list automatically. This leaves me with a list of services that are not available for the exchange.
My line of thinking was to remove all the available services from the list and start a fresh search.
Please let me know if I am thinking in the right direction to solve the right problem.
Thanks in advance.
-Murali
Perhaps the Reachability sample code provided by Apple will help you in this regard. Although there have been people who say it hasn't been updated in a while, in which case, here is an actively maintained fork.
It seems like you can register for notifications so you can get frequent information on the state of the network.

Why does NSNetServiceBrowser find unpublished services in iPhone OS?

Building a desktop version of my mobile app and providing the user syncing over wifi. Everything works great in the simulator - no problems resolving net services (which are published by the desktop app) or noticing when services become unavailable.
The problem is when I run the app on the phone services are discovered and resolved (sometiems) but the NSNetServiceBrowser never notices when a service becomes unavailable. When this happens the net service browser constantly finds a net service (that is no longer published) resolves it but then can't connect to it. After several failed attempts the service browser delegate's "didRemoveService" is finally called and the app begins to behave correctly again.
I'd post my code but I've discovered the same issue is happening in Apple's WiTap example. Services are published and discovered but once they are made unavailable the client running the service browser doesn't update - and repeatedly tries to resolve a service that "shouldn't" exist.
I've discovered that running WiTap with wifi turned off (so Bonjour uses bluetooth) everything works fine. I can't find anyone complaining about WiTap not working and can't find this issue anywhere else online. Any reason - possibly with iPhone OS or my wireless network - why a net service browser can find and correctly resolve (but can't connect to) services that are unavailable?
Bonjour/NSNetServiceBrowser on the iPhone/iPod Touch will utilize both Wifi and Bluetooth for service discovery--at least on supported devices. Each time you begin browsing for services, it will search both WiFi and Bluetooth (which you can verify in the iPhone's Console, in Organizer). Since your Simulator "device" cannot use Bluetooth, your iPhone discovers it over WiFi. However, if you are using NSNetService to publish on your iPhone, then you are publishing over both WiFi and Bluetooth as well (if supported and enabled). NSNetServiceBrowser, when running on BT-capable hardware, will dutifully find that both instances, and report both via delegate callbacks.
Bluetooth PAN setup takes longer than publishing via Wifi, so the BT-discovered services often show up well after all the Wifi-based services have been discovered and resolved. When testing two real devices, I've even seen both services show up in my UI (usually only after the other phone crashes).
It does make for some frustrating coding, though. Your best bet is to utilize netService:didNotResolve: to either (i) retry resolution, or (ii) invalidate the netService instance and wait for the other phone to relaunch their app.
Also, there are a couple of other areas things can go wrong. Since the NSNetService instance provided to you is autoreleased, you need to retain it. Most people add it to an NSMutableArray or NSMutableDictionary. If that's the case, make sure that you have properly initialized it before adding the object. Since messages to nil are perfectly ok, if you send addObject: to nil it will appear as though everything is working fine. Except that it isn't. This crops up very often in Bonjour troubleshooting, and happens to the best of us. Make sure that your NSNetService gets scheduled into an actively running runloop, and one that is running in default or common modes.
There is an open bug filed with Apple (as of 10/4/09) whereby every so often, a Bonjour update will not result in a delegate method getting fired. I have only observed this occurring on a 3GS. The result is a client app that is out of sync with the network.
NSNetServiceBrowser should consistently notify when a service leaves the network (under nominal conditions). The bug above is only an intermittent one, and apparently, hardware specific. If you see it occurring consistently, then it's likely that your app is throwing an exception. If you are using background threads, this can occur without causing your whole app to crash. You may want to check your iPhones Console and logs for error messages. Make sure you have set a breakpoint on the symbol objc_exception_throw.
Here's another troubleshooting tip that I've found invaluable. Monitor Bonjour broadcasts on your dev machine via Terminal using the following command: dns-sd -B _serviceName. This will let you see all comings and goings on your local network for your service. If your app quits, but dns-sd does not show a Remove event, then your code needs revisiting. If dns-sd shows a remove event, but your other apps don't process it correctly, you may be seeing the above mentioned bug. It may also be the case that your code isn't doing what you think it's doing. And remember, this will only help you troubleshoot Wifi-to-Wifi service Bonjour. Bluetooth to Bluetooth is not supported from the iPhone Simulator.
Read the full article, Troubleshooting Bonjour Networking for the iPhone, at my dev blog.