Mock GPS Locatons on a device

7 views
Skip to first unread message

Emaad Ahmed Manzoor

unread,
Mar 14, 2011, 4:01:28 PM3/14/11
to bpgc-android-community
Most of us will be using GPS, and while testing our apps out on a
phone, it won't always be possible to obtain GPS coordinates. I've
attached a function you can use to mock GPS locations from within your
code.

You've to first declare your LocationManager lm, then call the
function like this:

setMockLocation (latitude, longitude, accuracy);

--
Emaad Ahmed Manzoor,
Third Year Undergraduate,
BITS - Pilani, KK Birla Goa Campus.
halfclosed.wordpress.com

MockGPSLocations
Reply all
Reply to author
Forward
0 new messages