You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
The first iteration of Android Telemetry ( #2421) was built using the original Events data model (aka V1). V2 has now been internally approved and will what is used going forward. Android needs to be converted to use this data model so that it only uses V2 from Telemetry's initial release in 4.0.0..
While implementing isPluggedIn() for the pluggedIn attribute I found that the ideal API in Android is BatteryManager.ACTION_CHARGING. However it's API 23+ which means we'll likely have to rely on a combination of BATTERY_PLUGGED_AC, BATTERY_PLUGGED_USB, and BATTERY_STATUS_CHARGING.
I decided to go with reusing the ACTION_BATTERY_CHANGED Intent that's already being used for determining battery level to determine if the device is currently connected or not as described in Google's documentation instead of implementing the more sophisticated ACTION_POWER_CONNECTED and ACTION_POWER_DISCONNECTED as it required using a standalone BroadcastReceiver. This may change in the future however.
I also limited the isPluggedIn() determination to BATTERY_PLUGGED_USB and BATTERY_PLUGGED_AC even though according to the documentation it'd likely be safe to assume anything greater than 0 for this value would indicate being plugged in. The value being "knowing for sure" over "not knowing for sure, but pretty likely". BATTERY_PLUGGED_WIRELESS was not used as it is API 17+ while the SDK currently supports 15+. Again, these things may change in the future.
Confirmed that all the events minus map.load made it into the server. I think this is a race condition as map.load and appTurnstile are tied together and appTurnstile flushes immediately. This is likely causing the event queue may be being cleared out after appTurnstile is sent but just after the time map.load is being added.
I confirmed with @camilleanne in chat that order is irrelevant for map.load and appTurnstile so I refactored the processing to do map.load first so that when appTurnstile flushes the queue it'll already be there and will get sent.
@bleege@camilleanne thanks for confirming. iOS had already been changed to send the turnstile on map load. In a more recent commit, I've added an api client that make it easy to send the turnstile event immediately whenever a mapview event is about to be enqueued (but still only once per "session")
Activity
[android] #4071 - Changing endpoint URL to v2
[android] #4071 - Converting appUserTurnstile event to V2
[android] #4071 - Refactoring mapboxVendorId to always ensure there's…
[android] #4071 - Converting location event to V2
bleege commentedon Feb 23, 2016
While implementing
isPluggedIn()for thepluggedInattribute I found that the ideal API in Android isBatteryManager.ACTION_CHARGING. However it's API 23+ which means we'll likely have to rely on a combination ofBATTERY_PLUGGED_AC,BATTERY_PLUGGED_USB, andBATTERY_STATUS_CHARGING.[android] #4071 - Converting map.load, map.click, and map.dragend to V2
bleege commentedon Feb 23, 2016
I decided to go with reusing the
ACTION_BATTERY_CHANGEDIntent that's already being used for determining battery level to determine if the device is currently connected or not as described in Google's documentation instead of implementing the more sophisticatedACTION_POWER_CONNECTEDandACTION_POWER_DISCONNECTEDas it required using a standalone BroadcastReceiver. This may change in the future however.I also limited the
isPluggedIn()determination toBATTERY_PLUGGED_USBandBATTERY_PLUGGED_ACeven though according to the documentation it'd likely be safe to assume anything greater than 0 for this value would indicate being plugged in. The value being "knowing for sure" over "not knowing for sure, but pretty likely".BATTERY_PLUGGED_WIRELESSwas not used as it is API 17+ while the SDK currently supports 15+. Again, these things may change in the future.[android] #4071 - Creating new JSON builder for events
[android] #4071 - Incorportating gesture_id into json builder and rem…
[android] #4071 - Restoring lat, lon, zoom for gesture events
12 remaining items
bleege commentedon Feb 24, 2016
Confirmed
appTurnstileandlocationevents with latest code accepted and displayed in database.bleege commentedon Feb 24, 2016
Confirmed
map.loadevent with same code as previous comment.bleege commentedon Feb 24, 2016
Confirmed
map.clickandmap.dragendwith new code that broke them apart. Registered all 8 types of Gestures formap.click.Will do one final test for all events with code base before officially signing off on this.
bleege commentedon Feb 24, 2016
Confirmed that all the events minus
map.loadmade it into the server. I think this is a race condition asmap.loadandappTurnstileare tied together andappTurnstileflushes immediately. This is likely causing the event queue may be being cleared out afterappTurnstileis sent but just after the timemap.loadis being added.bleege commentedon Feb 24, 2016
I confirmed with @camilleanne in chat that order is irrelevant for
map.loadandappTurnstileso I refactored the processing to domap.loadfirst so that whenappTurnstileflushes the queue it'll already be there and will get sent.I think Android is ready to go with V2 now! 🎉
boundsj commentedon Feb 24, 2016
@bleege @camilleanne thanks for confirming. iOS had already been changed to send the turnstile on map load. In a more recent commit, I've added an api client that make it easy to send the turnstile event immediately whenever a mapview event is about to be enqueued (but still only once per "session")
zugaldia commentedon Feb 24, 2016
💥 💥 💥
[android] #4071 - Android Telemetry Initial Implementation