mikehardy / google-analytics-java

Open Source license compatible Java API for Google Analytics
9 stars 3 forks source link

Implement android background service #14

Open mikehardy opened 5 years ago

mikehardy commented 5 years ago

Right now on android there is always the chance the whole application will be killed before an async/batch set of hits is sent meaning android apps should use async but should have batch size 1 to reduce UI latency but reduce risk of lost hits

With a proper service implementation there would be lifecycle management allowing for a flush before everything was torn down

Related to this - queue time should be managed

"qt parameter - Used to collect offline / latent hits. The value represents the time delta (in milliseconds) between when the hit being reported occurred and the time the hit was sent. The value must be greater than or equal to 0. Values greater than four hours may lead to hits not being processed."