Can someone help me with a problem please.
I wrote an app a while ago which logs onto my company website to download scheduling information so I have it available offline. It uses Android’s WebView and javascript and has been working for ages but in the last few days is has stopped working. I suspect that the company has detected that it is not a true browser and blocks the requests. The reason for this is that I have written a very simple test program, all it does is load the url and I’m getting the same problem.
For testing this app I am using the Android Studio Code emulator.
I have tried the url in chrome on the emulator and it works fine however when calling the URL in the app it gets rejected.
The code is very simple so I am sure that its nothing I’ve done.
webView = (WebView)view.findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(MainActivity.weburl);
I’ve fetch the User Agent data and that is as follows.
From the App
Mozilla/5.0 (Linux; Android 11; sdk_gphone_x86 Build/RSR1.210722.013.A2; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36
and from chrome I get
Mozilla/5.0 (Linux; Android 11; sdk_gphone_x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36
I know they’re different but I have tried setting the User Agent to the one from Chrome as it still didn’t work. Not even sure if its User Agent that is being used so is there another parameter that the website could be using?
Many thanks in advance
4