0

I am new in android. I fetched my current location using FusedLocationProviderClient and i have also fetched location from sever. I want to draw a route and navigation as well from my current location and fetched location as well.

locationProviderClient.getLastLocation().addOnSuccessListener(View_Specfic_Room.this, new OnSuccessListener<Location>() {
                    @Override
                    public void onSuccess(Location location) {

                        if (location != null) {
                            Toast.makeText(View_Specfic_Room.this, "Location Is:" + location.toString(), Toast.LENGTH_SHORT).show();
                            System.out.println("Location is :" + location.toString());
                        } else {
                            Toast.makeText(View_Specfic_Room.this, "Else location is", Toast.LENGTH_SHORT).show();
                        }
                    }
                });

Here is my current location. I just want that by just clicking a button a roue is draw between my current location and fetched location from server. Maybe its a duplication question but i don't know to get it.

  • try this answer https://stackoverflow.com/a/17007360/9060917 – Praveen Feb 04 '19 at 06:34
  • @Adnan Ijaz have you tried this -> https://www.journaldev.com/13373/android-google-map-drawing-route-two-points and https://www.specbee.com/blogs/android-tutorials-google-map-drawing-routes-between-two-points Instead of second point you have to take your server lat lng for getting exact destination point in map – Nilesh Panchal Feb 04 '19 at 06:35

0 Answers0