My Android app has an app widget associated with it that updates every 10 minutes on an Android device. These updates send HTTP requests for data to the servers and analyze the serverβs response and update the application as needed.
At the moment, if you send this URL from browsers on your laptop or PC, the server will respond and update everything that is required in the database on the server.
What I want to do is when HTTP requests are received on the server, I want to determine if the request came from my Android application from an Android device, and then responded with data. I would like to change the PHP code on the server so that they display or redirect to some page if the HTTP request came from a browser or everything else except my Android application.
Typical HTTP requests from applications are similar to http://example.com/abc.php?usera=abc&datab=xyz
I do not want to respond to this URL in the same way if it comes from anywhere other than an Android application. Is it possible? Which would be a good way to achieve this.
Thank you for your help.
source
share