Iam developing android app with google map implemented. I have tried to make the marker rotate with the direction of moving (like navigation in google maps) but all tried codes failed. Below are the code. Any suggestion. Note(Iam getting the bearing from method that returns the location, speed and bering and I can see the float value of the bearing changes while changing the direction.
float bearing = setterandGetter.getBearing();
double lat = setterandGetter.getLatitude();
double lon = setterandGetter.getLongitude();
LatLng currentPosition = new LatLng(latitudelongitude);
googleMap.moveCamera(CameraUpdateFactory.newLatLng(currentPosition));
Marker marker = googleMap.addMarker(new MarkerOptions().position(currentPosition).icon(BitmapDescriptorFactory.fromBitmap(blueIcon)).flat(true).rotation(bearing));