how to discover android devices infomation in chrome extension - google-chrome-extension

When a PC connects to an Android device via USB, the device's information can be found on chrome://inspect. How can I get this information in a Chrome extension?

That information isn't available in the Chrome Apps/Extensions API. You should file a feature request at crbug.com explaining your use case.
If you write a Chrome App, you'll have access to the chrome.usb API, where you can connect to specific devices. See Spark's ADB functionality for an example: https://github.com/dart-lang/spark.

Related

How to make a Web App that works with beacons?

I know you can work with beacons with a iOS app or Android app.
But you can work with a web app to?
(A website recognize a beacon and do something)
Unfortunately, the general answer is no. You need native components to detect Bluetooth beacons on both Android and iOS. The web browsers on both operating systems have no hooks to detect beacons via JavaScript or HTML.
Chrome OS does have Bluetooth bindings in its Chrome browser, which may allow you to build a web app on Chrome OS that does this. But this would really be a Chrome App not a general purpose web app.
The Chrome browser for iOS and Android also detects Eddystone-URL beacons, but it will not pass the detection info to a web app. Detections are sent to the user as a notification and tapping on that notification simply brings up a configured URL in the Chrome web browser. This does not allow any dynamic web app behavior based on beacon detections.

how can i capture network request waterfall of feature phone devices browser like chrome dev toolbar

i want to test my site on feature phone like nokia asha phones , user agent does not give exact behavior . for smartphone i can connect my android device to chrome browser using USB debug mode and can inspect element , how to do this thing for feature phone
You can't. The DevTools remote debugging uses a very specific protocol to talk to the remote device over. If that device doesn't expose the protocol, you can't see into it with DevTools directly.

How do you debug a custom Chromecast Receiver on Nexus Player?

I want to debug a custom Chromecast receiver application on a Nexus Player. I've added the serial number / CSSN to my application whitelist. When I do the same for the Chromecast dongle, I'm able to attach the chrome debugger through ipaddress:9222. However, when trying the same using the IP:9222 port of the Nexus Player, I am unable to connect.
You need to use chrome://inspect. Quoting the documentation:
On your development machine, open a Chrome browser window and navigate to chrome://inspect .
Note: This is different than debugging for a Chromecast device, where
you navigate to your receiver's IP address on port 9222.
Click the inspect link to bring the receiver into the debugger.

Custom Chromecast sender API - possible?

I'd like to examine the possibility of writing an unofficial Windows 8 (WinRT/Metro) sender API for Chromecast. The goal would be to allow Windows 8 Store apps roughly the same functionality of iOS / Android apps through the official sender API available for those platforms.
I've noticed that, although the inner workings of the API haven't really been exposed yet, some of the source code for the Chromecast device is available, and there's an unofficial emulator for the device out on Github (https://github.com/dz0ny/leapcast).
Is this possible, given how Chromecast devices seem to take commands directly from Google?
ChromeCast is using a proprietary protocol called RAMP (Remote Application Media Protocol) to do media control. Once you have setup your ChromeCast device for development, the device will open a port for remote Chrome debugging. Open Chrome at your ChromeCast device IP address port 9222: http://192.168.0.x:9222/
You should see a page with a link to the receiver page of the currently running ChromeCast app. Click the link and then use Chrome developer tools on that page. Take a look at the network and console tabs to see the RAMP commands.
I have open sourced an Android app that shows you how to discover ChromeCast devices and setup the Websocket connection to handle the RAMP commands: https://github.com/entertailion/DIAL

How to debug JavaScript code with mobile browsers

I know about firebug and the developer tools for the major modern desktop browsers, but I can't find any way of debugging JavaScript code on mobile browsers.
What are some high level techniques I can use to debug code on mobile browsers?
Android devices can be put into developer mode by going through settings>Phone status then tapping on "Build number" 7 times. This allows you to do a bunch of things (see step 5) including USB debugging. (Some devices might have Build number under Software Info)
To activate USB debugging, look in Settings for the newly appeared "{ } Developer Options", open this and switch on USB debugging. Connect your device using a direct USB connection.
In Chrome on your desktop, in the usual developer tools panel used for debugging, look in the menu for more tools>remote devices. With Discover USB devices selected, you should now see your mobile device on the side.
Select it to see a list of all the chrome tabs you have open and the ability to enter URLs directly.
Selecting one of the links will open up a new window with a mirror of your device screen on the left and all the familiar chrome debug tools on the right. You can still control your device directly or use the mouse on the mirrored screen. It even rotates.
full details on remote debugging from google and how to enable developer mode (link as above) from askvg.com
Android provides a tool set for these purposes:
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/?utm_source=dcc&utm_medium=redirect&utm_campaign=2016q3
Apple does it a similar way:
https://developer.apple.com/safari/tools/
Tutorial: https://css-tricks.com/using-chrome-devtools-to-debug-javascript-in-any-browser-with-ghostlab-2/
You can debug on Safari Mobile with any iPhone/iPad. In Developer menu you can find your device and you can then debug your code with inspector.
If you have an Android Device instead, you can debug on Chrome Desktop (remember to active the debug mode) with chrome://inspect
On the IPhone you can go into settings>Safari>advanced and turn web inspector on
Sometimes I get bugs reported by customers that are not reproducible every time or in our testing. For such cases I recommend Lucky Orange. It records the user activity and also has the option to record console messages.
PS - I'm not an affiliate, I use them for my own projects and like it.
Another solution for basic debugging (which many times is all is needed), is having a console polyfill on mobile without the need to plug into USB on desktop.
mobileConsole is such a console polyfill.
Hope it helps someone, I found it useful.

Resources