I am building my android apps in Cordova, but i dont want my apps are able to run on emulators like BlueStacks,nox player etc. I need to detect if the platform is a real device like mobile,tab,tv etc or a virtual device like emulators. I already checked with cordova-plugin-device. but on BlueStacks it returns false in virtual parameter.
i want a code snippet to detect if the device is real or virtual.
2 freelancers are bidding on average ₹1650 for this job
Using the class navigator, we could detect the App version, nono matter how close it is to an Android version, there would still be something missing...all we have to do is exploit that.
The code snippet I will provide will detect whether its a real device or not by using some native apis that are dependent on the hardware properties only found on a phone. Very simple and straightforward.