How to completely access android bluetooth using progressive web app - progressive-web-apps

I have tried web Bluetooth API to access,but it is only for battery status, heart rate etc.., I need to access complete functionality of Bluetooth. Is there any option or API available

I think there is no other available API for this bluetooth function, The Web Bluetooth API is your only option, but it is not finalized yet.
According to this documentation, until now, the ability to interact with bluetooth devices has been possible only for native apps. The Web Bluetooth API aims to change this and brings it to web browsers as well. Alongside efforts like Physical Web, people can walk up to and interact with devices straight from the web.
And even though it is not finalized yet, the Chrome Team is actively looking for enthusiastic developers to try out this work-in-progress API and give feedback on the spec and feedback on the implementation.
Just take note that Web Bluetooth
API is currently
available to be enabled experimentally on your origin in Origin
Trials, or locally on your machine using an experimental flag. The
implementation is partially complete and currently available on Chrome
OS, Chrome for Android M, Linux, and Mac.
For more information, just read these documentation and video. You can also check the updates of the documents here.

Related

Where can I find the android open accessory API / libraries / firmware examples?

In the docs regarding custom accessories, there is a link to what it claims is the firmware source code but this link only points back to the top page for the Android Peripherals and Accessories (no source code). All the pages under "Custom Accessories" give vague instructions on how to connect but no API, libraries or examples. For example, under the Determine accessory mode support section, it claims:
During the initial connection, the accessory should check the version, vendor ID, and product ID of the connected device's USB device descriptor.
How do I initialize a connection and what methods or what libraries would I call to get the version and other info?
No amount of googling has enabled me to find the source code, libraries or examples to anything related to this "ADK" other than a few outdated Arduino pages that also point to bad links. The closest SO question I've found is here and answers also contain broken or piped links.
Is this project dead or something? What is the standard way of communicating with IO via Android these days?
Just following up here as I found what I was after, though not terribly pleased with the result.
The demo code linked in the docs points to an "adk" which appears to be a demo of the Android Open Accessory protocol developed for use on the Arduino ADK board which was intended to interact with Android. The source code can be found here:
https://android.googlesource.com/device/google/accessory/
though it is terribly out of date. You'll have a terrible time trying to get that to compile with modern gradle.
There are a couple of more active communities working with USB and Android:
This one being great, but only for Host Mode (not accessory mode):
https://github.com/mik3y/usb-serial-for-android
There was another slightly less outdated example of how to implement the AOA between two android phones, which I refactored and got working using modern gradle build tools:
https://github.com/topherbuckley/USB-accessory-sample
After seeing how abandoned the project was for so long, I instead focused my efforts on using Android in Host Mode only, but implementing USB Power Delivery on any hardware such that I can use the Android phone in Host Mode and swap the Power Role via USB-PD after initializing the connection. In this way I can avoid the AOA and still get the same end result using modern software/hardware/firmware.

Enabling Kinect In a Browser using NaCl

While working on a project with the kinect, I had an idea of integrating it onto a web browser directly from the device. I was wondering if someone has done this before or if there exists some form of information that can shed some light.
In More Detail:
I've been dissecting the Kinect Fusion application that is provided with the kinect and I was wondering what it would take to have a browser do a direct to device 3d scanning. I've discovered NaCl which claims that it can run native code, but I don't know how well it would run Microsoft native code (from the Kinect SDK version 2 //what I'm using.) also just looking at NaCl with no prior experience(with NaCl), I currently cannot imagine what steps to take to actually activate the kinect and have it start feeding the image render to the browser.
I know there exists some libraries that allow the kinect to work on other operating systems and was wondering if those libraries would allow me to have a general bitmapping to send the pp::graphics2d stuff for nacl(for the image display), for which I would then need to figure out how to actually present that onto the browser itself then have it run the native code in the background to create the 3d image then save it to the local computer.
I figured "let me tap the power of the stack." I'm afraid of an overflow, but you can't break eggs without making a few omelettes. Any information would be appreciated! If more information is needed, ask and I shall try my best to answer.
This is unlikely to work, as Native Client doesn't allow you to access OS-specific libraries.
Here's a library which uses NPAPI to allow a web page to communicate with the native kinect library: https://github.com/doug/depthjs. NPAPI will be deprecated soon, so this is not a long-term solution.
It looks like there is an open-source library for communicating with the kinect: https://github.com/OpenKinect/libfreenect. It would be a decent amount of work, but it looks like it should be possible to reverse-engineer the protocol from this library and perform the communication in JavaScript, via the chrome.usb apis.
Try EuphoriaNI. The library and some samples are available at http://kinectoncloud.com/. Currently, only the version for AS3 is posted on the site though. The version for the Web, of course, requires you to install a service on your computer (it's either that or a browser plug-in... and nobody likes those :)

