Home > Blockchain >  How do I start from a different location in Android Studio with Mapbox?
How do I start from a different location in Android Studio with Mapbox?

Time:10-14

The Mapbox API allows integration of map services into Android Studio applications. I'm using it to create a new navigation application. It doesn't follow the device's location but always starts in San Francisco this is ok for my purposes. However, I can't figure out where to change the starting location.

Link to the Code I'm using:

https://github.com/mapbox/mapbox-navigation-android-examples/blob/main/app/src/main/java/com/mapbox/navigation/examples/turnbyturn/TurnByTurnExperienceActivity.kt

I think it should be changeable here somewhere. Thanks for any answers!

CodePudding user response:

You can use mock location in emulator.

  1. Open emulator.
  2. Download any mock location app from play store in emulator (you can also side-load apk by drag and dropping apk in emulator).
  3. In phone settings, go to mock location (System-> Developer Options -> Select mock location app) and select that mock location app you installed.
  4. Select your desired location from mock location app.

some mock location apps on play store -:

https://play.google.com/store/apps/details?id=ru.gavrikov.mocklocations

https://play.google.com/store/apps/details?id=com.lexa.fakegps

CodePudding user response:

Found my own Answer, it is changeable within the function: onStartNavigation()

  • Related