How can an Android interface use a PHP server?

I am working on a chess site, and I have implemented rule checking in PHP, and I use it on my main site at http://www.chesslords.net/ , but for now I am working on the Android interface. However, after I added the event and drew correctly in my project, I would like to use my foo.php from my bar.java, calling rulechecker to create slots. Do you know how to do this? Thank you in advance for your reply.

+3
source share
4 answers

Your PHP server should provide an API for the network. It does not have to be a specific API or technology (SOAP, JSON, REST, XML-RPC, etc.). Almost everyone will work as long as you agree to one technique. Having said that, REST api with JSON-encoded data is especially suitable for Android mobile applications.

Here is an article about creating a REST API in PHP for your server: http://www.gen-x-design.com/archives/create-a-rest-api-with-php/

In one of these years, Google IO talks about consuming the REST API on Android: http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html

These two links should at least get started.

API - , , PHP, , , .

, , Android .

+2

PHP URL-, HTTP-, - , URL-, openConnection(), .

+1

java.net.HttpUrlConnection

0

Source: https://habr.com/ru/post/1752065/


All Articles