After creating the IALocationManager , you can register and unregister for periodic updates of the user’s current location. To this end, you have to implement the IALocationListener interface and override its onLocationChanged() callback method. This is the place where your location updates will be delivered as IALocation objects


private IALocationListener mIALocationListener = new IALocationListener() {

    // Called when the location has changed.
    @Override
    public void onLocationChanged(IALocation location) {

        Log.d(TAG, "Latitude: " + location.getLatitude());
        Log.d(TAG, "Longitude: " + location.getLongitude());
        Log.d(TAG, "Floor number: " + location.getFloorLevel());
    }
};



To start receiving location updates you also have to call the requestLocationUpdates() method, where you provide an instance of IALocationRequest as a parameter. It may include extra options for location manager. You may consider doing this e.g. in your activity’s onResume() and onPause() methods respectively.


@Override
protected void onResume() {
    super.onResume();
    mIALocationManager.requestLocationUpdates(IALocationRequest.create(), mIALocationListener);
}



Note that there are several complete examples in the IndoorAtlas Android Examples


Location updates during temporary network connection loss


Since IndoorAtlas SDK 2.2.x the location updates continue even if the network connection is down for a short time. You will get smoother Wi-Fi hand-overs and better performance when network connection briefly goes offline. This is signaled by a service status of STATUS_TEMPORARILY_UNAVAILABLE.