We've now got permission to track the user's location.
Now we can start to add in some code right here to actually start that tracking.
But before we do there's one extremely important thing we need to consider.
Remember the entire goal of our application is to track the user's location as they walk around the
world.
So I got a quick question for you.
How are you going to effectively test this in a dev environment especially if you're running this application
on a physical phone.
Does that mean that whenever we want to test out this map right here we need to like save our code open
up the application and then start walking around the block.
Well obviously that would be really inconvenient.
So we need to think of some way some mechanism we could use to effectively test out our application
and have the user's location change over time without actually walking around the real world with some
test device.
So to do so we're going to use a little bit of trickery here.
First let me tell you that there are a couple of different ways that we can effectively test out an
application that has G.P.S. tracking on a simulated device like the two have got right here.
But these two methods don't work that well if you're on physical devices.
So if you are on simulators you can test out location changes inside of an application using the simulator
or emulator in particular on an OS simulator.
We can go to the menu bar find the debug option and then change the simulated location.
So for example on iPhone over here I can go to debug then location and I can set some different predefined
locations.
I can say there is no location that we're at.
I could put in a custom longitude latitude I can say put me at Apple headquarters or city run bicycle
run in freeway drive will all change location over some period of time to simulate a run a bike ride
or some freeway driving likewise on the android emulator.
We can hit that dot dot dot then go to location so on Android I'll hit dot dot dot right there and I
can pull up location.
So on location I can then change the latitude and longitude or alternatively I could load up a file
called a GP X or came file that has a predefined series of latitude and longitude points I can then
play back those series of points and they will be essentially simulated as the user's current location
on the device.
So clearly there is some mechanism on both iPhone and Android emulators to essentially test out a user's
location.
The downside is that both these I have found are really really buggy with Expo location in particular
for whatever reason on my OS emulator right here.
If I set location to city run and then refresh this thing while tracking my user's location.
Turns out that I'd actually never get some notification about the user moving around in the world.
And again I'm pretty sure that's coming has a bug through Expo location.
So clearly these two solutions right here.
Well kind of buggy.
And they also don't work at all.
If you have a fiscal IOW device or a physical Android device.
So we need some way that we can essentially test the user's location changing over time without having
to deal with these cross platform issues and make sure that it's just going to work 100 percent of the
time even if what we're using is kind of buggy so to actually test out a user's location we're going
to write out a little bit of code to essentially trick the expo location library.
We're going to write out some amount of code that's going to send out some fake readings on the user's
current longitude and latitude over time and we're going to use that as very simply a mechanism to test
out our application effectively while we are just sitting at our desk as opposed to having to actually
walk around.
Now could we have to write out is just a little bit long.
So now that we understand what we need to do let's take a quick pause and write this stuff out in the
next video.