UnifiedNlp/sample/src/org/microg/nlp/api/sample/SampleBackendService.java
2014-03-07 17:38:00 +01:00

22 lines
650 B
Java

package org.microg.nlp.api.sample;
import android.location.Location;
import android.util.Log;
import org.microg.nlp.api.LocationBackendService;
import org.microg.nlp.api.LocationHelper;
public class SampleBackendService extends LocationBackendService {
private static final String TAG = SampleBackendService.class.getName();
@Override
protected Location update() {
if (System.currentTimeMillis() % 60000 > 2000) {
Log.d(TAG, "I decided not to answer now...");
return null;
}
Location location = LocationHelper.create("sample", 42, 42, 42);
Log.d(TAG, "I was asked for location and I answer: " + location);
return location;
}
}