Discover devices vendor and model on a local network - javascript

I need to find out if it's possible and if so, what is the API for that.
The required scenario:
connect to a wifi network.
from an android app or using javascript from a webpage find out the make and model of devices that are connected to the same router.
I found a way to find the IP addresses, and I saw that Find app can see the manufacturers, but can't tell if it's a mobile device, a tablet, a laptop or a printer.
I thought that a possible way would be to use jmDNS (which I can't get my android project to compile with), and service discovery, but I'm not sure that it will tell me if the device is a tablet or a smartphone.
For Android I can also think of the linux build number to search against a device list compatible with that build. However, I'm not sure about Apple devices.
Is there a way to do that or am I wasting my time?
If there is, will it work in Android or with JS?
Thanks.

Related

Solution for identify mobile devices by mobile browser

I'm wondering it's possible to identify android device by web app running on mobile web browser? And this solution have to still working after change or upgrade web browser on this phone.
My second doubt is web app can working offline on phone showing PDF presentations saved in local storage (disk). When I have internet connection I can manually sync presentations (some are removed and some are downloaded).
If PWA app can work like I described above or in this case we need to use (hybrid) mobile app ?
PWAs allow to cache assets and make them available to the users even when they are offline. There are some functionalities that only Native Apps have (eg. access to a device contacts), but they are very close under many other aspects.
I wrote an article about Service Workers and caching strategies where I explain how to cache static assets as well as HTTP GET calls. It is part of a series about PWAs, so you might find it useful to get more insights about this technology.
Have a look at the website what web can do today to have a list of WEB APIs currently available:
I do not know the detail of your requirements, but maybe you do not even need to implement an hybrid app and simply create a PWA.

Testing/Debugging a Phonegap iOS app in Windows

I have a simple app, created using PhoneGap [Build]. Signed up for a developer account and got the app actually signed & installed in a test iPhone I borrowed. The app works perfectly on Android, and testing it in a browser. However on an iPhone, it hangs at the 'intro' screen.
Apparently, to debug it I'd need a Mac, specifically Safari v6+ [dev tools], which isn't available for windows.
I just simply need a way to see the console / errors for what is going on. I have been searching and trying different methods for 3 days now, and have hit a dead end.
Figured I'd add what I ended up doing for anyone else searching for this down the road...
The easiest way to do this was to install MacOS on VMWare. This video was particularly helpful (https://www.youtube.com/watch?v=3b04Da1WjBc).
Then, under the USB controller in VMWare make sure to select USB 2.0 & 'Show all'. Then all you should have to do is enable Safari Developer Tools under preferences on your VM, plug in your phone, and you're good to go. Was 10 times easier than every other description I found on the web.
Edit: Also, do not allow the OS to update, that will kill it.

Android/iPhone device connection via USB in NodeJS

I need to connect android/iPhone device via USB with a PC. An program written in NodeJS should be able to detect the device and get information and perform some operation on the device like reboot and reset.
Anyway, I've tried some libraries like node-usb but I'm not able to send command to the device or perform any task like that.
For iOS there's some library libimobiledevice but couldn't find any nodeJs wrapper.
Maybe I'm missing something here, any help will be appreciated.
Thanks is advance.
Don't know for iOs, but I don't think it is possible in Android. The reason is with permissions: it would rather be a bug then a feature if someone could just plug in a USB and shutdown your device without asking.
So, maybe if you would ask permissions for access and such, maybe.
Android App with Popup is possible.
And that is with Apps, not with NodeJS, it's not native to either iOs or Android.

How do I test a HTML5 and Javascript Application on Smart TV's?

I'm building a TV application using a framework called TAL (TV Application Layer), which is a Javascript framework for building an HTML5 based TV app.
I can run my application on localhost and test it in my browser. I can also test the app quite easily on the Amazon Fire TV using Amazon's Web App Tester tool, which accesses the web app running on my computer via my WiFi network and then runs it on the TV.
However, I'm struggling to find a general approach to test this app on other set top boxes or smart TVs.
Do I have to download the SDK for each individual device and package it up somehow? If so, what is the general approach for this?
The documentation from individual manufacturers only seems to focus on using their SDK to build the app, and doesn't offer support about an HTML5 app that you've created yourself.
As I'm just starting out on this, any pointers in the right direction would be much appreciated.
If the TV and your dev machine are on the same network you should find out the internal ip-address for your dev machine. On OS X and Linux you can type ifconfig in the terminal. Look for a line that looks like this:
inet addr:10.2.0.15 Bcast:10.2.0.255 Mask:255.255.255.0
The addr: part lists your ip address. In this case it would be 10.2.0.15.
If you type this ip address into the address bar of your smart tv browser you should be able to view your website on the Smart tv.
I'm not sure about actual apps for the TV, I do think it will be different for each brand and that you will have to package it up individually.

Phonegap app working locally, not working on phone

I have written a phonegap application, and it performs a pretty simple task, it gets some JSON from a YQL link, and then displays it nicely to the user. This works excellently when I run it using Google Chrome on a Desktop, but, my client tells me that it does not work on his device which is Android 2.3. What can be going wrong? I'm using phonegap build to build to app, and they tell me that it is given internet permission, but, when my client puts the APK on the phone (its not on the market yet), does he need to do something special for it to access the internet?
Thanks a lot,
Dhaivat
in phonegap, allow external host : Open phonegap.plist -> external host and add your url or * to allow all
within the phonegap app the webapp runs under the file:// protocol - this might affect things.
you should test this at least on an emulator yourself - clients usually screw up anything some might screw up when testing ;) best would be to test on an actual device tho.
I'm not sure if this will help but I had a similar problem testing my app here:
https://stackoverflow.com/questions/17496104/json-wordpress-feed-not-appearing-in-android-studio-emulator-using-phonegap
I needed to change access origin to ="*"/ in my config.xml

Categories

Resources