Skip to content

Instantly share code, notes, and snippets.

@codenameone
Last active July 8, 2020 09:57
Show Gist options
  • Save codenameone/9dc822cf80cc8bf3a6cc to your computer and use it in GitHub Desktop.
Save codenameone/9dc822cf80cc8bf3a6cc to your computer and use it in GitHub Desktop.
LocationListener sends events about location updates to a Codename One application that is currently in the forground
public MyListener implements LocationListener {
public void locationUpdated(Location location) {
// update UI etc.
}
public void providerStateChanged(int newState) {
// handle status changes/errors appropriately
}
}
LocationManager.getLocationManager().setLocationListener(new MyListener());
@codenameone
Copy link
Author

Sample usage of the LocationManager & Location API's.

From the Codename One project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment