Class Veery
activate(int mode)
Turn the Veery agent into the geolocation mode required by your application (foreground, background, geo-predictive, ...).
If not called, the geolocation (and the Veery agent) will remain inactive.
From Veery for Android version 1.4.0 you can replace the call to "activate" by a call to activateWithOptin
Parameters
Param name | Type | Usage |
---|---|---|
mode | int | Veery.DEACTIVATE_ALL : Veery will turn off as well as the geolocation proceses. |
Veery.FOREGROUND_GEOLOC : Veery will turn on with geolocation active only when the app is in foreground. (Requires Android Veery 1.3.2 or higher) | ||
Veery.BACKGROUND_GEOLOC : Veery will turn on with geolocation active also when the app is in background. (Requires Android Veery 1.3.2 or higher) | ||
Veery.COLLECT : Veery will be connected to the backend for historization. (Requires Android Veery 1.3.2 or higher) | ||
Veery.ROUTE_MATCH : Veery will receive trips computations. (Requires Android Veery 1.3.2 or higher) | ||
Veery.POINT_OF_INTEREST : Veery will receive Point of interest. (Requires Android Veery 1.3.2 or higher) | ||
Veery.PREDICTION : Veery will receive Predictions. (Requires Android Veery 1.3.2 or higher) | ||
------------------- BACKWARD COMPATIBILITY (older than Android Veery 1.3.2) | ||
Veery.FOREGROUND : This is equivalent to Veery.FOREGROUND_GEOLOC | ||
Veery.BACKGROUND : This is equivalent to Veery.BACKGROUND_GEOLOC | ||
Veery.BACKEND : This is equivalent to BACKGROUND + Veery.COLLECT + Veery.ROUTE_MATCH | ||
Veery.GEOPROFILE : This is equivalent to BACKEND + Veery.POINT_OF_INTEREST + Veery.PREDICTION |
Note
If Backend Services is requested without Geolocation mode the Veery.BACKGROUND_GEOLOC is used by default.
Returns
void
Usage / Example
public class MapsActivity extends AppCompatActivity { private final Veery veery = new Veery(this); protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // ...Some initialization here... veery.serviceConnect(); veery.setApiKeySecret("SuPeRScrET12345789GhJ"); FirebaseApp.initializeApp(this); veery.setFirebaseToken(FirebaseInstanceId.getInstance().getToken()); // TODO : This could be received here or later in the user story // //veery.activate(Veery.GEOPROFILE); // Requires Android Veery 1.3.2 or higher veery.activate(Veery.BACKGROUND_GEOLOC | Veery.COLLECT | Veery.ROUTE_MATCH | Veery.POINT_OF_INTEREST | Veery.PREDICTION); //or veery.activate(Veery.BACKGROUND_GEOLOC + Veery.COLLECT + Veery.ROUTE_MATCH + Veery.POINT_OF_INTEREST + Veery.PREDICTION); // ...Some initialization here... } // ... }
User interaction
Veery.FOREGROUND and Higher : if not previously given by the user, it will request the necessary authorization to get Geolocation
Veery.BACKEND and Higher : if not previsously given by the user, it will request the necessary authorization to use Notifications.