“In my project, I have written code for navigation, but when I press ‘Start’, it does not navigate. It is not showing the correct route, only a rough sketch from the source to the destination is on the map. Could you please tell me how to start navigation when the ‘Start’ button is pressed and correct route when zoomed in ?”
error type=1400 audit(1733992702.496:141827): avc: denied { ioctl } for pid=17240 comm=“AnalyticsWorker” path=“/data/data/com.example.test4/databases/mappls_svgsfse” dev=“dm-52” ino=1908778 ioctlcmd=0xf522 scontext=u:r:untrusted_app:s0:c116,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c116,c257,c512,c768 tclass=file permissive=0 SEPF_SM-E236B_12_0001 audit_filtered
2024-12-12 14:08:22.499 923-923 audit auditd E type=1327 audit(1733992702.496:141827): proctitle=“com.example.test4”
2024-12-12 14:08:22.900 17240-17240 AnimatorSet com.example.test4 D mRe
public class MainActivity extends AppCompatActivity implements OnMapReadyCallback {
private MapView mapView;
private MapplsMap mapplsMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initialize the Mappls SDK
MapplsAccountManager.getInstance().setRestAPIKey("c5bba1ac3");
MapplsAccountManager.getInstance().setMapSDKKey("c57-31ac3");
MapplsAccountManager.getInstance().setAtlasClientId("");
MapplsAccountManager.getInstance().setAtlasClientSecret("l");
Mappls.getInstance(getApplicationContext());
setContentView(R.layout.activity_main);
// Initialize the MapView
mapView = findViewById(R.id.map_view);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this); // Load the map asynchronously
}
@Override
public void onMapReady(@NonNull MapplsMap mapplsMap) {
this.mapplsMap = mapplsMap;
// LatLng point=new LatLng(destinationLat,destinationLng);
Point point = Point.fromLngLat(77.5946, 12.9716); // Longitude, Latitude (example: Bangalore)
// Initialize a DirectionPoint with the Point, place name, and place address
DirectionPoint directionPoint = DirectionPoint.setDirection(point, "Bangalore", "Karnataka, India");
DirectionOptions directionOptions = DirectionOptions.builder()
.resource(DirectionsCriteria.RESOURCE_ROUTE_ETA)
.profile(DirectionsCriteria.PROFILE_DRIVING)
.overview(DirectionsCriteria.OVERVIEW_SIMPLIFIED)
.excludes(Arrays.asList(DirectionsCriteria.EXCLUDE_FERRY))
.showAlternative(false)
.steps(true)
.showStartNavigation(true)
.destination(directionPoint)
.build();
DirectionFragment directionFragment = DirectionFragment.newInstance(directionOptions);
getSupportFragmentManager().beginTransaction()
.add(R.id.map_view, directionFragment, DirectionFragment.class.getSimpleName())
.commit();
directionFragment.setDirectionCallback(new DirectionCallback() {
@Override
public void onCancel() {
System.out.println(“in cancel”); }
@Override
public void onStartNavigation(DirectionPoint origin, DirectionPoint destination, List<DirectionPoint> waypoints, DirectionsResponse directionsResponse, int selectedIndex) {
//Get the origin, destination, waypoints, directionsResponse and the selected Index
System.out.println("in onStartNavigation");
}
});
}