So my app has one of the objectives being selection of hospital and showing route to it.
Initially, my app has to send a request signal to a hospital (application). The route to hospital must be shown iff the hospital app sends back an acknowledgement. Otherwise, the route to the nearest hospital needs to be viewed.
Is it possible to communicate between two apps for acknowledgement/request signals? How?
What should be done to show the route to the nearest hospital from a list of hospitals? I am already able to dind the closest hospital between two hospitals. If this list is to be made on a spreadsheet, how can I obtain/calculate the latitude and longitude to find the closest hospital?
Answers were provided there to most of the questions you have now. What have YOU done? Show us your code and someone should provide specific advice.
Your new question: “Is it possible to communicate between two apps for acknowledgement/request signals? How?”
Yes. You could use a shared app that does a ‘chat’. Use either a CloudDB and your own server (you are building a commercial app) or the experimental FirebaseDB. How to do this depends on exactly what information needs to be exchanged and what needs to be done. This communication could also be initiating a phone call to the hospital.
You also asked “What should be done to show the route to the nearest hospital from a list of hospitals? I am already able to dind the closest hospital between two hospitals. If this list is to be made on a spreadsheet, how can I obtain/calculate the latitude and longitude to find the closest hospital?” Part of the answer is in the old Forum"
… The Line component can be used to show the straight-line distance. If you need to show a route , use this tutorial that shows how to do display a route with the Map component and OpenStreetMap tiles HOW TO use the new Map Control. plot a route and post driving distance and time .
do something similar (calculate distance and display a route)
There are six ways to determine a route I am aware of:
Use the Google Map API and a distance matrix using JSON
Use the OpenStreetMap example OpenStreetMaps provides free distance/route information. HOW TO use the new Map Control. plot a route and post driving distance and time describes how to use it. It is a ‘free’ service however excessive usage will get charged. This example also shows how to determine the closest location from a List of all locations. Use that to determine the closest hospital nearest another hospital by slightly adapting the code.
The ActivityStarter to launch Google’s Navigate app
What don’t you understand? We are glad to help. Sharing your code so far with the forum by posting your blocks and a better explanation of how you think this would work would help.
I have hereby attached the entire blocks of my project so far.
As you can see, as soon as the screen is initialized, the app shows the route to one particular location. Now, this needs to be done only after it correctly receives an acknowledgement from the hospital.
I tried out the app suggested by Taifun and the apps can chat to send messages. I need to employ this as a way to get acknowledgement. The route to the primary hospital should be shown only after the acknowledgement is received. Else (if negative acknowledgement is received), the route to the nearest hospital should be shown. This nearest hospital is to be found from a list of hospitals, which I tried to do using the Algerian Pharmacy example. But the required routes are not being shown and the old Pharmacy markers are still visible.