What protocol does an Android TV Remote use? Seems like Anymote is no longer used. But there are still applications like Android TV Remote Control and Remote Android TV which work quite well with even the newer Android TV's. Can someone please point out any official / unofficial documentation to write such apps?
An Android TV is capable of being controlled over either Bluetooth or over WiFi. It would be great if either one of this follows an open protocol that can be incorporated in to say a Python or Android program.
Few Clarifications based on the various comments and replies:
Anymote is most certainly not the protocol in use any more (unless it's hidden and can still be used somehow in an undocumented fashio)
The ports that Android TV remote uses currently (6466/6467) is different from the Anymote standard ports (9552)
The old open source GoogleTV remote application no longer works with AndroidTV
I still do see "_androidtvremote._tcp" being advertised through mDNS - so there is a way to control it over TCP.
The Google TV Remote application uses Google's Anymote Protocol, which any application can use to create second screen style applications. There are several pieces to the Anymote Protocol.
Not a sufficient answer, but may help anyone looking:
I have recently got in the same situation as you.
From my finding, I suspect the pairing protocol is implemented in some Android core library (the com.google.polo.* java package in old references).
At the moment, search engines only yield this one repo archive of legacy code.
I tried to adjust the various (obsolete) polo & protobuf versions together, but I always get a different error.
I think the solution would be to locate an up-to-date polo library (from the Android SDK?).
I know that you indicate that Anymote is not used in GoogleTV, but from a quick download of its source code, it appears that Anymote is used.
com.google.android.apps.tvremote.protocol.AnymoteSender
The only other "sender" I can see in the protocols is a "DummySender" (noop) and a QueuingSender (delays until a Sender is ready).
The source code for GoogleTV is here. If there is any other protocol available, it will be referenced in this source code.
I would double-check other items to ensure that a pairing issue, the wrong device discover, or another thing isn't blocking your progress with Anymote.
Related
I intend to port a Qt desktop application to Android. It uses QSerialPort to communicate with an external device (which has a built-in CP210x)
The application, although written purely in Qt and C++, runs fine on Android, but it doesn't see the device. The CP210x official driver download page recommends to compile the kernel on Android from source, which is not feasible to expect from the average customer. Other recommendations I found online recommend jailbraking the phone, which also isn't something we could expect end users to do.
There are scant few questions in this topic on the Qt forums, most saying that QSerialPort's Android support is quite limited. However, these topics are often at least 6-7 years old.
An Android developer forum/wiki/tutorial? recommends to use "Android Things", whatever it is. I couldn't find any apps fitting that description.
I know that it's physically possible to use serial-usb on an non-jailbroken Android, as I tried out a serial console app and it worked, I could successfully exchange data with my device.
Does this mean that the only was is to develop my own wrapper in Java, and use JNIEXPORT? That would break the easy multi-platform compilation I used before (just selecting a different kit from Qt Creator) Are there any simpler ways to accomplish this? Is USB OTG usage so low that no one else thought to implement anything in this regard?
QSerialPort has only a non-official partial Android Support (see https://wiki.qt.io/Qt_Serial_Port).
(... Use on own risk, only for rooted devices, in which is it possible to get/set a permissions to the /dev/ttyXYZ nodes)
You can use JNI to get a FileDescriptor with permission and then use the libusb library in C++ to communicate with device.
But yes, it would break the easy multi-platform compilation.
I need to utilize both a barcode scanner and a USB port on something handheld. I figure a small Android Tablet is my best option.
I've spent some time researching and I cannot find anyone who has implemented a NativeScript App w/ Serial Port communication on Android.
I am concerned this means it is not possible, or prohibited for some reason.
I have the Serial Communication functional right now using Nodejs and the serialport module via NPM.
Does anyone know if this module will work in a NativeScript app?
I am going to attempt to make this work over the weekend, but before I waste a lot of time I figured I would ask in case this is simply not possible -- I've chased simple bugs for days so I could waste a long time on something that's not possible. :)
Thanks for your help!
Anything you can do with a pure Java-only app (or Swift/Object C for iOS) you can do with NativeScript as you can access all the underlining APIs. This is one of (if not the) key differences between NativeScript and other technologies. See the NativeScript docs.
Most probably, you'll want to use some third party code to communicate with the serial device (such as usb-serial-for-android). Here's a great blog post on how to use third party code in your NativeScript app.
I see a lot of tutorials in the Internet teaching about android to browser or browser to browser webrtc application. Is it possible to build a native android-to-android video chat app using webrtc?
Well, for establishing a connection between the devices before the call via peer-to-peer WebRTC solution you need STUN/TURN/ICE servers.
They establish the route for communication between the devices.
Once the route is established the devices communicate directly without participation of a server for passing the media streams.
To make it easier for you, you can look at or try some existing solutions, like ConnectyCube.
They have peer-to-peer WebRTC solution for Android already implemented.
So, maybe there is not need to reinvent the wheel.
There is an official Android sample project AppRTCMobile provided here - https://webrtc.org/native-code/android/. However, the build process is tedious and the total download size exceeds 20 GB. The recommended way is to use the following dependency in your project.
implementation 'org.webrtc:google-webrtc:1.0.+'
However, for video chat functionality you will need to refer AppRTCMobile source code. There is a clone of this project on GitHub updated for Oreo and ready to import in Android Studio. Check out this link.
WebRTC uses ICE protocol for creating connection between two peers. It uses DTLS-SRTP for creating secure data exchange between peers.
Now both ICE protocol and DTLS-SRTP are protocols that can be implemented on any devices no matter what platform. You implement or use existing implementation of
ICE and DTLS-SRTP protocol on your android apps and communicate with each other.
When you read tutorials about implementation of WebRTC for communication between android app and browser, there the android app has the implementation of both ICE and DTLS-SRTP. So this android app can communicate with other android app having similar implementation.
in addition to #tahlil great answer, you can also use a number of open source SDKs out there that already took the burden on bundling the WebRTC libraries and offering simple APIs for you to integrate Real Time Communications in your native app. One example of such SDK is the RestComm Android SDK
See https://github.com/Mobicents/restcomm-android-sdk and http://www.telestax.com/restcomm-client-android-sdk-beta-2-is-out/
So I am a relatively new iOS developer but thanks to Stackoverflow, i managed to get peer to peer data communication for my app working without the need of a server using gamekit/GKSessions.
Basically, one iOS device acts as a server and others just connect to it to receive app specific data.
Now, the app is currently being ported on Android and I was wondering if there is a way that I can make an Android device connect to the iOS app and behave the same way as ios app does.
Android developers suggested alljoyn to be an optimum solution for android but that doesn't seem to be available yet for iOS.
Please suggest if you have any ideas on this front.
If there is a solution that involves rework on iOS side as well then I am open to it!
In case, you or others tackling the same question in Jan 2013 needs an answer,
AllJoyn is now ready for iOS too, amongst other platforms.
https://www.alljoyn.org/docs-and-downloads
Venkat i suggest you to read and get some detailed information regarding P2P. This is a Good source, because you might get stuck if both devices are behind multiple Nat. but if your willing to go forward there is always a way. My suggestion would be an Relay, but you need to have a server, but the relay behaves like P2P. Look at the source above to get ideas.
I didn't have time to wait for alljoyn to be launched for iOS and sensing no other feasible solution that would fit on my timeline, I implemented a relay server in between to achieve this.
For others though, iOS binding is now available for alljoyn (www.alljoyn.org).
I haven't tried it yet but the android version of my app works with alljoyn and it works perfectly so I assume it will do the same for iOS as well.
One limitation to be considered using alljoyn is that it cannot communicate between devices that are behind different subnets.
I think there is a limit of max peer to multiple peer connectivity (max 8 peers) derived by IOS and Android, there is no connectivity tested using alljoyn between IOS and Android devices
I know how to develop in Android and use the Apache HTTP lib, but I want to go lower, get hold of the wireless interface adapter and be able to send & receive packets wirelessly. I know its possible since there are sniffer apps in the android market. I have looked around and googled a lot, but can't seem to get any ideas on how to even start. Surprisingly nobody seems to have asked this question on SO before too.
I suppose there is no android API that does it for you. Please suggest a way of sending/receiving packets in android or post references to any such resources.
Thanks!
Note: I know java.net api can be used in android (though I haven't used it before) but that doesn't give me the kind of access I want.
There is no way to do this with the standard SDK/NDK.
On a rooted device, you could possibly call into tcpdump, or another libpcap-based application. There is not a supported way to give Java applications the required privileges on a production Android device.
For example, this blog post describes how to use tcpdump to do a basic packet capture on Android.
Did you have a look at the NDK? Maybe you can do what you want in C(++).
Android OS 4.0 or later provides a VpnService through which you can monitor the network traffic. Application provided at http://www.taosoftware.co.jp/en/android/packetcapture/ uses VpnService that capture the data.