Reputation: 141
I want to understand the communication between a web application written in Laravel and an Android one. I would like to know how should I structure the folders since they will have different functionalities for the web platform and for the mobile. Thanks in advance.
Upvotes: 0
Views: 5953
Reputation: 26258
You have to create WEB API
to achieve this.
What is an API?
In this sense an API - which stands for Application Programming Interface - allows for publicly exposed methods of an application to be accessed and manipulated outside of the program itself. A common usage of an API is when you wish to obtain data from an application without having to actually visit the application itself. To allow this action to take place, the application has published an API that specifically allows for foreign applications to make calls to its data and return said data to the user from inside of the external application.
Upvotes: 0
Reputation: 2856
To communicate across different platform you can use JSON
to pass the data and read that data.
In Laravel
just create the API
which returns JSON
data and access that API
in Android
using AsyncTask
, Volley
, HttpUrlConnection
, OkHttp
.
Just search on the internet you will find lots of resources.
Check this link to create API
in Laravel
.
Upvotes: 1
Reputation: 48
Firstly, write the Web API using the Lavarel to enhance communication between the android app and the web application. Ensure you test the json file using Postman to check if it returns valid json parameters. Then use either Retrofit, Volley in Android to communicate with the android application to parse JSON objects to enable access to information at real time...
Upvotes: 0