I use fragement, I need to get my current location (lat and lng) and I need to calculate my current location with the destination.
Could you give me a hand. What is the best way to calculate location:
How can I get the distance from my current location and destination using lat and lng;
LocationManager locationManager; Location locatio; locationManager = (LocationManager)getActivity().getSystemService(Context.LOCATION_SERVICE); location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); String product_latitude = "3.121191"; String product_longtitude = "101.673298"; Double latitude = Double.valueOf(product_latitude); Double longtitude = Double.valueOf(product_longtitude);
source share