Android ADB from JavaScript Webpage - javascript

I have a problem with a simple web app on android.
I simply have to make a web page in JavaScript that prints messages or performs callback functions based on the key pressed.
The problem lies in the device on which it should run, that is an Android TV and the keys to which I should associate callback function are those of remote control. The TV manufacturer told me that the only way to get information about the buttons pressed on the remote control is through ADB, specifically through the command “adb logcat”.
So my question is: is it possible from JavaScript in the browser to read the output of the command abd (adb logcat)? Or in some way have the information returned by ADB on the web page?
Thanks in advance.

Related

Running terminal through the web browser

I'm struggling with some Web App recently and have a unusual question.
Is it possible to access terminal via the web browser? Let's assume that I have a button, and when I press it I want to have new terminal window appear.
Any ideas?
If you are running the web app locally, you can tell your server (PHP, ASP.NET, ...) to launch on calling specific url (eg: http://localhost:8080/open/terminal). You can even make a button click event to call that url in the background.
But that's dirty way of doing such things.
TIPS: If you wish to use web technology for desktop apps, use https://electronjs.org/

Call Automation in iPhone

Is it possible to simulate call procedure in an iOS App using any script.
Launch Phone App
Pres Key Pad
Dial Numbers
Press End call
Gone through the following link.
IPhone Automation
I am looking for commands similar to adb commands.
Like the following command
adb shell am start -a android.intent.action.CALL tel:123456789
I tried using the following code to dial the call from the App
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://123456789"]];
Now I get different view, Is it possible to access the elements in this view from Javascript ? I would like to end the call after 5 seconds by simulating the End button
touch using some script. Is it feasible ?
Is there any API to accept and reject calls within the App?
I searched for this earlier but did not find any API.
I want to try it as an internal app and I don't want to submit in the AppStore and I am looking for non jail broken devices.
No, there is no API to interact with any of the phone features on an iPhone, other than openURL:

Sending input/parameters from iPhone to Computer?

I have an iPhone app built with PhoneGap (driven by AngularJS) that scans and processes barcodes just the way I want it to. I also have a webapp (also powered by AngularJS) that needs to accept barcode input and do similar processing. Since using a webcam to scan a barcode is not very elegant and I don't want to buy a barcode scanner for the computer running the webapp, I am trying to use the iPhone to scan a barcode (which already works) and send that data to my web application. Can anybody
I have thought about tethering the iphone to the computer with bluetooth, but have no idea how to send/receive bluetooth data through JavaScript. Should it be over wifi and use the AngularJS $http service?
You could use WebSockets and a library like Pusher:
http://pusher.com/docs/javascript_quick_start
It allows events to fire based on execution on another page. So on your scan success callback you can trigger an event which can send information to another web page simultaneously.

Catch Apple Remote events in webbrowser with JavaScript

Is there a chance to use the Apple Remote with my web browser (Safari, Chrome or Firefox)? For example, my HTML page makes a transition if I click the right or left arrow. I want to cause this transition not only by pressing a key but also by clicking on my Apple Remote (which is usually used with Frontrow).
The condensed question is: do I have the chance to catch Apple Remote events with JavaScript?
theres a few ways of doing that, one eould be to use max msp or pure data as a socket client to http://socket.io then capture the apple remote on max or pd and send the events to the socket server. another way would be finding a plugin for the browser that is able to interface between the controller and the javascript running in the current tab.

web app on mobiles with phonegap

I have a web application (chat room) in html + javascript that basically sends requests to the server every 5 seconds to check for new messages.
It already works on mobile but there are 2 main problems:
it does not beep (it works on pc) with new messages
when the browser is put on background, the javascript obviously stops being executed, therefore the connection to the server is lost and the client disconnected.
i was thinking of using phonegap not only to make it cross-platform but also to fix those problems stated above. would they be resolved with the use of phonegap?
thank you in advance.
phoneGap doesn't support custom push notification. it basically open a browser and expose you some native support via API.
in order to do some native actions like push notifications and/or sound playing i suggest you check out some of the plugins options available or even write your own for that.
Playing sounds can be done easily using the Media API. As for having the JavaScript run in the background it really depends on the OS. On Android the JS will continue to run if you leave the app via the home button but the back button kills the app so you would stop the JS. It is probably better to write a service that always runs in that case.
Alternatively you'd look at a push type solution to notify you of new messages.

Categories