Doubts in creating my App

4

I'm creating an App and I'm having some questions, I'm a beginner in Java and Android and some things I have no idea how to do.

I need to create a way, to show customers on the screen the "vendors" that are around when they access the application, as the "suppliers" are not fixed locations, they are like taxis in taxi apps , I need this to be updated at all times. Another question is with regard to finding the closest supplier of the customer, my idea is to create a table of updated locations in the web service, make a calculation in every table, using the customer's location and to see the smallest distance, I believe this will take a lot of time and processing.

Another question, is it like authenticating the App on the server? I can not understand this part, everything I see about the HttpClient, does not inform anything of user and password besides Url.

I have more doubts, but these are the ones that are killing me right now.

    
asked by anonymous 25.11.2014 / 22:46

1 answer

1
  

I need to create a way, to show customers on the screen the "vendors" that are around when they access the application, as the "suppliers" are not fixed locations, they are like taxis in taxi apps , I need to be updated at all times.

Take the latitude and logitude of each vendor and each customer every 30 seconds, or any other interval of time that you find convenient. For suppliers that you know to be stationary, you can shorten this time. Vendors that do not respond (because they are out-of-area or with the device turned off), you remove the list and boot again when they respond again.

  

Another question is with regard to finding the closest supplier of the client, my idea is to create a table of updated locations in the web service, make a calculation in every table, using the customer's location and see the shortest distance, I believe this takes a lot of time and processing.

How many are these suppliers? If it's less than 10,000, that should be quick. There are ways to optimize this, for example, divide the surface of the Earth that interests you in squares of 10 km x 10 km and place the suppliers in these squares. Then you only get the providers that are in the customer square and in the 8 neighboring squares.

  

Another question, is it like authenticating the App on the server? I can not understand this part, everything I see about the HttpClient, does not inform anything of user and password besides Url.

There are several ways to do this, but almost all of them involve the famous login and password. You send the login + password to the server and it checks to see if it hits as expected. It is important that they are properly encrypted, and a simple way to do this is to use HTTPS. But I think the details for this are already scope for another question.

    
26.11.2014 / 00:13