mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

Navigation along the route is being simulated regardless of the setting #7126

Open cuifei opened 1 year ago

cuifei commented 1 year ago

Android API: Android 13 Mapbox Navigation SDK version: 2.10.4 implementation "com.mapbox.navigation:android:2.10.4" implementation "com.mapbox.navigation:ui-dropin:2.10.4"

Steps to trigger behavior

  1. Activity path com.mapbox.navigation.examples.standalone.turnbyturn.TurnByTurnExperienceActivity

  2. MapboxNavigationApp.setup( NavigationOptions.Builder(this) .accessToken(getString(R.string.mapbox_access_token)) // comment out the location engine setting block to disable simulation //.locationEngine(replayLocationEngine) .build() )

  3. Install Mapbox Navigation example App

Expected behavior

disable simulation

Actual behavior

test machine huawei、meizu Navigation along the route is being simulated regardless of the setting , but is okay in test machine xiaomi

jonars99 commented 1 year ago

@cuifei It looks like you're using the NavigationView Drop in so you can reference that to set replay to false (Docs):

layout xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.myapplication.NavigationViewActivity"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    >

    <com.mapbox.navigation.dropin.NavigationView
        android:id="@+id/navView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:accessToken="@string/mapbox_access_token"
        />

</RelativeLayout>

Activity

class NavigationViewActivity : AppCompatActivity() {

    private lateinit var navigationView: NavigationView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        navigationView = findViewById(R.id.navView)
        navigationView.api.routeReplayEnabled(false)
    }
}