Simulate a Location in the Android Emulator Follow
This article discusses the Android Emulator, but this technique also works in the iOS Simulator.
When you’re developing your app with the Meridian Android SDK and previewing the app in the Android Emulator, you can simulate a “current location” in the app.
The Android Emulator doesn’t provide access to the Bluetooth hardware on your computer, which means it can’t determine location using Beacons or Wi-Fi.
Fortunately, you can simulate a location. Here’s how to do that:
Go to the desired floor in the Meridian Map Editor.
Add a Simulated Location
Click the location on the map you want to simulate, and then press the lowercase L key. A dialog will appear with the message, “Simulated Location Set”. After a short time, the simulated location you set in the Editor will appear as a pink dot in the Android Emulator.
Remove a Simulated Location
Click anywhere on the map, and press Shift+L. A dialog will appear with the message, “Simulated Location Removed”.
Simulate a Location in Android Aruba Meridian
In addition to simulating a blue dot in the Android Emulator, you can also do this in the Android Aruba Meridian application after adding the simulated pink dot in the Editor. Just enable "Use Simulated Location" in the About screen.
Simulate a Location on an Android Device
In addition to simulating a blue dot in the Android Emulator, you can also do this on your Android device using the following Meridian SDK code after adding the simulated pink dot in the Editor.
public static final String EDITOR_TOKEN = "090c29d8b4cc628e4bd327abf37f62e4e3477bae";
// Configure Meridian
Meridian.configure(this, EDITOR_TOKEN);
// Example of enabling simulated location
Meridian.getShared().setForceSimulatedLocation(true);
The application token above is for the Android SDK Sample app. If you’d like to simulate a blue dot for your location, generate a token for your location in the Meridian Editor.
Comments
0 comments
Please sign in to leave a comment.