Is it possible to initiate a voice call from Mobile Safari to a proprietary service (i.e., not PSTN) with no plug-ins?

We assume the answer is no. However, all SO questions are either dated or based on desktop browsers.
We're aware of WebRTC, but it's not supported in Mobile Safari today. Is there any other approach?
To clarify the scenario, imagine we had a service like Skype. Instead of requiring both parties to have the app, we would like one side to use a mobile browser to have phone calls.
No, you cannot. Not without plugins. If you want to place calls from a browser to any other client, you must use WebRTC for full support (media transport + media devices access) or you have to use a plugin to access the media devices and to do the transport (e.g. Flash).
As Mobile Safari still don't have WebRTC...

Connection between Samsung Smart TV and iOS app

I got a Samsung Smart TV UE40D8000 (Apparently from 2011 series ?) and an iOS device.
I'd like to make them both exchange information (most likely small chunks of text), via a dedicated app on both sides;
Now, it turns out the best way would be to use the Convergence API : I've built a basic TV App that looks an awefull lot like the sample code they give, and an iOS App for UPnP discovery and sending POST requests onto the TV. UPnP discovery works great.
But on the actual device, I can't seem to be able to manage to connect : the requests to /ws/app/{appID}/connect fail (with an actual appID of course) as if there would be no server.
Is the Convergence API available for my TV ? (there does not seem to have a compatibility list anywhere) Is there a way to upgrade to a 2012 platform if it is indeed a 2011 one ?
Can we test that API on a simulator ? My simulator runs under Windows 7 in a VM on my Mac (there is not Mac version of their dev tools...)
Is there really anything I can do to have a more precise diagnostic ? like logs from the appilcation running on the TV ?
Thanks
This Convergence page sounds like existence of MultiScreenService UPnP service equals the capability of Convergence API calls. So if you say "UPnP discovery works great" (given that you do an ST-limited M-SEARCH per example, not an unrestricted UPnP discovery), it should mean that your particular TV supports Convergence. Have you tried querying the TV simply with telnet? Are you sure about the port number on which the TV listens? Here the doc claims that it should be 80 for the TV and 8008 for the simulator, but i for one am very interested in the UPnP description.xml served by the TV for MultiScreenService. You could even discover some UPnP functions for diagnostic there...
Disclaimer: i have no experience in Convergence, only UPnP in general and unfortunately Samsung in general too. The fact that Samsung pushes such half-baked proprietary mockup reminds me of my short bloody disgusting career as Bada developer. Only Sony can sustain pushing proprietary mockups with dignity :)
Your year model is 2011 and you can't upgrade to 2012.
2012 models uses API v3.5 and 2011 models uses API v2.5
So this what you try to do won't work at your device as Convergence API is in API v3.5.
Check this one
http://www.samsungdforum.com/Guide/View/Developer_Documentation/Samsung_SmartTV_Developer_Documentation_2.5/API_Reference/JavaScript_APIs/Interactive_API
It gives you possibility to communicate between devices, so maybe it will fit your needs.
Finishing answering my own question:
like #Dobiatowski mentions, I'm screwed for Convergence API and 2012 platform
The Interactive API's documentation is not clear, and virtually non-fonctionnal despite 3 days of my best effort. Half of the sentence in the documentation don't actually make sense.
Still did not manage to make the interactivity simulator to work, Looks like it's not possible on Win7
Basic answer is : not possible

How to do peer-to-peer communication in an iPhone app?

I'm trying to write a simple chat application for the iPhone (as an experiment). Is there a simple way for two devices to discover each others' IP addresses, and given the addresses is there a simple API or protocol that would let me send text messages back and forth?
I've investigated SIP (specifically Sofia and eXosip), but these tools exist as C libraries and are beyond my current ability to port them to the iPhone.
Update: I'm trying to connect two devices over the Internet (i.e. not over Bluetooth or a local wireless network, which is what GameKit does).
You're going to need a server that provides the match making service. Game Center makes this pretty easy, but your users will have to have Game Center accounts.
Alternatively, you can set up an XMPP (formerly Jabber, it's what powers Google Chat) server (I've never done this, but there are several available) and use the XMPP Framework for Cocoa. There are instructions for using it in iPhone apps here.
I'm sure there are other chat servers and client source also available. IRC and Mobile Colloquy come to mind.
Finally, you could write your own server using your favorite server language / framework. This isn't too hard (I've done it myself), but it's far from what I'd call simple, and I wouldn't use it for a production system.
There is support for exactly this kind of ad-hoc peer-to-peer networking in GameKit. Have a look at the second half of the GameKit documentation for details:
http://developer.apple.com/library/ios/#documentation/...
NSNetService is a good option.
Take a look at WebRTC Datachannels. WebRTC is a newer option with native iOS support a standard that is still being finalized, but it is more flexible should the iOS app need to communicate with browser or even android peers