I am using the Application.Storage module to store the data that failed to send through the web requests I made. My callback method for the web requests looks like this:
I am using the Application.Storage module to store the data that failed to send through the web requests I made. My callback method for the web requests looks like this:
Why are you retrying when it was successfully sent?
The first question, is why are you filling up Storage in the first place? Are you using a different key each time you save something or are you using the same ley for everything?
I'd use a key like "Unsent", and then if there is an error, save using that key, so you'd never have more than one unsent bit of data.
Correct, I am using a different key each time. I am just trying to retain as much data as possible by implementing a circular buffer but I am not sure how to.
According to the docs developer.garmin.com/.../Storage.html you get a StorageFullException. It's always worth to read the docs before asking things like that
Have a value in storage like "LastDataNum" with a value of say 1 to 10
first thing you store is "Unsent1" and increment "lastDataNum". When that value gets to 11 (for example), reset to 1, and use that
you end up with the last 10 unsent items and LastdataNum lets you know where in that 10 to start
It's clear he knows this, he wrote: 1 he implemented a circular buffer already, 2 instead of using a constant size he wants to increase it as much as possible until the storage is full
Thank you!