Class Veery
servicePause()
Let the agent know that an activity is about to be removed from user screen. This will have affect of activating the background mode of Veery (except if another activity has called serviceResume()).
It turns the location service either off, either to a lower consumption mode.
This should be called from the onPause callback of the Activity object.
This should not be called on non interactive classes like FirebaseInstanceIdService or FirebaseMessagingService.
Parameters
none
Returns
void
Usage / Example
import android.location.Location; import com.roofstreet.android.veery.*; public class AnyOtherActivity extends Activity { private final Veery veery = new Veery(this); protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); veery.serviceConnect(); // Required only on Main Activity // veery.setApiKeySecret("SuPeRScrET12345789GhJ"); // FirebaseApp.initializeApp(this); // veery.setFirebaseToken(FirebaseInstanceId.getInstance().getToken()); // veery.activate(Veery.GEOPROFILE); } @Override protected void onResume() { super.onResume(); veery.serviceResume(); } @Override protected void onPause() { super.onPause(); veery.servicePause(); } @Override protected void onDestroy() { super.onDestroy(); try { veery.serviceDisconnect(); } catch (Throwable t) { } } }
User interaction
If the activate() function were called with at least the FOREGROUND Parameter, the user may see the geolocation icon disapearing in the Android Task Bar.