This is the first time I ask something, so if there is something wrong just tell me and I´ll try to fix it ASAP.
We have a customer that wants us to login in their servers with a native Android app, but without giving us a custom way to do this. They want us to use the current website they have to log and, after authentication takes place, retrieve within the browser a XML which contains the data we need. After that, use the data in the native app. All of this with the user not knowing/seeing that a browser is being used. A total mess IMHO.
Of course, I have never tried this approach in the past and my first tests make me feel like this is impossible (or extremely difficult) to achieve. Whenever I try to load the URL in a hidden WebView the default browser pops up showing the website.
My main question is, is it possible to load a webview and work with it (invoke javascript, etc...) in the background?
Thank you.
You can do it without AsyncTask and you can hide the splash screen when the page loaded without a timer. WebViewClient class has a method onPageFinished() which will be called once the page has been loaded. You can make use of it. In you project folder, place your splash screen images with name 'splash_screen.
Solution. After searching a lot, I found this thread. I did something similar: Just extend WebView and override onWindowVisibilityChanged . This way, the audio continues to play if the screen is locked or another app is opened.
Beginning October 5, 2021, Facebook Login will no longer support using Android embedded browsers (WebViews) for logging in users.
If you want to deliver a web application (or just a web page) as a part of a client application, you can do it using WebView . The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout.
You could set the WebView to hidden by default with the attribute android:visibility="gone", interact with it at runtime then when you need to show it to the user after you've loaded data, just call setVisibility(View.VISIBLE)
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With