Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019

30 visualizaciones

Publicado el

When was the last time you were truly lost? Thanks to the maps and location technology in our phones, a whole generation has now grown up in a world where getting lost is truly a thing of the past. Location technology goes far beyond maps in the palm of our hand, however. In this talk, we will explore how a ridesharing app works. How do we discover our destination?How do we find the closest driver? How do we display this information on a map? How do we find the best route?To answer these questions,we will be learning about a variety of location APIs, including Maps, Positioning, Geocoding etc.

Publicado en: Tecnología
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019

  1. 1. How to build your own ride-share app Richard Süselbeck Amsterdam | April 2-3, 2019
  2. 2. How do they do that?
  3. 3. Richard Süselbeck Principal Developer Evangelist HERE Technologies @sueselbeck @heredev https://developer.here.com
  4. 4. 2018-08-29 12.52.24.jpg
  5. 5. 2018-08-29 12.52.24.jpg
  6. 6. 2018-08-29 12.52.24.jpg
  7. 7. Where to? Pickup: 72 Noble St, Brooklyn Confirm ride
  8. 8. "Where am I?"
  9. 9. "Where am I?" Positioning API
  10. 10. PositioningManager positioningManager = PositioningManager.getInstance(); positioningManager.start(PositioningManager.LocationMethod.GPS_NETWORK); GeoCoordinate coordinate = positioningManager.getPosition().getGeocoordinate(); String locationString = coordinate.getLatitude() + "," + coordinate.getLongitude(); Toast.makeText(getApplicationContext(), locationString, Toast.LENGTH_SHORT).show();
  11. 11. PositioningManager positioningManager = PositioningManager.getInstance(); positioningManager.start(PositioningManager.LocationMethod.GPS_NETWORK); GeoCoordinate coordinate = positioningManager.getPosition().getGeocoordinate(); String locationString = coordinate.getLatitude() + "," + coordinate.getLongitude(); Toast.makeText(getApplicationContext(), locationString, Toast.LENGTH_SHORT).show();
  12. 12. PositioningManager positioningManager = PositioningManager.getInstance(); positioningManager.start(PositioningManager.LocationMethod.GPS_NETWORK); GeoCoordinate coordinate = positioningManager.getPosition().getGeocoordinate(); String locationString = coordinate.getLatitude() + "," + coordinate.getLongitude(); Toast.makeText(getApplicationContext(), locationString, Toast.LENGTH_SHORT).show();
  13. 13. PositioningManager positioningManager = PositioningManager.getInstance(); positioningManager.start(PositioningManager.LocationMethod.GPS_NETWORK); GeoCoordinate coordinate = positioningManager.getPosition().getGeocoordinate(); String locationString = coordinate.getLatitude() + "," + coordinate.getLongitude(); Toast.makeText(getApplicationContext(), locationString, Toast.LENGTH_SHORT).show();
  14. 14. "Where am I?" 40.728215,-73.958251
  15. 15. "Where am I?" 52.38326, 4.92032
  16. 16. We are currently at 52.38326, 4.92032. What does that mean? Latitude & Longitude Latitude Longitude Equator Prime Meridian +60 -30 -90 (South) +90 (North) 180 -120 (West) +30 (East)
  17. 17. Where does the lat/long come from?
  18. 18. Where does the lat/long come from? GPS
  19. 19. GNSS Where does the lat/long come from?
  20. 20. GPS, GLONASS, GALILEO, BeiDou, IRNSS, QZSS Where does the lat/long come from? GNSS
  21. 21. "Where am I?" 40.728215, -73.958251
  22. 22. "Where am I?" 40.728215, -73.958251
  23. 23. Maps API "Where am I?"
  24. 24. Making maps is hard
  25. 25. Making maps is hard
  26. 26. m_map.setCenter(new GeoCoordinate(40.75051,-73.99335), Map.Animation.NONE); m_map.setMapScheme(Map.Scheme.HYBRID_NIGHT_TRANSIT); m_map.setLandmarksVisible(true); m_map.setZoomLevel(17); m_map.setTilt(45);
  27. 27. "Where am I?"
  28. 28. "Where am I?" Pickup: 72 Noble St, Brooklyn
  29. 29. Geocoder API "Where am I?" Pickup: 72 Noble St, Brooklyn
  30. 30. Geocoder API Gedempt Hamerkanaal, 1021 Amsterdam, Nederland52.38344, 4.92044 72 Noble St, Brooklyn, NY 11222, USA 40.728215, -73.958251
  31. 31. GeoCoordinate pickup = new GeoCoordinate(40.728215,-73.958251); ReverseGeocodeRequest2 revGeocodeRequest = new ReverseGeocodeRequest2(pickup); revGecodeRequest.execute(new ResultListener<Location>() { @Override public void onCompleted(Location location, ErrorCode errorCode) { updateTextView(location.getAddress().toString()); } });
  32. 32. GeoCoordinate pickup = new GeoCoordinate(40.728215,-73.958251); ReverseGeocodeRequest2 revGeocodeRequest = new ReverseGeocodeRequest2(pickup); revGecodeRequest.execute(new ResultListener<Location>() { @Override public void onCompleted(Location location, ErrorCode errorCode) { updateTextView(location.getAddress().toString()); } });
  33. 33. GeoCoordinate pickup = new GeoCoordinate(40.728215,-73.958251); ReverseGeocodeRequest2 revGecodeRequest = new ReverseGeocodeRequest2(pickup); revGecodeRequest.execute(new ResultListener<Location>() { @Override public void onCompleted(Location location, ErrorCode errorCode) { updateTextView(location.getAddress().toString()); } });
  34. 34. "Where are the drivers?" Pickup: 72 Noble St, Brooklyn
  35. 35. "Where are the drivers?" Pickup: 72 Noble St, Brooklyn
  36. 36. "Where are the drivers?" Pickup: 72 Noble St, Brooklyn Positioning API
  37. 37. "Where am I going?"200 Central Park W Pickup: 72 Noble St, Brooklyn
  38. 38. "Where am I going?"200 Central Park W Pickup: 72 Noble St, Brooklyn 200 Central Park W, New York 200 Central Park S, New York 200 Central Park N, New York 200 Central Ave, Brooklyn
  39. 39. Geocoder Autocomplete API 200 Central Park W Pickup: 72 Noble St, Brooklyn 200 Central Park W, New York 200 Central Park S, New York 200 Central Park N, New York 200 Central Ave, Brooklyn "Where am I going?"
  40. 40. http://autocomplete.geocoder.api.here.com/6.2/suggest.json ?app_id=MY_APP_ID &app_code=MY_APP_CODE &query=200+central+park &prox=40.76863,-73.97626,3000
  41. 41. http://autocomplete.geocoder.api.here.com/6.2/suggest.json ?app_id=MY_APP_ID &app_code=MY_APP_CODE &query=200+central+park &prox=40.76863,-73.97626,3000
  42. 42. http://autocomplete.geocoder.api.here.com/6.2/suggest.json ?app_id=MY_APP_ID &app_code=MY_APP_CODE &query=200+central+park &prox=40.76863,-73.97626,3000
  43. 43. http://autocomplete.geocoder.api.here.com/6.2/suggest.json ?app_id=MY_APP_ID &app_code=MY_APP_CODE &query=200+central+park &prox=40.76863,-73.97626,3000
  44. 44. { "suggestions": [ { "label": "United States, NY, New York, 200 Central Park W", "language": "en", "countryCode": "USA", "locationId": "NT_srx4m-dHrwiUBDnXi3NAwD_yADM", "address": { "country": "United States", "state": "NY", "county": "New York", "city": "New York", "district": "Upper West Side", "street": "Central Park W", "houseNumber": "200", "postalCode": "10024" }, "matchLevel": "houseNumber" }, { "label": "United States, NY, New York, 200 Central Park S", ... }, ... ] }
  45. 45. "Where am I going?"american museum of Pickup: 72 Noble St, Brooklyn American Museum of Natural History American Museum of the Moving Image Museum of the American Gangster Museum of Chinese in the Americas
  46. 46. Places API american museum of Pickup: 72 Noble St, Brooklyn American Museum of Natural History American Museum of the Moving Image Museum of the American Gangster Museum of Chinese in the Americas "Where am I going?"
  47. 47. DiscoveryRequest request = new SearchRequest("american museum of"); GeoCoordinate manhattan = new GeoCoordinate(40.71451, -74.00602); request.setSearchCenter(manhattan); request.setCollectionSize(5); request.execute(new SearchRequestListener()); class SearchRequestListener implements ResultListener<DiscoveryResultPage> { @Override public void onCompleted(DiscoveryResultPage data, ErrorCode error) { List<DiscoveryResult> items = data.getItems(); for (DiscoveryResult item : items) { PlaceLink placeLink = (PlaceLink) item; // display information } } }
  48. 48. DiscoveryRequest request = new SearchRequest("american museum of"); GeoCoordinate manhattan = new GeoCoordinate(40.71451, -74.00602); request.setSearchCenter(manhattan); request.setCollectionSize(5); request.execute(new SearchRequestListener()); class SearchRequestListener implements ResultListener<DiscoveryResultPage> { @Override public void onCompleted(DiscoveryResultPage data, ErrorCode error) { List<DiscoveryResult> items = data.getItems(); for (DiscoveryResult item : items) { PlaceLink placeLink = (PlaceLink) item; // display information } } }
  49. 49. "How long does it take?" "How much does it cost?" "What is the route?" american museum of Pickup: 72 Noble St, Brooklyn American Museum of Natural History American Museum of the Moving Image Museum of the American Gangster Museum of Chinese in the Americas
  50. 50. "How long does it take?" "How much does it cost?" "What is the route?" Confirm ride 28 min - $24 - $29
  51. 51. Routing API "How long does it take?" "How much does it cost?" "What is the route?" Confirm ride 28 min - $24 - $29
  52. 52. CoreRouter router = new CoreRouter(); RoutePlan routePlan = new RoutePlan(); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(40.728215,-73.958251))); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(49.1947289, -123.1762924))); RouteOptions routeOptions = new RouteOptions(); routeOptions.setTransportMode(RouteOptions.TransportMode.CAR); routeOptions.setRouteType(RouteOptions.Type.FASTEST); routePlan.setRouteOptions(routeOptions); router.calculateRoute(routePlan, new RouteListener());
  53. 53. CoreRouter router = new CoreRouter(); RoutePlan routePlan = new RoutePlan(); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(40.728215,-73.958251))); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(49.1947289, -123.1762924))); RouteOptions routeOptions = new RouteOptions(); routeOptions.setTransportMode(RouteOptions.TransportMode.CAR); routeOptions.setRouteType(RouteOptions.Type.FASTEST); routePlan.setRouteOptions(routeOptions); router.calculateRoute(routePlan, new RouteListener());
  54. 54. CoreRouter router = new CoreRouter(); RoutePlan routePlan = new RoutePlan(); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(40.728215,-73.958251))); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(49.1947289, -123.1762924))); RouteOptions routeOptions = new RouteOptions(); routeOptions.setTransportMode(RouteOptions.TransportMode.CAR); routeOptions.setRouteType(RouteOptions.Type.FASTEST); routePlan.setRouteOptions(routeOptions); router.calculateRoute(routePlan, new RouteListener());
  55. 55. CoreRouter router = new CoreRouter(); RoutePlan routePlan = new RoutePlan(); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(40.728215,-73.958251))); routePlan.addWaypoint(new RouteWaypoint( new GeoCoordinate(49.1947289, -123.1762924))); RouteOptions routeOptions = new RouteOptions(); routeOptions.setTransportMode(RouteOptions.TransportMode.CAR); routeOptions.setRouteType(RouteOptions.Type.FASTEST); routePlan.setRouteOptions(routeOptions); router.calculateRoute(routePlan, new RouteListener());
  56. 56. private class RouteListener implements CoreRouter.Listener { public void onProgress(int percentage) { // Display a message indicating calculation progress } public void onCalculateRouteFinished(List<RouteResult> routeResult, RoutingError error) { mapRoute = new MapRoute(routeResult.get(0).getRoute()); map.addMapObject(mapRoute); updateTextView(routeResult.get(0).getRoute().getLength()); } }
  57. 57. private class RouteListener implements CoreRouter.Listener { public void onProgress(int percentage) { // Display a message indicating calculation progress } public void onCalculateRouteFinished(List<RouteResult> routeResult, RoutingError error) { mapRoute = new MapRoute(routeResult.get(0).getRoute()); map.addMapObject(mapRoute); updateTextView(routeResult.get(0).getRoute().getLength()); } }
  58. 58. private class RouteListener implements CoreRouter.Listener { public void onProgress(int percentage) { // Display a message indicating calculation progress } public void onCalculateRouteFinished(List<RouteResult> routeResult, RoutingError error) { mapRoute = new MapRoute(routeResult.get(0).getRoute()); map.addMapObject(mapRoute); updateTextView(routeResult.get(0).getRoute().getLength()); } }
  59. 59. ... "length": 9919, "travelTime": 1664, "maneuver": [ { "position": { "latitude": 40.728361, “longitude": -73.9582743 }, "instruction": "Head toward West St on Noble St. Go for 79 m.", "travelTime": 15, "length": 79, "id": "M1", "_type": "PrivateTransportManeuverType" }, { "position": { "latitude": 40.7282925, "longitude": -73.9590061 }, "instruction": "Turn right onto West St. Go for 239 m.", ...
  60. 60. "Which drivers are nearby?" Finding nearby drivers…
  61. 61. Isoline Routing API "Which drivers are nearby?" Finding nearby drivers…
  62. 62. Isoline Routing API "Which drivers can reach me in 10 minutes?" Finding nearby drivers…
  63. 63. https://isoline.route.api.here.com/routing/7.2/calculateisoline.json ?app_id={YOUR_APP_ID} &app_code={YOUR_APP_CODE} &mode=fastest;car;traffic:enabled &destination=40.728215,-73.958251 &range=600 &rangetype=time
  64. 64. https://isoline.route.api.here.com/routing/7.2/calculateisoline.json ?app_id={YOUR_APP_ID} &app_code={YOUR_APP_CODE} &mode=fastest;car;traffic:enabled &destination=40.728215,-73.958251 &range=600 &rangetype=time
  65. 65. https://isoline.route.api.here.com/routing/7.2/calculateisoline.json ?app_id={YOUR_APP_ID} &app_code={YOUR_APP_CODE} &mode=fastest;car;traffic:enabled &destination=40.728215,-73.958251 &range=600 &rangetype=time
  66. 66. Routing API Positioning API "Where is my driver?" "When does she arrive?" Where to? Your driver will arrive in 4 mins Confirm ride
  67. 67. $28.27 Thanks for riding with HERE, Richard! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac mi a sem viverra lobortis. Donec at massa vel nibh lobortis laoreet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent finibus facilisis nisi, id consectetur eros scelerisque non. Suspendisse ut ligula interdum, dictum velit vel, interdum erat. Sed vulputate laoreet tempus. Sed varius felis sed lorem semper commodo.
  68. 68. Thank you for riding with Richard! Give a compliment? @sueselbeck https://developer.here.com/

×