Writing to a Text File on a Web Server

Let’s recap. We are not able to exchange information between devices if we do not identify each party involved. One device needs to learn about the other through some kind of identifier. In addition, location information must be stored in such a way that both devices can access it. This is where the web server comes in. It functions as a shared place that can both store and serve information.

The location.php PHP script on the project server (serverURL) is set up in a way that it stores the location info of every identified device in a separate text file. You’ve already written your location to that server if you ran the sketch earlier. If you’d like to host your PHP script on your own server, you are ...

Get Rapid Android Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.