Answer the question
In order to leave comments, you need to log in
How in android - java to perform http request and webview to the same server at the same time?
There is a web server in PHP (Apache).
In the application for android, WebView works to view the site, which is a page with settings. Separately, a service works that, through an http request, accesses the same server, after which it performs some actions.
The bottom line is that the http request may be delayed and at that moment the WebView request will not be processed, because it will be queued.
I understand that this is apache throwing both connections to one worker, ala browser.
What are the options in this case, how does the web server understand that this is the same client and how can the GET request be modified so that the server does not understand that this is the same client as in the webView.
Answer the question
In order to leave comments, you need to log in
Maybe it's not the server, but the executor. As a version: if the service uses AsyncTask, and the task is executed in the default executor, it makes sense to change task.execute() to task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR) - then two requests to the server (from the service and from the WebView) will be be executed in different executors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question