Doubts in the creation of my App

Asked

Viewed 153 times

4

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

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

Another question, is how to authenticate the App on the server? I can’t understand this part, everything I see about Httpclient, does not say anything about user and password other than the Url.

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

  • I believe you could create a topic for home one of your questions. It makes it easier for those who answer.

1 answer

1

I need to create a way, to show on the customers screen, the "vendors" that are around at the time when he accesses the application, as the "vendors" are not fixed locations, are like the taxis of the taxi apps, I need this to be updated at all times.

Take the latitude and logitude of each supplier and each customer every 30 seconds, or any other time interval you find convenient. For suppliers you know to be stationary, you can decrease this time. Vendors who do not respond (because they are out of range or with the device off), you remove from the list and put again when they return to reply.

Another question is regarding finding the nearest customer provider, my idea is to create an updated table of locations in the web service, make a calculation in every table, using the customer location and see the smallest distance, I believe this takes a lot of time and processing.

How many are these suppliers? If it’s less than 10,000, it should be fast. 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 suppliers in these squares. Then you take only the suppliers that are in the customer square and the 8 neighboring squares.

Another question, is how to authenticate the App on the server? I can’t understand this part, everything I see about Httpclient, does not say anything about user and password other than the 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 if it matches the expected. It is important that they are properly encrypted, and one simple way to do this is to use HTTPS. But I think the details for that are already scope for another question.

  • Victor, so you mean there’s no faster way to make this "selection" of suppliers? Regarding HTTPS, I will look for know, but wanted to know the following, pro app be recognized by the server, even before the user is logged in, I believe the app has a permission and the user has other types, no?

  • I didn’t say there’s no faster way, there must be. But you don’t have to kill yourself to find the best solution there is. If you find one that works well and satisfactorily, then it already does. Anything, can optimize and improve later. As for the server, I am assuming that the server is yours and the URL is yours, and therefore the connections received in this URL will only make sense if they start from the App that is also yours, and therefore you put there in the App, the server and the connection what you want, including encrypted login+password. But if that’s not the case, explain it better.

  • Victor, thank you very much, I will try to do and now that I found this forum that has people who really help, I believe it will be more quiet.

  • Regarding the authentication of the App on the server, wanted a way of the App itself to authenticate on the server, I do not know if there is need, but before the authentication of the user, an authentication of the App itself, if someone "discover" the URL, avoid attacks, I do not know if it is necessary.

  • @brenoguto I can think of several ways to authenticate, but these details are not really my thing. I think this is worth a new question. :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.