You can store the last timestamp in the user session (on the server) and if the new request has the same timestamp just ignore it.
This can be done, by filtering the unique id sent from the terminal, since the timestamp can be the very same for two posts which are valid. In fact, I will soon do this, thank you.
However it's getting really weird! Today, client remembered, that apart from server showing 50-60 entries of the same item, the printer got the same 50-60 entries printed as well!
My app is using an activity, activity then sends data to a service, and then the service a) sends data to server and b) AFTER we have a successful return from server, we send the job to the printer.
This may mean that somehow I have multiple jobs indeed. BUT, I have a copy of the db and it shows something even stranger. I see that while most of the duplicate posts are identical, from the 50-60 entries, there are some 5 of them which differentiate in a specific field!!! This field is a process global var, which under no way can change while user sends data. Somehow, to me, the key is in the fact that android's screen was blinking for some time. That is, perhaps my service restarts (?), but even if so, how on earth this var can change???
This all, brings me to the point to suspect the particular device, though I don't quite understand how it can go crashing and repeating actions on each own. Any ideas?
PS: Needless (?) to say, that this app is up for 3 years now, 500+ installations, many of them under very heavy usage, and I never had such kind of a report before.