As a school project, I'm building a PHP and Android app for a fake company. Let's call the company "Express Food", which can talk pretty much by itself.
The "daily meals" are kept by deliverymen who wait in streets for a delivery, we say that these deliverymen are inactive. When a customer orders the meal, the nearest inactive deliveryman is requested to deliver the meal to the customer in less than 20 minutes, which is the guaranteed maximum delivery delay to the customer.
I need to build a Web app from which customers can order and administrators can administrate the site. I'm thinking to build an Android app for the deliverymen to handle deliveries.
The problematic specifications
1) The server should be able to retrieve the current deliveryman's position anytime it needs it (latitude + longitude). For example to populate the
currentPosition property of the
In this context, is it possible to make the PHP server retrieve the deliveryman's current position from his Android mobile? I mean it doesn't even sound natural since the server is requesting something from the client?? But how to do that the good way then?
2) When a customer orders a meal, the order's
status is on
'pendingHandling', waiting for the nearest inactive deliveryman to handle it.
Could the server send a delivery handling request to the nearest inactive deliveryman or rather the mobile app should request
pendingHandling orders on a defined frequence?
3) Once the deliveryman accepts to handle the delivery, his real time position has to be shown to the customer's delivery tracking web page.
What would you suggest here? How could I display the real time position of the deliveryman on the web page?
4) The workday route of the deliveryman (as active AND inactive) has to be recorded.
Is there another way to do that than to store on a high frequence deliveryman's actual positions to define from them his workday route?
The reason of my questions
Forgive me for the multiple questions. I hope also they are not too broad. I can't post these 4 questions separately since the way we resolve one depends on the way we approach the other. The questions should be approached contextually as a whole problem.
I'd need to know the global strategy to adopt defined by which direction to take, which technologies, protocols, APIs to use in this context. I don't have yet the necessary insight to approach this problem by myself only.
Thanks by advance.