How to transfer data from a web browser back to a native Android application

Our Android application has a WebView that displays a page from our web server. A user is registered on the page (via Facebook or by choosing a username and password). After that, I want the page to pass information back to my own application (for example, username, type of license, message, etc.).

I know the JavaScript ↔ Java binding (addJavaScriptInterface), but wondered if there is another way:

+5
source share
1 answer

After the user logs in, you can capture data from the URL using WebView :: getUrl (). You can also use cookies.

http://pragungoyal.com/tutorials/extracting-cookies-from-a-webview-in-android/

+1

All Articles