126 |
bjbro.setLatitude(56.380745); |
bjbro.setLatitude(56.380745); |
127 |
bjbro.setLongitude(9.655609); |
bjbro.setLongitude(9.655609); |
128 |
|
|
129 |
|
Location hillerod = new Location("gps"); |
130 |
|
hillerod.setLatitude(55.929177); |
131 |
|
hillerod.setLongitude(12.308095); |
132 |
|
|
133 |
LocationManager lm = (LocationManager) cntx.getSystemService(Context.LOCATION_SERVICE); |
LocationManager lm = (LocationManager) cntx.getSystemService(Context.LOCATION_SERVICE); |
134 |
if (lm.getProvider("gps2") == null) |
if (lm.getProvider("gps2") == null) |
135 |
lm.addTestProvider("gps2", false, true, true, false, false, false, false, 0, Criteria.ACCURACY_FINE ); |
lm.addTestProvider("gps2", false, true, true, false, false, false, false, 0, Criteria.ACCURACY_FINE ); |
136 |
lm.setTestProviderEnabled("gps2", true); |
lm.setTestProviderEnabled("gps2", true); |
137 |
lm.setTestProviderLocation("gps2", kbh); |
lm.setTestProviderLocation("gps2", hillerod); |
138 |
} |
} |
139 |
|
|
140 |
public static void removeMockLocation(Context cntx) { |
public static void removeMockLocation(Context cntx) { |