I want to use an USB HID from a website. The website will only be accessed by Chrome browsers. The solution should require a minimum amount of extra software and setup for the website user to work.
The USB device presents itself as USB HID to the OS and I need to write and read byte arrays to and from it in order to implement the manufacturers specification for some of the device's features.
My current solution consists of two parts:
A Chrome App that uses the chrome.hid API to talk to the device. This App exposes a Chrome Cross-Extension messaging port to provide and interface for "service calls".
JavaScript code on the website that sends requests to the Chrome App, which then talks to the USB device to process the request.
In order to make it easier for the user I want to get rid of the App, so the user can just surf to the website, grant access to the device if necessary and then be able to use the device.
To be clear, I want the user to be able to use the website without installing any dependency first.
I already tried using the WebUSB navigator.usb API but Chrome blocks access to USB HID devices. Is there another way to accomplish this?
WebHID is being developed for this use case. It has been available behind a feature flag since Chrome 78, with an original trial expected in Chrome 84 (probably later due to current Covid-19 situation), estimated stable August 2020 .
For more details: https://github.com/robatwilliams/awesome-webhid
Related
I've written a simple web app to factory-reset bluetooth devices that were accidentally turned on during shipping. The app scans for a class of bluetooth devices (those made by the company I work for), renders a list of devices found, and, when I click a button next to a device in the list, sends a reset message to the device.
This is a very manual process and I'd like to automate it. The problem is the Chrome dialog that asks for permissions to pair with a device. I am trying automate the app with Puppeteer, but I can't find a way to either (a) programmatically grant permissions to pair with a device or (b) to select the device in the dialog and click the "pair" button via Puppeteer. Anyone know if what I'm trying to do is possible, or if there's a better way to achieve the goal? Thanks!
This is not possible in Chrome. (I work on chrome.) The automation that does exist for Chrome's testing is layered such that actual Bluetooth connections aren't made.
Eventually we would like to enable this workflow via Enterprise configuration controls. But that is not started yet and there is no date commitment.
One alternative is to use node.js, though you lose the easy interface. You might build the reset backend in a node server and have it serve a web page interface.
When I enumerate Bluetooth LE devices using WinRT API, sometimes, I needed to reset Bluetooth radio to successfully find my device. I am wondering is there an easy way to do this from code (Windows SDK, WinRT, WMI etc)?
After digging through Windows Universal samples from Microsoft, I have found a sample RadioManager which shows how to access Radios and turn ON/OFF from code at will. I was able to use the API successfully with a caveat that when used from Desktop WPF app, the app has to be built to match native architecture of the machine. Otherwise, ‘GetRadiosAsync’ method returns empty set.
I'm not totally sure, but resetting the system-wide Bluetooth radio is the sort of action highly unlikely to be available to an execution environment with non-admin privileges.
Anything able to stomp over the abilities of other processes (like turning off a radio) is not going to available in WinRT.
Edit: I stand corrected. Such an API apparently exists:
Windows.Devices.Radios.SetStateAsync
My WP8 app has some audio or videos, I'd like to share them with other plateform devices, such as iPhone or android devices. The first thing that comes to mind is Bluetooth. Can I realize this feature in my app? And how to do it? Thank you!
Sure you can do that, its the same like all file sharing apps do (whatsapp for Example) but your are about to do this using bluetooth connection, you just need to build a connection and transfer the file to the target device which should be able to open the file according to its format and the installed apps on the device.
I've worked with iOS Bluetooth extensively and the different ways you can share data over Bluetooth is by:
Using one of the Bluetooth profiles already supported by iOS: http://support.apple.com/kb/ht3647
Bluetooth LE (Core Bluetooth). I haven't used this, but the bandwidth and data structure of data being transmitted is limited, so it may not suit your purpose of sending audio and video.
Game Kit. This is for iPhone-to-iPhone data transmission though.
External Accessory Framework. This framework allows you to transmit raw data, but is only available to BT-enabled devices with special Apple authentication hardware (you have to join the MFi program and go all these hoops to get your device qualified). This doesn't work for you too, since you'd want to send data from WP8 or Android, which are definitely not MFi qualified.
So, bottom line, you CAN NOT send raw audio or video data from WP8 and Android to your iPhone unless you jailbreak the iPhone and put a new stack. iOS's BT stack is really limiting in that way, as I've learned the hard way.
On the bright side, you can definitely send raw data between Android and WP8 over Bluetooth. You have to create an RFCOMM socket on both ends (one sending; one listening). The Bluetooth profile used for this sort of data transfer is called a Serial Port Profile.
I have created an application which use HERE Application Launchers and my app work fine on my Nokia Lumia 720.
My problem is certification on marketplace I get the response like:
The application exhibits device specific behavior that inhibits functionality and
features. The application's main functionality
cannot be tested on non-Nokia devices because it requires Nokia Here Drive.
-Launch the application on HTC 8X.
...
-Observe the user is prompted to install the app "Here Drive".
I agree with this becouse HERE maps are only available on Lumia devices. But how to use HERE Launchers if we cannot publish it on the marketplace?
If somebody has had similar situation and know solution for it?
That's because it's better to use the ms-drive-to or ms-walk-to Uri scheme!
When you use those, the phone itself will launch HERE drive if it is present, otherwise Bing maps!
Get the needed example code and usage on MSDN here: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj710324(v=vs.105).aspx
I think you need to clearly state in your app description for Store and in the app itself, that it works only on Nokia devices. (Or you can implement some kind of fallback behavior for non-Nokia devices as well)
This way it should pass the certification, because the behavior will be expected and not confusing.
I suppose either there were something wrong on the submission time, or the rules have changed. I at least submitted an application which is using the Uri Scheme directly, and it got accepted.
In the essense there is no requirements for any specific Application being installed, but there is a query made for applications which support the Uri scheme protocol. And if the HERE application having it is installed, then it will be launched.
And if there is no handlers available, then the market place should be opened for searching for the handlers. At least that's the way the system is designed for.
I am wondering if someone knows the best method for storing data in a global DB against a mobile device (iOS and Android)?
I am building an app that writes/retrieves information based on a query however I need to know if any of the records returned were sent from that device.
Basically the idea is that if a user submits some information (which is stored in the DB) they gain access to additional features of the app. When the app is launched, I will check the DB to see if they submitted information in the past and allow access to other areas.
I use local storage for the information they submitted but also store remotely so if the local storage becomes corrupted for any reason there is still a record of the information the user submitted.
The ID needs to be unique to the device as there could be 100 of users (hoping for millions) so the ID needs to be unique enough that it will never conflict with another device. Any information submitted will be available for retrieval by all other users.
Thanks :)
There are three options as I see it:
1. User
You can create a typical username + password user scheme and use this to verify the user. A possible advantage of this method would be that the user can log in from any of their devices (for instance, under your method a user using the app from their iPhone and iPad would have two different views - which you may not want). Of course, this means forcing every user of the app to register within your system, which is not ideal.
2. App Install
You can uniquely identify an app install by having your app generate a UUID the first time that the app is run (you can use an AS3 helper library to generate the UUID). You can store this UUID locally and send it along with every request the app makes. The downside to this approach is that it doesn't uniquely identify the device - only a specific app install. For instance, if the user deletes the app and then reinstalls it at a later point, it will now count as a new unique device, even though the user is on the same device.
3. Device
AIR does not have a built-in way of reading device identifying info. However, you can retrieve device info through AIR Native Extensions, for example this one can get the MAC address and some other things. There are privacy concerns and other issues involved in reading and storing device info such as these, so you are probably best served trying to implement the OpenUDID project as an AIR Native Extension, since they have already dealt with all such issues. Unfortunately, I have never looked too far into developing ANE's so I am not sure how complicated or feasible it will be to turn OpenUDID into an ANE.
Summary: I would recommend the app install method due to the ease of implementation. If you really need the unique device and are worried about the multiple app installs case, you will have to work out how to use native extensions to get the info you need. If you decide that you would rather identify by user rather than device, use the user method.
As of now I don't think its possible to get the hardware devices guid using air mobile. However you do have a couple of options.
If the MAC address is good enough for you there is an ANE that will let you grab it on both iOS and Android.
http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/networkinfo.html
and an example of how to use it
http://cookbooks.adobe.com/post_Getting_NetworkInfo_from_both_Android_and_iOS-19473.html
You could also write your own ANE, it should be pretty simple to wrap both Android and iOS implementations.
Objective-c: [[UIDevice currentDevice] uniqueIdentifier]
Android: TelephonyManager.getDeviceId()
If your app requires any kind of user account or login the best option would be to store this setting in the remote db.