Android - Initialization
Import com.visilabs.android.* package to all files for which you will be using the SDK.
There are 3 different usages of the SDK:
1- Sending data to RMC
2- Sending data to RMC and Receiving RecommendationsÂ
3- Sending data to RMC, Receiving Recommendations and In-App messagesÂ
Please use only one of the methods based on your needs and requirements.
Sending Data to RMC
Use the following method to only send data to RMC:Â
Visilabs.CreateAPI("OrganizasyonID","SiteID", "http://lgr.visilabs.net", "DataSource", "http://rt.visilabs.net" , "Android" , getApplicationContext());
Sending Data to RMC and Receiving Recommendations
Use the following method to send data to RMC and to receive Recommendations:
Visilabs.CreateAPI("OrganizasyonID", "SiteID", "http://lgr.visilabs.net", "DataSource", "http://rt.visilabs.net" , "Android" , getApplicationContext(), requestTimeout, "http://s.visilabs.net/json");
Sending Data to RMC, Receiving Recommendations and In-App MessagesÂ
Use the following method to send data to RMC, to receive Recommendations and In-App messages:
Visilabs.CreateAPI("OrganizasyonID", "SiteID", "http://lgr.visilabs.net", "DataSource", "http://rt.visilabs.net" , "Android" , getApplicationContext(), "http://s.visilabs.net/json", "http://s.visilabs.net/actjson", requestTimeout);
Sending Data to RMC, Receiving Recommendations and In-App Messages and Running Geofence Module
Use the following method to send data to RMC, to receive Recommendations and In-App messages and to run Geofence Module. If you are using this overload of CreateAPI method, define parameters in AndroidManifest.xml file.
Visilabs.CreateAPI(getApplicationContext());
<meta-data android:name="VisilabsOrganizationID" android:value="VisilabsOrganizationID" /> <meta-data android:name="VisilabsSiteID" android:value="VisilabsSiteID" /> <meta-data android:name="VisilabsSegmentURL" android:value="http://lgr.visilabs.net" /> <meta-data android:name="VisilabsDataSource" android:value="VisilabsDataSource" /> <meta-data android:name="VisilabsRealTimeURL" android:value="http://rt.visilabs.net" /> <meta-data android:name="VisilabsChannel" android:value="Android" /> <meta-data android:name="VisilabsGeofenceURL" android:value="http://s.visilabs.net/geojson" /> <meta-data android:name="VisilabsGeofenceEnabled" android:value="true" /> <!-- Parameters below are optional --!> <meta-data android:name="VisilabsRequestTimeoutInSeconds" android:value="30" /> <meta-data android:name="VisilabsRESTURL" android:value="VisilabsRESTURL" /> <meta-data android:name="VisilabsEncryptedDataSource" android:value="VisilabsEncryptedDataSource" /> <meta-data android:name="VisilabsTargetURL" android:value="http://s.visilabs.net/json" /> <meta-data android:name="VisilabsActionURL" android:value="http://s.visilabs.net/actjson" />
In order to run Geofence module define the following permissions, service and receiver in AndroidManifest.xml file:Â
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <service android:name="com.visilabs.android.gps.geofence.GeofenceTransitionsIntentService" android:enabled="true" android:permission="android.permission.BIND_JOB_SERVICE" /> <service android:name="com.visilabs.android.gps.geofence.GeofenceMonitor" android:enabled="true" android:exported="true"/> <receiver android:name="com.visilabs.android.gps.geofence.GeofenceTransitionsReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="com.visilabs.android.gps.geofence.ACTION_RECEIVE_GEOFENCE" /> </intent-filter> </receiver> <receiver android:name="com.visilabs.android.gps.geofence.VisilabsAlarm" android:exported="false"/> <receiver android:name="com.visilabs.android.gps.geofence.GeofenceBroadcastReceiver" android:enabled="true" android:exported="true"/>
To learn the OrganizationID, SiteID and Datasource Parameters, login to RMC GUI and view your profile details or send a request to RMC support.
Parent Topic:Â Android - MobileTagging
Copyright 2020 Related Digital