Is there a way to restrict a website to display only on Android?

I am working on the launch of payment methods technology in marketing.

Over the past few months, I have been studying some HTML, CSS, and some basic Javascript.

I am currently working on an Android application that allows users to check their balance online (based on an HTML page).

For security reasons, I want to restrict the website to make sure that the website is only available in the Android application (so that users cannot access the page on the desktop).

+5
source share
3 answers

Yes, there are several ways to get around this based on what you want to do and how you play the page, but in your code you can specifically look for a secret message variable that will only run remote code if this entry contains this code. Another way is for the application to create a specific unique "hash" that is stored in a remote database for this unique device. Then, when the application requests a remote file that runs some code, it should send this unique identifier, which was previously registered only by Android devices. this unique key is sent to the server for verification before the remote code can be run.

+2
source

You can use this JS to check user'OS

var test = navigator.userAgent.toLowerCase(); var isAndroid = test.indexOf("android") > -1; if(!isAndroid) { // Do something! // Redirect to Android-site? alert(test); } 
+2
source

I think you can make an Android app in HTML / CSS / JS from the Cordova Framework. Here is the Apache Cordova project documentation -> https://cordova.apache.org/

+1
source

Source: https://habr.com/ru/post/1262397/


All Articles